diff --git a/agents_api/.github/workflows/python.yml b/agents_api/.github/workflows/python.yml new file mode 100644 index 00000000..129fc497 --- /dev/null +++ b/agents_api/.github/workflows/python.yml @@ -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 diff --git a/agents_api/.gitignore b/agents_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/agents_api/.gitignore @@ -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 diff --git a/agents_api/.gitlab-ci.yml b/agents_api/.gitlab-ci.yml new file mode 100644 index 00000000..337432fd --- /dev/null +++ b/agents_api/.gitlab-ci.yml @@ -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 diff --git a/agents_api/.openapi-generator-ignore b/agents_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/agents_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/agents_api/.openapi-generator/FILES b/agents_api/.openapi-generator/FILES new file mode 100644 index 00000000..a2df8725 --- /dev/null +++ b/agents_api/.openapi-generator/FILES @@ -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 diff --git a/agents_api/.openapi-generator/VERSION b/agents_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/agents_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/agents_api/.travis.yml b/agents_api/.travis.yml new file mode 100644 index 00000000..7ade2997 --- /dev/null +++ b/agents_api/.travis.yml @@ -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 diff --git a/agents_api/README.md b/agents_api/README.md new file mode 100644 index 00000000..535c707c --- /dev/null +++ b/agents_api/README.md @@ -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) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/agents_api/agents_api/__init__.py b/agents_api/agents_api/__init__.py new file mode 100644 index 00000000..d73de25d --- /dev/null +++ b/agents_api/agents_api/__init__.py @@ -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 diff --git a/agents_api/agents_api/api/__init__.py b/agents_api/agents_api/api/__init__.py new file mode 100644 index 00000000..29594b74 --- /dev/null +++ b/agents_api/agents_api/api/__init__.py @@ -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 + diff --git a/agents_api/agents_api/api/cloud_and_enterprise_agent_notification_rules_api.py b/agents_api/agents_api/api/cloud_and_enterprise_agent_notification_rules_api.py new file mode 100644 index 00000000..235a8bb9 --- /dev/null +++ b/agents_api/agents_api/api/cloud_and_enterprise_agent_notification_rules_api.py @@ -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 + ) + + diff --git a/agents_api/agents_api/api/cloud_and_enterprise_agents_api.py b/agents_api/agents_api/api/cloud_and_enterprise_agents_api.py new file mode 100644 index 00000000..a0cda0b6 --- /dev/null +++ b/agents_api/agents_api/api/cloud_and_enterprise_agents_api.py @@ -0,0 +1,1323 @@ +# 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.agent_list_expand import AgentListExpand +from agents_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from agents_api.models.enterprise_agent_request_body import EnterpriseAgentRequestBody +from agents_api.models.get_agent_details200_response import GetAgentDetails200Response +from agents_api.models.get_agents200_response import GetAgents200Response +from agents_api.models.update_enterprise_agent_details200_response import UpdateEnterpriseAgentDetails200Response + +from agents_api.api_client import ApiClient +from agents_api.api_response import ApiResponse +from agents_api.rest import RESTResponseType + + +class CloudAndEnterpriseAgentsApi: + """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 delete_enterprise_agent( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the agent.")], + 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, + ) -> None: + """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. + + :param agent_id: Unique ID for the agent. (required) + :type agent_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._delete_enterprise_agent_serialize( + agent_id=agent_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_enterprise_agent_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the agent.")], + 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[None]: + """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. + + :param agent_id: Unique ID for the agent. (required) + :type agent_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._delete_enterprise_agent_serialize( + agent_id=agent_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_enterprise_agent_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the agent.")], + 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: + """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. + + :param agent_id: Unique ID for the agent. (required) + :type agent_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._delete_enterprise_agent_serialize( + agent_id=agent_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_enterprise_agent_serialize( + self, + agent_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 agent_id is not None: + _path_params['agentId'] = agent_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/agents/{agentId}', + 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_agent_details( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the agent.")], + 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: + """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. + + :param agent_id: Unique ID for the agent. (required) + :type agent_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 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._get_agent_details_serialize( + agent_id=agent_id, + 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", + '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_details_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the agent.")], + 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]: + """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. + + :param agent_id: Unique ID for the agent. (required) + :type agent_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 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._get_agent_details_serialize( + agent_id=agent_id, + 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", + '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_details_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the agent.")], + 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: + """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. + + :param agent_id: Unique ID for the agent. (required) + :type agent_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 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._get_agent_details_serialize( + agent_id=agent_id, + 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", + '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_details_serialize( + self, + agent_id, + 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 + + + # 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/{agentId}', + 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( + 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, + expand: Annotated[Optional[List[AgentListExpand]], 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, + agent_types: Annotated[Optional[List[CloudEnterpriseAgentType]], Field(description="Specifies the type of agent to request.")] = 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: + """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 agent’s public and private IP addresses, as well as the public network where the agent is located. + + :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[AgentListExpand] + :param agent_types: Specifies the type of agent to request. + :type agent_types: List[CloudEnterpriseAgentType] + :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_serialize( + aid=aid, + expand=expand, + agent_types=agent_types, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAgents200Response", + '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_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, + expand: Annotated[Optional[List[AgentListExpand]], 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, + agent_types: Annotated[Optional[List[CloudEnterpriseAgentType]], Field(description="Specifies the type of agent to request.")] = 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]: + """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 agent’s public and private IP addresses, as well as the public network where the agent is located. + + :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[AgentListExpand] + :param agent_types: Specifies the type of agent to request. + :type agent_types: List[CloudEnterpriseAgentType] + :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_serialize( + aid=aid, + expand=expand, + agent_types=agent_types, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAgents200Response", + '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_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, + expand: Annotated[Optional[List[AgentListExpand]], 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, + agent_types: Annotated[Optional[List[CloudEnterpriseAgentType]], Field(description="Specifies the type of agent to request.")] = 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 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 agent’s public and private IP addresses, as well as the public network where the agent is located. + + :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[AgentListExpand] + :param agent_types: Specifies the type of agent to request. + :type agent_types: List[CloudEnterpriseAgentType] + :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_serialize( + aid=aid, + expand=expand, + agent_types=agent_types, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAgents200Response", + '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_serialize( + self, + aid, + expand, + agent_types, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> Tuple: + + _host = None + + _collection_formats: Dict[str, str] = { + + 'expand': 'csv', + 'agentTypes': '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 + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if agent_types is not None: + + _query_params.append(('agentTypes', agent_types)) + + # 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', + 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 update_enterprise_agent_details( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the agent.")], + enterprise_agent_request_body: EnterpriseAgentRequestBody, + 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, + ) -> UpdateEnterpriseAgentDetails200Response: + """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. + + :param agent_id: Unique ID for the agent. (required) + :type agent_id: str + :param enterprise_agent_request_body: (required) + :type enterprise_agent_request_body: EnterpriseAgentRequestBody + :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._update_enterprise_agent_details_serialize( + agent_id=agent_id, + enterprise_agent_request_body=enterprise_agent_request_body, + 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': "UpdateEnterpriseAgentDetails200Response", + '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 update_enterprise_agent_details_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the agent.")], + enterprise_agent_request_body: EnterpriseAgentRequestBody, + 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[UpdateEnterpriseAgentDetails200Response]: + """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. + + :param agent_id: Unique ID for the agent. (required) + :type agent_id: str + :param enterprise_agent_request_body: (required) + :type enterprise_agent_request_body: EnterpriseAgentRequestBody + :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._update_enterprise_agent_details_serialize( + agent_id=agent_id, + enterprise_agent_request_body=enterprise_agent_request_body, + 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': "UpdateEnterpriseAgentDetails200Response", + '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 update_enterprise_agent_details_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the agent.")], + enterprise_agent_request_body: EnterpriseAgentRequestBody, + 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: + """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. + + :param agent_id: Unique ID for the agent. (required) + :type agent_id: str + :param enterprise_agent_request_body: (required) + :type enterprise_agent_request_body: EnterpriseAgentRequestBody + :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._update_enterprise_agent_details_serialize( + agent_id=agent_id, + enterprise_agent_request_body=enterprise_agent_request_body, + 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': "UpdateEnterpriseAgentDetails200Response", + '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 _update_enterprise_agent_details_serialize( + self, + agent_id, + enterprise_agent_request_body, + 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 enterprise_agent_request_body is not None: + _body_params = enterprise_agent_request_body + + + # 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/hal+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='PUT', + resource_path='/v7/agents/{agentId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/agents_api/agents_api/api/enterprise_agent_cluster_api.py b/agents_api/agents_api/api/enterprise_agent_cluster_api.py new file mode 100644 index 00000000..e3066b12 --- /dev/null +++ b/agents_api/agents_api/api/enterprise_agent_cluster_api.py @@ -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 cluster’s `agentId` value. The last `memberId` listed in the POST body inherits the cluster’s `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 cluster’s `agentId` value. The last `memberId` listed in the POST body inherits the cluster’s `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 cluster’s `agentId` value. The last `memberId` listed in the POST body inherits the cluster’s `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 + ) + + diff --git a/agents_api/agents_api/api/proxies_api.py b/agents_api/agents_api/api/proxies_api.py new file mode 100644 index 00000000..5070266c --- /dev/null +++ b/agents_api/agents_api/api/proxies_api.py @@ -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 + ) + + diff --git a/agents_api/agents_api/api_client.py b/agents_api/agents_api/api_client.py new file mode 100644 index 00000000..936dfaa6 --- /dev/null +++ b/agents_api/agents_api/api_client.py @@ -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) diff --git a/agents_api/agents_api/api_response.py b/agents_api/agents_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/agents_api/agents_api/api_response.py @@ -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 + } diff --git a/agents_api/agents_api/configuration.py b/agents_api/agents_api/configuration.py new file mode 100644 index 00000000..dd1548ff --- /dev/null +++ b/agents_api/agents_api/configuration.py @@ -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 diff --git a/agents_api/agents_api/exceptions.py b/agents_api/agents_api/exceptions.py new file mode 100644 index 00000000..41742aa7 --- /dev/null +++ b/agents_api/agents_api/exceptions.py @@ -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 diff --git a/agents_api/agents_api/models/__init__.py b/agents_api/agents_api/models/__init__.py new file mode 100644 index 00000000..77a27512 --- /dev/null +++ b/agents_api/agents_api/models/__init__.py @@ -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 diff --git a/agents_api/agents_api/models/account_group.py b/agents_api/agents_api/models/account_group.py new file mode 100644 index 00000000..793775d2 --- /dev/null +++ b/agents_api/agents_api/models/account_group.py @@ -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 + + diff --git a/agents_api/agents_api/models/account_group_id.py b/agents_api/agents_api/models/account_group_id.py new file mode 100644 index 00000000..1ba848fc --- /dev/null +++ b/agents_api/agents_api/models/account_group_id.py @@ -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 + + diff --git a/agents_api/agents_api/models/agent.py b/agents_api/agents_api/models/agent.py new file mode 100644 index 00000000..00f1a9b3 --- /dev/null +++ b/agents_api/agents_api/models/agent.py @@ -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 agent’s 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 + + diff --git a/agents_api/agents_api/models/agent_base.py b/agents_api/agents_api/models/agent_base.py new file mode 100644 index 00000000..542368fb --- /dev/null +++ b/agents_api/agents_api/models/agent_base.py @@ -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 agent’s 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 + + diff --git a/agents_api/agents_api/models/agent_detail.py b/agents_api/agents_api/models/agent_detail.py new file mode 100644 index 00000000..ca2191bb --- /dev/null +++ b/agents_api/agents_api/models/agent_detail.py @@ -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 agent’s 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 + + diff --git a/agents_api/agents_api/models/agent_details.py b/agents_api/agents_api/models/agent_details.py new file mode 100644 index 00000000..7dd3084a --- /dev/null +++ b/agents_api/agents_api/models/agent_details.py @@ -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()) + + diff --git a/agents_api/agents_api/models/agent_details_expand.py b/agents_api/agents_api/models/agent_details_expand.py new file mode 100644 index 00000000..3ed27744 --- /dev/null +++ b/agents_api/agents_api/models/agent_details_expand.py @@ -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)) + + diff --git a/agents_api/agents_api/models/agent_ipv6_policy.py b/agents_api/agents_api/models/agent_ipv6_policy.py new file mode 100644 index 00000000..f30bfe1e --- /dev/null +++ b/agents_api/agents_api/models/agent_ipv6_policy.py @@ -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)) + + diff --git a/agents_api/agents_api/models/agent_list_expand.py b/agents_api/agents_api/models/agent_list_expand.py new file mode 100644 index 00000000..5148f314 --- /dev/null +++ b/agents_api/agents_api/models/agent_list_expand.py @@ -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)) + + diff --git a/agents_api/agents_api/models/agent_proxies.py b/agents_api/agents_api/models/agent_proxies.py new file mode 100644 index 00000000..78afaf9e --- /dev/null +++ b/agents_api/agents_api/models/agent_proxies.py @@ -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 + + diff --git a/agents_api/agents_api/models/agent_proxy.py b/agents_api/agents_api/models/agent_proxy.py new file mode 100644 index 00000000..e54c53cf --- /dev/null +++ b/agents_api/agents_api/models/agent_proxy.py @@ -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 agent’s 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 + + diff --git a/agents_api/agents_api/models/agents.py b/agents_api/agents_api/models/agents.py new file mode 100644 index 00000000..4e872e92 --- /dev/null +++ b/agents_api/agents_api/models/agents.py @@ -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 + + diff --git a/agents_api/agents_api/models/alert_email.py b/agents_api/agents_api/models/alert_email.py new file mode 100644 index 00000000..47b0f563 --- /dev/null +++ b/agents_api/agents_api/models/alert_email.py @@ -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 + + diff --git a/agents_api/agents_api/models/alert_integration_base.py b/agents_api/agents_api/models/alert_integration_base.py new file mode 100644 index 00000000..34491e02 --- /dev/null +++ b/agents_api/agents_api/models/alert_integration_base.py @@ -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 + + diff --git a/agents_api/agents_api/models/alert_integration_type.py b/agents_api/agents_api/models/alert_integration_type.py new file mode 100644 index 00000000..772600d4 --- /dev/null +++ b/agents_api/agents_api/models/alert_integration_type.py @@ -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)) + + diff --git a/agents_api/agents_api/models/assign_enterprise_agent_cluster_request.py b/agents_api/agents_api/models/assign_enterprise_agent_cluster_request.py new file mode 100644 index 00000000..16930036 --- /dev/null +++ b/agents_api/agents_api/models/assign_enterprise_agent_cluster_request.py @@ -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 + + diff --git a/agents_api/agents_api/models/cloud_enterprise_agent.py b/agents_api/agents_api/models/cloud_enterprise_agent.py new file mode 100644 index 00000000..42d1e1fd --- /dev/null +++ b/agents_api/agents_api/models/cloud_enterprise_agent.py @@ -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()) + + diff --git a/agents_api/agents_api/models/cloud_enterprise_agent_type.py b/agents_api/agents_api/models/cloud_enterprise_agent_type.py new file mode 100644 index 00000000..db0116f8 --- /dev/null +++ b/agents_api/agents_api/models/cloud_enterprise_agent_type.py @@ -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)) + + diff --git a/agents_api/agents_api/models/cloud_enterprise_agents.py b/agents_api/agents_api/models/cloud_enterprise_agents.py new file mode 100644 index 00000000..afc276f3 --- /dev/null +++ b/agents_api/agents_api/models/cloud_enterprise_agents.py @@ -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 + + diff --git a/agents_api/agents_api/models/cluster_member.py b/agents_api/agents_api/models/cluster_member.py new file mode 100644 index 00000000..dc865969 --- /dev/null +++ b/agents_api/agents_api/models/cluster_member.py @@ -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 agent’s 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 + + diff --git a/agents_api/agents_api/models/enterprise_agent.py b/agents_api/agents_api/models/enterprise_agent.py new file mode 100644 index 00000000..30430f64 --- /dev/null +++ b/agents_api/agents_api/models/enterprise_agent.py @@ -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 agent’s 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 + + diff --git a/agents_api/agents_api/models/enterprise_agent_detail.py b/agents_api/agents_api/models/enterprise_agent_detail.py new file mode 100644 index 00000000..f33cd757 --- /dev/null +++ b/agents_api/agents_api/models/enterprise_agent_detail.py @@ -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 agent’s 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 + + diff --git a/agents_api/agents_api/models/enterprise_agent_ipv6_policy.py b/agents_api/agents_api/models/enterprise_agent_ipv6_policy.py new file mode 100644 index 00000000..89de4aaa --- /dev/null +++ b/agents_api/agents_api/models/enterprise_agent_ipv6_policy.py @@ -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)) + + diff --git a/agents_api/agents_api/models/enterprise_agent_request_body.py b/agents_api/agents_api/models/enterprise_agent_request_body.py new file mode 100644 index 00000000..dd0e847b --- /dev/null +++ b/agents_api/agents_api/models/enterprise_agent_request_body.py @@ -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 + + diff --git a/agents_api/agents_api/models/enterprise_agent_state.py b/agents_api/agents_api/models/enterprise_agent_state.py new file mode 100644 index 00000000..da16ee7e --- /dev/null +++ b/agents_api/agents_api/models/enterprise_agent_state.py @@ -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)) + + diff --git a/agents_api/agents_api/models/error.py b/agents_api/agents_api/models/error.py new file mode 100644 index 00000000..2354ad37 --- /dev/null +++ b/agents_api/agents_api/models/error.py @@ -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 + + diff --git a/agents_api/agents_api/models/error_detail.py b/agents_api/agents_api/models/error_detail.py new file mode 100644 index 00000000..5a2b3ffa --- /dev/null +++ b/agents_api/agents_api/models/error_detail.py @@ -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 + + diff --git a/agents_api/agents_api/models/error_detail_code.py b/agents_api/agents_api/models/error_detail_code.py new file mode 100644 index 00000000..795f86b3 --- /dev/null +++ b/agents_api/agents_api/models/error_detail_code.py @@ -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)) + + diff --git a/agents_api/agents_api/models/get_agent_details200_response.py b/agents_api/agents_api/models/get_agent_details200_response.py new file mode 100644 index 00000000..4a49c09b --- /dev/null +++ b/agents_api/agents_api/models/get_agent_details200_response.py @@ -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 agent’s 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 + + diff --git a/agents_api/agents_api/models/get_agent_proxies200_response.py b/agents_api/agents_api/models/get_agent_proxies200_response.py new file mode 100644 index 00000000..f4482ba0 --- /dev/null +++ b/agents_api/agents_api/models/get_agent_proxies200_response.py @@ -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 + + diff --git a/agents_api/agents_api/models/get_agents200_response.py b/agents_api/agents_api/models/get_agents200_response.py new file mode 100644 index 00000000..ca0d4d54 --- /dev/null +++ b/agents_api/agents_api/models/get_agents200_response.py @@ -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 + + diff --git a/agents_api/agents_api/models/get_agents_notification_rule200_response.py b/agents_api/agents_api/models/get_agents_notification_rule200_response.py new file mode 100644 index 00000000..bc58c4e7 --- /dev/null +++ b/agents_api/agents_api/models/get_agents_notification_rule200_response.py @@ -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 + + diff --git a/agents_api/agents_api/models/get_agents_notification_rules200_response.py b/agents_api/agents_api/models/get_agents_notification_rules200_response.py new file mode 100644 index 00000000..ce72d092 --- /dev/null +++ b/agents_api/agents_api/models/get_agents_notification_rules200_response.py @@ -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 + + diff --git a/agents_api/agents_api/models/interface_ip_mapping.py b/agents_api/agents_api/models/interface_ip_mapping.py new file mode 100644 index 00000000..2794216c --- /dev/null +++ b/agents_api/agents_api/models/interface_ip_mapping.py @@ -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 + + diff --git a/agents_api/agents_api/models/labels.py b/agents_api/agents_api/models/labels.py new file mode 100644 index 00000000..dde99dff --- /dev/null +++ b/agents_api/agents_api/models/labels.py @@ -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 + + diff --git a/agents_api/agents_api/models/link.py b/agents_api/agents_api/models/link.py new file mode 100644 index 00000000..96acc497 --- /dev/null +++ b/agents_api/agents_api/models/link.py @@ -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 + + diff --git a/agents_api/agents_api/models/notification.py b/agents_api/agents_api/models/notification.py new file mode 100644 index 00000000..93f71396 --- /dev/null +++ b/agents_api/agents_api/models/notification.py @@ -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 + + diff --git a/agents_api/agents_api/models/notification_rule.py b/agents_api/agents_api/models/notification_rule.py new file mode 100644 index 00000000..dec13fdc --- /dev/null +++ b/agents_api/agents_api/models/notification_rule.py @@ -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 + + diff --git a/agents_api/agents_api/models/notification_rule_detail.py b/agents_api/agents_api/models/notification_rule_detail.py new file mode 100644 index 00000000..f609ab5e --- /dev/null +++ b/agents_api/agents_api/models/notification_rule_detail.py @@ -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 + + diff --git a/agents_api/agents_api/models/notification_rules.py b/agents_api/agents_api/models/notification_rules.py new file mode 100644 index 00000000..b0624d24 --- /dev/null +++ b/agents_api/agents_api/models/notification_rules.py @@ -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 + + diff --git a/agents_api/agents_api/models/notifications.py b/agents_api/agents_api/models/notifications.py new file mode 100644 index 00000000..6f922552 --- /dev/null +++ b/agents_api/agents_api/models/notifications.py @@ -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 + + diff --git a/agents_api/agents_api/models/proxy_auth_type.py b/agents_api/agents_api/models/proxy_auth_type.py new file mode 100644 index 00000000..52073b5d --- /dev/null +++ b/agents_api/agents_api/models/proxy_auth_type.py @@ -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)) + + diff --git a/agents_api/agents_api/models/proxy_type.py b/agents_api/agents_api/models/proxy_type.py new file mode 100644 index 00000000..46bdeb20 --- /dev/null +++ b/agents_api/agents_api/models/proxy_type.py @@ -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)) + + diff --git a/agents_api/agents_api/models/self_links.py b/agents_api/agents_api/models/self_links.py new file mode 100644 index 00000000..06a305bd --- /dev/null +++ b/agents_api/agents_api/models/self_links.py @@ -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 + + diff --git a/agents_api/agents_api/models/self_links_links.py b/agents_api/agents_api/models/self_links_links.py new file mode 100644 index 00000000..2955aaeb --- /dev/null +++ b/agents_api/agents_api/models/self_links_links.py @@ -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 + + diff --git a/agents_api/agents_api/models/simple_test.py b/agents_api/agents_api/models/simple_test.py new file mode 100644 index 00000000..2ed013b4 --- /dev/null +++ b/agents_api/agents_api/models/simple_test.py @@ -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 + + diff --git a/agents_api/agents_api/models/test_interval.py b/agents_api/agents_api/models/test_interval.py new file mode 100644 index 00000000..0449e88b --- /dev/null +++ b/agents_api/agents_api/models/test_interval.py @@ -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)) + + diff --git a/agents_api/agents_api/models/test_type.py b/agents_api/agents_api/models/test_type.py new file mode 100644 index 00000000..f4a13130 --- /dev/null +++ b/agents_api/agents_api/models/test_type.py @@ -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)) + + diff --git a/agents_api/agents_api/models/unassign_enterprise_agent_from_cluster_request.py b/agents_api/agents_api/models/unassign_enterprise_agent_from_cluster_request.py new file mode 100644 index 00000000..11b1c059 --- /dev/null +++ b/agents_api/agents_api/models/unassign_enterprise_agent_from_cluster_request.py @@ -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 + + diff --git a/agents_api/agents_api/models/unauthorized_error.py b/agents_api/agents_api/models/unauthorized_error.py new file mode 100644 index 00000000..cb4762c8 --- /dev/null +++ b/agents_api/agents_api/models/unauthorized_error.py @@ -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 + + diff --git a/agents_api/agents_api/models/unexpanded_instant_test.py b/agents_api/agents_api/models/unexpanded_instant_test.py new file mode 100644 index 00000000..b63001c2 --- /dev/null +++ b/agents_api/agents_api/models/unexpanded_instant_test.py @@ -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 + + diff --git a/agents_api/agents_api/models/unexpanded_instant_test_links.py b/agents_api/agents_api/models/unexpanded_instant_test_links.py new file mode 100644 index 00000000..5e145dfb --- /dev/null +++ b/agents_api/agents_api/models/unexpanded_instant_test_links.py @@ -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 + + diff --git a/agents_api/agents_api/models/unexpanded_instant_test_links_self.py b/agents_api/agents_api/models/unexpanded_instant_test_links_self.py new file mode 100644 index 00000000..3baf86d2 --- /dev/null +++ b/agents_api/agents_api/models/unexpanded_instant_test_links_self.py @@ -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 + + diff --git a/agents_api/agents_api/models/unexpanded_instant_test_links_test_results.py b/agents_api/agents_api/models/unexpanded_instant_test_links_test_results.py new file mode 100644 index 00000000..3e73ce71 --- /dev/null +++ b/agents_api/agents_api/models/unexpanded_instant_test_links_test_results.py @@ -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()) + + diff --git a/agents_api/agents_api/models/unexpanded_test.py b/agents_api/agents_api/models/unexpanded_test.py new file mode 100644 index 00000000..2af9d367 --- /dev/null +++ b/agents_api/agents_api/models/unexpanded_test.py @@ -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 + + diff --git a/agents_api/agents_api/models/update_enterprise_agent_details200_response.py b/agents_api/agents_api/models/update_enterprise_agent_details200_response.py new file mode 100644 index 00000000..5496e0b8 --- /dev/null +++ b/agents_api/agents_api/models/update_enterprise_agent_details200_response.py @@ -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 agent’s 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 + + diff --git a/agents_api/agents_api/py.typed b/agents_api/agents_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/agents_api/agents_api/rest.py b/agents_api/agents_api/rest.py new file mode 100644 index 00000000..e6146afd --- /dev/null +++ b/agents_api/agents_api/rest.py @@ -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) diff --git a/agents_api/docs/AccountGroup.md b/agents_api/docs/AccountGroup.md new file mode 100644 index 00000000..4c53ca8e --- /dev/null +++ b/agents_api/docs/AccountGroup.md @@ -0,0 +1,29 @@ +# AccountGroup + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**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) + + diff --git a/agents_api/docs/AccountGroupId.md b/agents_api/docs/AccountGroupId.md new file mode 100644 index 00000000..37c02068 --- /dev/null +++ b/agents_api/docs/AccountGroupId.md @@ -0,0 +1,28 @@ +# AccountGroupId + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] + +## 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) + + diff --git a/agents_api/docs/Agent.md b/agents_api/docs/Agent.md new file mode 100644 index 00000000..d63f60ac --- /dev/null +++ b/agents_api/docs/Agent.md @@ -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 agent’s 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'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) + + diff --git a/agents_api/docs/AgentBase.md b/agents_api/docs/AgentBase.md new file mode 100644 index 00000000..45262d39 --- /dev/null +++ b/agents_api/docs/AgentBase.md @@ -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 agent’s 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) + + diff --git a/agents_api/docs/AgentDetail.md b/agents_api/docs/AgentDetail.md new file mode 100644 index 00000000..360fa285 --- /dev/null +++ b/agents_api/docs/AgentDetail.md @@ -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 agent’s 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's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] +**tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] +**labels** | [**List[Labels]**](Labels.md) | List of labels - see `/labels` 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) + + diff --git a/agents_api/docs/AgentDetails.md b/agents_api/docs/AgentDetails.md new file mode 100644 index 00000000..b895ad5e --- /dev/null +++ b/agents_api/docs/AgentDetails.md @@ -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 agent’s 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'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 `/tests` 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 `/labels` 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) + + diff --git a/agents_api/docs/AgentDetailsExpand.md b/agents_api/docs/AgentDetailsExpand.md new file mode 100644 index 00000000..98168ad6 --- /dev/null +++ b/agents_api/docs/AgentDetailsExpand.md @@ -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) + + diff --git a/agents_api/docs/AgentIpv6Policy.md b/agents_api/docs/AgentIpv6Policy.md new file mode 100644 index 00000000..c8a0d372 --- /dev/null +++ b/agents_api/docs/AgentIpv6Policy.md @@ -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) + + diff --git a/agents_api/docs/AgentListExpand.md b/agents_api/docs/AgentListExpand.md new file mode 100644 index 00000000..6fa7c0a9 --- /dev/null +++ b/agents_api/docs/AgentListExpand.md @@ -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) + + diff --git a/agents_api/docs/AgentProxies.md b/agents_api/docs/AgentProxies.md new file mode 100644 index 00000000..f6488136 --- /dev/null +++ b/agents_api/docs/AgentProxies.md @@ -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) + + diff --git a/agents_api/docs/AgentProxy.md b/agents_api/docs/AgentProxy.md new file mode 100644 index 00000000..db8a06ad --- /dev/null +++ b/agents_api/docs/AgentProxy.md @@ -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 `static` use the format `hostname:port`. If location is `pac`, then specify the URL where the PAC file can be obtained. | [optional] +**is_local_configured** | **bool** | Set to `true` if this proxy configuration comes from the agent’s config file. Specify `false` 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'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) + + diff --git a/agents_api/docs/Agents.md b/agents_api/docs/Agents.md new file mode 100644 index 00000000..e99b91ad --- /dev/null +++ b/agents_api/docs/Agents.md @@ -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) + + diff --git a/agents_api/docs/AlertEmail.md b/agents_api/docs/AlertEmail.md new file mode 100644 index 00000000..f2415b01 --- /dev/null +++ b/agents_api/docs/AlertEmail.md @@ -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) + + diff --git a/agents_api/docs/AlertIntegrationBase.md b/agents_api/docs/AlertIntegrationBase.md new file mode 100644 index 00000000..fa1ddb06 --- /dev/null +++ b/agents_api/docs/AlertIntegrationBase.md @@ -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 `#channel` or `@user`. | [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) + + diff --git a/agents_api/docs/AlertIntegrationType.md b/agents_api/docs/AlertIntegrationType.md new file mode 100644 index 00000000..5810374d --- /dev/null +++ b/agents_api/docs/AlertIntegrationType.md @@ -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) + + diff --git a/agents_api/docs/AssignEnterpriseAgentClusterRequest.md b/agents_api/docs/AssignEnterpriseAgentClusterRequest.md new file mode 100644 index 00000000..475809e2 --- /dev/null +++ b/agents_api/docs/AssignEnterpriseAgentClusterRequest.md @@ -0,0 +1,28 @@ +# AssignEnterpriseAgentClusterRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agents** | **List[str]** | Contains list of agent IDs (get `agentId` from `/agents` 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) + + diff --git a/agents_api/docs/CloudAndEnterpriseAgentNotificationRulesApi.md b/agents_api/docs/CloudAndEnterpriseAgentNotificationRulesApi.md new file mode 100644 index 00000000..4a5187d3 --- /dev/null +++ b/agents_api/docs/CloudAndEnterpriseAgentNotificationRulesApi.md @@ -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 `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**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 `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**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) + diff --git a/agents_api/docs/CloudAndEnterpriseAgentsApi.md b/agents_api/docs/CloudAndEnterpriseAgentsApi.md new file mode 100644 index 00000000..f85b37dd --- /dev/null +++ b/agents_api/docs/CloudAndEnterpriseAgentsApi.md @@ -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 `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 `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** | [**List[AgentDetailsExpand]**](AgentDetailsExpand.md)| 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] + +### 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 agent’s 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 `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** | [**List[AgentListExpand]**](AgentListExpand.md)| 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** | [**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 `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** | [**List[AgentDetailsExpand]**](AgentDetailsExpand.md)| 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] + +### 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) + diff --git a/agents_api/docs/CloudEnterpriseAgent.md b/agents_api/docs/CloudEnterpriseAgent.md new file mode 100644 index 00000000..cb8656a0 --- /dev/null +++ b/agents_api/docs/CloudEnterpriseAgent.md @@ -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 agent’s 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'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) + + diff --git a/agents_api/docs/CloudEnterpriseAgentType.md b/agents_api/docs/CloudEnterpriseAgentType.md new file mode 100644 index 00000000..951c803e --- /dev/null +++ b/agents_api/docs/CloudEnterpriseAgentType.md @@ -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) + + diff --git a/agents_api/docs/CloudEnterpriseAgents.md b/agents_api/docs/CloudEnterpriseAgents.md new file mode 100644 index 00000000..d98f9bbd --- /dev/null +++ b/agents_api/docs/CloudEnterpriseAgents.md @@ -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) + + diff --git a/agents_api/docs/ClusterMember.md b/agents_api/docs/ClusterMember.md new file mode 100644 index 00000000..7ba0bf05 --- /dev/null +++ b/agents_api/docs/ClusterMember.md @@ -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 agent’s 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) + + diff --git a/agents_api/docs/EnterpriseAgent.md b/agents_api/docs/EnterpriseAgent.md new file mode 100644 index 00000000..78d7e874 --- /dev/null +++ b/agents_api/docs/EnterpriseAgent.md @@ -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 agent’s 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'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) + + diff --git a/agents_api/docs/EnterpriseAgentClusterApi.md b/agents_api/docs/EnterpriseAgentClusterApi.md new file mode 100644 index 00000000..45066759 --- /dev/null +++ b/agents_api/docs/EnterpriseAgentClusterApi.md @@ -0,0 +1,196 @@ +# agents_api.EnterpriseAgentClusterApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**assign_enterprise_agent_cluster**](EnterpriseAgentClusterApi.md#assign_enterprise_agent_cluster) | **POST** /v7/agents/{agentId}/cluster/assign | Add member to Enterprise Agent cluster +[**unassign_enterprise_agent_from_cluster**](EnterpriseAgentClusterApi.md#unassign_enterprise_agent_from_cluster) | **POST** /v7/agents/{agentId}/cluster/unassign | Remove member from Enterprise Agent cluster + + +# **assign_enterprise_agent_cluster** +> GetAgentDetails200Response assign_enterprise_agent_cluster(agent_id, assign_enterprise_agent_cluster_request, aid=aid, expand=expand) + +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\" ```` + +### 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.assign_enterprise_agent_cluster_request import AssignEnterpriseAgentClusterRequest +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.EnterpriseAgentClusterApi(api_client) + agent_id = '281474976710706' # str | Unique ID for the Enterprise Agent cluster to add new agents to. + assign_enterprise_agent_cluster_request = agents_api.AssignEnterpriseAgentClusterRequest() # AssignEnterpriseAgentClusterRequest | + 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: + # Add member to Enterprise Agent cluster + api_response = api_instance.assign_enterprise_agent_cluster(agent_id, assign_enterprise_agent_cluster_request, aid=aid, expand=expand) + print("The response of EnterpriseAgentClusterApi->assign_enterprise_agent_cluster:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EnterpriseAgentClusterApi->assign_enterprise_agent_cluster: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| Unique ID for the Enterprise Agent cluster to add new agents to. | + **assign_enterprise_agent_cluster_request** | [**AssignEnterpriseAgentClusterRequest**](AssignEnterpriseAgentClusterRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **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 `clusterMembers` sub-resource, pass the `?expand=cluster-member` query. | [optional] + +### Return type + +[**GetAgentDetails200Response**](GetAgentDetails200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + +# **unassign_enterprise_agent_from_cluster** +> GetAgents200Response unassign_enterprise_agent_from_cluster(agent_id, unassign_enterprise_agent_from_cluster_request, aid=aid, expand=expand) + +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 cluster’s `agentId` value. The last `memberId` listed in the POST body inherits the cluster’s `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\" ``` + +### 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_agents200_response import GetAgents200Response +from agents_api.models.unassign_enterprise_agent_from_cluster_request import UnassignEnterpriseAgentFromClusterRequest +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.EnterpriseAgentClusterApi(api_client) + agent_id = '281474976710706' # str | Unique ID for the Enterprise Agent cluster to remove agents from. + unassign_enterprise_agent_from_cluster_request = agents_api.UnassignEnterpriseAgentFromClusterRequest() # UnassignEnterpriseAgentFromClusterRequest | + 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: + # Remove member from Enterprise Agent cluster + api_response = api_instance.unassign_enterprise_agent_from_cluster(agent_id, unassign_enterprise_agent_from_cluster_request, aid=aid, expand=expand) + print("The response of EnterpriseAgentClusterApi->unassign_enterprise_agent_from_cluster:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EnterpriseAgentClusterApi->unassign_enterprise_agent_from_cluster: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| Unique ID for the Enterprise Agent cluster to remove agents from. | + **unassign_enterprise_agent_from_cluster_request** | [**UnassignEnterpriseAgentFromClusterRequest**](UnassignEnterpriseAgentFromClusterRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **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 `clusterMembers` sub-resource, pass the `?expand=cluster-member` query. | [optional] + +### Return type + +[**GetAgents200Response**](GetAgents200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/agents_api/docs/EnterpriseAgentDetail.md b/agents_api/docs/EnterpriseAgentDetail.md new file mode 100644 index 00000000..6803fd64 --- /dev/null +++ b/agents_api/docs/EnterpriseAgentDetail.md @@ -0,0 +1,54 @@ +# EnterpriseAgentDetail + + +## 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 agent’s 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'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 `/tests` 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 `/labels` for more information. | [optional] [readonly] + +## Example + +```python +from agents_api.models.enterprise_agent_detail import EnterpriseAgentDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of EnterpriseAgentDetail from a JSON string +enterprise_agent_detail_instance = EnterpriseAgentDetail.from_json(json) +# print the JSON string representation of the object +print EnterpriseAgentDetail.to_json() + +# convert the object into a dict +enterprise_agent_detail_dict = enterprise_agent_detail_instance.to_dict() +# create an instance of EnterpriseAgentDetail from a dict +enterprise_agent_detail_form_dict = enterprise_agent_detail.from_dict(enterprise_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) + + diff --git a/agents_api/docs/EnterpriseAgentIpv6Policy.md b/agents_api/docs/EnterpriseAgentIpv6Policy.md new file mode 100644 index 00000000..28e3b47f --- /dev/null +++ b/agents_api/docs/EnterpriseAgentIpv6Policy.md @@ -0,0 +1,11 @@ +# EnterpriseAgentIpv6Policy + +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) + + diff --git a/agents_api/docs/EnterpriseAgentRequestBody.md b/agents_api/docs/EnterpriseAgentRequestBody.md new file mode 100644 index 00000000..a3279b62 --- /dev/null +++ b/agents_api/docs/EnterpriseAgentRequestBody.md @@ -0,0 +1,35 @@ +# EnterpriseAgentRequestBody + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_name** | **str** | Name of the agent. | [optional] +**enabled** | **bool** | Flag indicating if the agent is enabled. | [optional] +**account_groups** | **List[str]** | Contains a list of account groups IDs. See `/accounts-groups` for a list of account IDs | [optional] +**ipv6_policy** | [**AgentIpv6Policy**](AgentIpv6Policy.md) | | [optional] +**keep_browser_cache** | **bool** | Flag indicating if the agent retains cache. | [optional] +**target_for_tests** | **str** | Test target IP address. | [optional] +**local_resolution_prefixes** | **List[str]** | 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). | [optional] +**tests** | **List[str]** | Contains list of test IDs. See `/tests` to pull a list of available tests. | [optional] + +## Example + +```python +from agents_api.models.enterprise_agent_request_body import EnterpriseAgentRequestBody + +# TODO update the JSON string below +json = "{}" +# create an instance of EnterpriseAgentRequestBody from a JSON string +enterprise_agent_request_body_instance = EnterpriseAgentRequestBody.from_json(json) +# print the JSON string representation of the object +print EnterpriseAgentRequestBody.to_json() + +# convert the object into a dict +enterprise_agent_request_body_dict = enterprise_agent_request_body_instance.to_dict() +# create an instance of EnterpriseAgentRequestBody from a dict +enterprise_agent_request_body_form_dict = enterprise_agent_request_body.from_dict(enterprise_agent_request_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/EnterpriseAgentState.md b/agents_api/docs/EnterpriseAgentState.md new file mode 100644 index 00000000..a9ec4b61 --- /dev/null +++ b/agents_api/docs/EnterpriseAgentState.md @@ -0,0 +1,11 @@ +# EnterpriseAgentState + +State of the agent. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/Error.md b/agents_api/docs/Error.md new file mode 100644 index 00000000..41bf6718 --- /dev/null +++ b/agents_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from agents_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/ErrorDetail.md b/agents_api/docs/ErrorDetail.md new file mode 100644 index 00000000..f192ab56 --- /dev/null +++ b/agents_api/docs/ErrorDetail.md @@ -0,0 +1,29 @@ +# ErrorDetail + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | [**ErrorDetailCode**](ErrorDetailCode.md) | | [optional] +**description** | **str** | Description for the agent error. | [optional] [readonly] + +## Example + +```python +from agents_api.models.error_detail import ErrorDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorDetail from a JSON string +error_detail_instance = ErrorDetail.from_json(json) +# print the JSON string representation of the object +print ErrorDetail.to_json() + +# convert the object into a dict +error_detail_dict = error_detail_instance.to_dict() +# create an instance of ErrorDetail from a dict +error_detail_form_dict = error_detail.from_dict(error_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/ErrorDetailCode.md b/agents_api/docs/ErrorDetailCode.md new file mode 100644 index 00000000..c91277dc --- /dev/null +++ b/agents_api/docs/ErrorDetailCode.md @@ -0,0 +1,11 @@ +# ErrorDetailCode + +Code for the agent error. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/GetAgentDetails200Response.md b/agents_api/docs/GetAgentDetails200Response.md new file mode 100644 index 00000000..b797da82 --- /dev/null +++ b/agents_api/docs/GetAgentDetails200Response.md @@ -0,0 +1,55 @@ +# GetAgentDetails200Response + + +## 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 agent’s 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'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 `/tests` 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 `/labels` for more information. | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.get_agent_details200_response import GetAgentDetails200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAgentDetails200Response from a JSON string +get_agent_details200_response_instance = GetAgentDetails200Response.from_json(json) +# print the JSON string representation of the object +print GetAgentDetails200Response.to_json() + +# convert the object into a dict +get_agent_details200_response_dict = get_agent_details200_response_instance.to_dict() +# create an instance of GetAgentDetails200Response from a dict +get_agent_details200_response_form_dict = get_agent_details200_response.from_dict(get_agent_details200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/GetAgentProxies200Response.md b/agents_api/docs/GetAgentProxies200Response.md new file mode 100644 index 00000000..cb4cfe71 --- /dev/null +++ b/agents_api/docs/GetAgentProxies200Response.md @@ -0,0 +1,29 @@ +# GetAgentProxies200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_proxies** | [**List[AgentProxy]**](AgentProxy.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.get_agent_proxies200_response import GetAgentProxies200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAgentProxies200Response from a JSON string +get_agent_proxies200_response_instance = GetAgentProxies200Response.from_json(json) +# print the JSON string representation of the object +print GetAgentProxies200Response.to_json() + +# convert the object into a dict +get_agent_proxies200_response_dict = get_agent_proxies200_response_instance.to_dict() +# create an instance of GetAgentProxies200Response from a dict +get_agent_proxies200_response_form_dict = get_agent_proxies200_response.from_dict(get_agent_proxies200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/GetAgents200Response.md b/agents_api/docs/GetAgents200Response.md new file mode 100644 index 00000000..26baa6ff --- /dev/null +++ b/agents_api/docs/GetAgents200Response.md @@ -0,0 +1,29 @@ +# GetAgents200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agents** | [**List[CloudEnterpriseAgent]**](CloudEnterpriseAgent.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.get_agents200_response import GetAgents200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAgents200Response from a JSON string +get_agents200_response_instance = GetAgents200Response.from_json(json) +# print the JSON string representation of the object +print GetAgents200Response.to_json() + +# convert the object into a dict +get_agents200_response_dict = get_agents200_response_instance.to_dict() +# create an instance of GetAgents200Response from a dict +get_agents200_response_form_dict = get_agents200_response.from_dict(get_agents200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/GetAgentsNotificationRule200Response.md b/agents_api/docs/GetAgentsNotificationRule200Response.md new file mode 100644 index 00000000..ebb1dfe3 --- /dev/null +++ b/agents_api/docs/GetAgentsNotificationRule200Response.md @@ -0,0 +1,35 @@ +# GetAgentsNotificationRule200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rule_id** | **str** | Agent notification rule ID | [optional] [readonly] +**rule_name** | **str** | Name of the agent notification rule | [optional] +**expression** | **str** | Expression of agent notification rule | [optional] +**notify_on_clear** | **bool** | Send notification when notification clears | [optional] +**is_default** | **bool** | Agent notification rule will be automatically included on all new Enterprise Agents. | [optional] +**agents** | [**List[Agent]**](Agent.md) | | [optional] +**notifications** | [**Notification**](Notification.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.get_agents_notification_rule200_response import GetAgentsNotificationRule200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAgentsNotificationRule200Response from a JSON string +get_agents_notification_rule200_response_instance = GetAgentsNotificationRule200Response.from_json(json) +# print the JSON string representation of the object +print GetAgentsNotificationRule200Response.to_json() + +# convert the object into a dict +get_agents_notification_rule200_response_dict = get_agents_notification_rule200_response_instance.to_dict() +# create an instance of GetAgentsNotificationRule200Response from a dict +get_agents_notification_rule200_response_form_dict = get_agents_notification_rule200_response.from_dict(get_agents_notification_rule200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/GetAgentsNotificationRules200Response.md b/agents_api/docs/GetAgentsNotificationRules200Response.md new file mode 100644 index 00000000..332353eb --- /dev/null +++ b/agents_api/docs/GetAgentsNotificationRules200Response.md @@ -0,0 +1,29 @@ +# GetAgentsNotificationRules200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_alert_rules** | [**List[NotificationRule]**](NotificationRule.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.get_agents_notification_rules200_response import GetAgentsNotificationRules200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAgentsNotificationRules200Response from a JSON string +get_agents_notification_rules200_response_instance = GetAgentsNotificationRules200Response.from_json(json) +# print the JSON string representation of the object +print GetAgentsNotificationRules200Response.to_json() + +# convert the object into a dict +get_agents_notification_rules200_response_dict = get_agents_notification_rules200_response_instance.to_dict() +# create an instance of GetAgentsNotificationRules200Response from a dict +get_agents_notification_rules200_response_form_dict = get_agents_notification_rules200_response.from_dict(get_agents_notification_rules200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/InterfaceIpMapping.md b/agents_api/docs/InterfaceIpMapping.md new file mode 100644 index 00000000..273ac93d --- /dev/null +++ b/agents_api/docs/InterfaceIpMapping.md @@ -0,0 +1,29 @@ +# InterfaceIpMapping + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interface_name** | **str** | Name of the mapping | [optional] [readonly] +**ip_addresses** | **List[str]** | Array of ipAddress entries | [optional] [readonly] + +## Example + +```python +from agents_api.models.interface_ip_mapping import InterfaceIpMapping + +# TODO update the JSON string below +json = "{}" +# create an instance of InterfaceIpMapping from a JSON string +interface_ip_mapping_instance = InterfaceIpMapping.from_json(json) +# print the JSON string representation of the object +print InterfaceIpMapping.to_json() + +# convert the object into a dict +interface_ip_mapping_dict = interface_ip_mapping_instance.to_dict() +# create an instance of InterfaceIpMapping from a dict +interface_ip_mapping_form_dict = interface_ip_mapping.from_dict(interface_ip_mapping_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/Labels.md b/agents_api/docs/Labels.md new file mode 100644 index 00000000..3245a08c --- /dev/null +++ b/agents_api/docs/Labels.md @@ -0,0 +1,29 @@ +# Labels + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label_id** | **str** | Label Id. | [optional] +**name** | **str** | Name of the label. | [optional] + +## Example + +```python +from agents_api.models.labels import Labels + +# TODO update the JSON string below +json = "{}" +# create an instance of Labels from a JSON string +labels_instance = Labels.from_json(json) +# print the JSON string representation of the object +print Labels.to_json() + +# convert the object into a dict +labels_dict = labels_instance.to_dict() +# create an instance of Labels from a dict +labels_form_dict = labels.from_dict(labels_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/Link.md b/agents_api/docs/Link.md new file mode 100644 index 00000000..b158dd4c --- /dev/null +++ b/agents_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from agents_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/Notification.md b/agents_api/docs/Notification.md new file mode 100644 index 00000000..0d0fcfee --- /dev/null +++ b/agents_api/docs/Notification.md @@ -0,0 +1,31 @@ +# Notification + +Alert notification object. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | [**AlertEmail**](AlertEmail.md) | | [optional] +**third_party** | [**List[AlertIntegrationBase]**](AlertIntegrationBase.md) | | [optional] +**webhook** | [**List[AlertIntegrationBase]**](AlertIntegrationBase.md) | | [optional] + +## Example + +```python +from agents_api.models.notification import Notification + +# TODO update the JSON string below +json = "{}" +# create an instance of Notification from a JSON string +notification_instance = Notification.from_json(json) +# print the JSON string representation of the object +print Notification.to_json() + +# convert the object into a dict +notification_dict = notification_instance.to_dict() +# create an instance of Notification from a dict +notification_form_dict = notification.from_dict(notification_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/NotificationRule.md b/agents_api/docs/NotificationRule.md new file mode 100644 index 00000000..0eff471b --- /dev/null +++ b/agents_api/docs/NotificationRule.md @@ -0,0 +1,32 @@ +# NotificationRule + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rule_id** | **str** | Agent notification rule ID | [optional] [readonly] +**rule_name** | **str** | Name of the agent notification rule | [optional] +**expression** | **str** | Expression of agent notification rule | [optional] +**notify_on_clear** | **bool** | Send notification when notification clears | [optional] +**is_default** | **bool** | Agent notification rule will be automatically included on all new Enterprise Agents. | [optional] + +## Example + +```python +from agents_api.models.notification_rule import NotificationRule + +# TODO update the JSON string below +json = "{}" +# create an instance of NotificationRule from a JSON string +notification_rule_instance = NotificationRule.from_json(json) +# print the JSON string representation of the object +print NotificationRule.to_json() + +# convert the object into a dict +notification_rule_dict = notification_rule_instance.to_dict() +# create an instance of NotificationRule from a dict +notification_rule_form_dict = notification_rule.from_dict(notification_rule_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/NotificationRuleDetail.md b/agents_api/docs/NotificationRuleDetail.md new file mode 100644 index 00000000..f1b124ed --- /dev/null +++ b/agents_api/docs/NotificationRuleDetail.md @@ -0,0 +1,34 @@ +# NotificationRuleDetail + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rule_id** | **str** | Agent notification rule ID | [optional] [readonly] +**rule_name** | **str** | Name of the agent notification rule | [optional] +**expression** | **str** | Expression of agent notification rule | [optional] +**notify_on_clear** | **bool** | Send notification when notification clears | [optional] +**is_default** | **bool** | Agent notification rule will be automatically included on all new Enterprise Agents. | [optional] +**agents** | [**List[Agent]**](Agent.md) | | [optional] +**notifications** | [**Notification**](Notification.md) | | [optional] + +## Example + +```python +from agents_api.models.notification_rule_detail import NotificationRuleDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of NotificationRuleDetail from a JSON string +notification_rule_detail_instance = NotificationRuleDetail.from_json(json) +# print the JSON string representation of the object +print NotificationRuleDetail.to_json() + +# convert the object into a dict +notification_rule_detail_dict = notification_rule_detail_instance.to_dict() +# create an instance of NotificationRuleDetail from a dict +notification_rule_detail_form_dict = notification_rule_detail.from_dict(notification_rule_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/NotificationRules.md b/agents_api/docs/NotificationRules.md new file mode 100644 index 00000000..e2f45c85 --- /dev/null +++ b/agents_api/docs/NotificationRules.md @@ -0,0 +1,28 @@ +# NotificationRules + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_alert_rules** | [**List[NotificationRule]**](NotificationRule.md) | | [optional] + +## Example + +```python +from agents_api.models.notification_rules import NotificationRules + +# TODO update the JSON string below +json = "{}" +# create an instance of NotificationRules from a JSON string +notification_rules_instance = NotificationRules.from_json(json) +# print the JSON string representation of the object +print NotificationRules.to_json() + +# convert the object into a dict +notification_rules_dict = notification_rules_instance.to_dict() +# create an instance of NotificationRules from a dict +notification_rules_form_dict = notification_rules.from_dict(notification_rules_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/Notifications.md b/agents_api/docs/Notifications.md new file mode 100644 index 00000000..c830fc16 --- /dev/null +++ b/agents_api/docs/Notifications.md @@ -0,0 +1,28 @@ +# Notifications + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**notifications** | [**Notification**](Notification.md) | | [optional] + +## Example + +```python +from agents_api.models.notifications import Notifications + +# TODO update the JSON string below +json = "{}" +# create an instance of Notifications from a JSON string +notifications_instance = Notifications.from_json(json) +# print the JSON string representation of the object +print Notifications.to_json() + +# convert the object into a dict +notifications_dict = notifications_instance.to_dict() +# create an instance of Notifications from a dict +notifications_form_dict = notifications.from_dict(notifications_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/ProxiesApi.md b/agents_api/docs/ProxiesApi.md new file mode 100644 index 00000000..c03e93c2 --- /dev/null +++ b/agents_api/docs/ProxiesApi.md @@ -0,0 +1,93 @@ +# agents_api.ProxiesApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_agent_proxies**](ProxiesApi.md#get_agent_proxies) | **GET** /v7/agents/proxies | List agent proxies + + +# **get_agent_proxies** +> GetAgentProxies200Response get_agent_proxies(aid=aid) + +List agent proxies + +List all agent proxies available under the account group. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import agents_api +from agents_api.models.get_agent_proxies200_response import GetAgentProxies200Response +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.ProxiesApi(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 proxies + api_response = api_instance.get_agent_proxies(aid=aid) + print("The response of ProxiesApi->get_agent_proxies:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProxiesApi->get_agent_proxies: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetAgentProxies200Response**](GetAgentProxies200Response.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) + diff --git a/agents_api/docs/ProxyAuthType.md b/agents_api/docs/ProxyAuthType.md new file mode 100644 index 00000000..5ba17ab5 --- /dev/null +++ b/agents_api/docs/ProxyAuthType.md @@ -0,0 +1,11 @@ +# ProxyAuthType + +The type of authentication the proxy requires + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/ProxyType.md b/agents_api/docs/ProxyType.md new file mode 100644 index 00000000..8dbe6c7c --- /dev/null +++ b/agents_api/docs/ProxyType.md @@ -0,0 +1,11 @@ +# ProxyType + +The type of proxy, STATIC or PAC. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/SelfLinks.md b/agents_api/docs/SelfLinks.md new file mode 100644 index 00000000..152ab3c6 --- /dev/null +++ b/agents_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/SelfLinksLinks.md b/agents_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..e01ac6f9 --- /dev/null +++ b/agents_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from agents_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/SimpleTest.md b/agents_api/docs/SimpleTest.md new file mode 100644 index 00000000..a7ec3f3d --- /dev/null +++ b/agents_api/docs/SimpleTest.md @@ -0,0 +1,42 @@ +# SimpleTest + +Each test includes additional fields depending on its `type`. Refer `/tests/{type}` endpoint to know the set of fields returned by a given `type`. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | [**TestType**](TestType.md) | | [optional] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.simple_test import SimpleTest + +# TODO update the JSON string below +json = "{}" +# create an instance of SimpleTest from a JSON string +simple_test_instance = SimpleTest.from_json(json) +# print the JSON string representation of the object +print SimpleTest.to_json() + +# convert the object into a dict +simple_test_dict = simple_test_instance.to_dict() +# create an instance of SimpleTest from a dict +simple_test_form_dict = simple_test.from_dict(simple_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/TestInterval.md b/agents_api/docs/TestInterval.md new file mode 100644 index 00000000..e0e57d69 --- /dev/null +++ b/agents_api/docs/TestInterval.md @@ -0,0 +1,11 @@ +# TestInterval + +Interval between test runs in seconds. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/TestType.md b/agents_api/docs/TestType.md new file mode 100644 index 00000000..ae5d924e --- /dev/null +++ b/agents_api/docs/TestType.md @@ -0,0 +1,11 @@ +# TestType + +This is a read only value, as test type is implicit in the test creation url. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/UnassignEnterpriseAgentFromClusterRequest.md b/agents_api/docs/UnassignEnterpriseAgentFromClusterRequest.md new file mode 100644 index 00000000..aefde9f6 --- /dev/null +++ b/agents_api/docs/UnassignEnterpriseAgentFromClusterRequest.md @@ -0,0 +1,28 @@ +# UnassignEnterpriseAgentFromClusterRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**members** | **List[str]** | Contains list of member IDs. (get `memberId` from `/agents/{agentId}` endpoint) | [optional] + +## Example + +```python +from agents_api.models.unassign_enterprise_agent_from_cluster_request import UnassignEnterpriseAgentFromClusterRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UnassignEnterpriseAgentFromClusterRequest from a JSON string +unassign_enterprise_agent_from_cluster_request_instance = UnassignEnterpriseAgentFromClusterRequest.from_json(json) +# print the JSON string representation of the object +print UnassignEnterpriseAgentFromClusterRequest.to_json() + +# convert the object into a dict +unassign_enterprise_agent_from_cluster_request_dict = unassign_enterprise_agent_from_cluster_request_instance.to_dict() +# create an instance of UnassignEnterpriseAgentFromClusterRequest from a dict +unassign_enterprise_agent_from_cluster_request_form_dict = unassign_enterprise_agent_from_cluster_request.from_dict(unassign_enterprise_agent_from_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) + + diff --git a/agents_api/docs/UnauthorizedError.md b/agents_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..8f5ab602 --- /dev/null +++ b/agents_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from agents_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/UnexpandedInstantTest.md b/agents_api/docs/UnexpandedInstantTest.md new file mode 100644 index 00000000..42a9246d --- /dev/null +++ b/agents_api/docs/UnexpandedInstantTest.md @@ -0,0 +1,38 @@ +# UnexpandedInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | [**TestType**](TestType.md) | | [optional] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.unexpanded_instant_test import UnexpandedInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTest from a JSON string +unexpanded_instant_test_instance = UnexpandedInstantTest.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTest.to_json() + +# convert the object into a dict +unexpanded_instant_test_dict = unexpanded_instant_test_instance.to_dict() +# create an instance of UnexpandedInstantTest from a dict +unexpanded_instant_test_form_dict = unexpanded_instant_test.from_dict(unexpanded_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/UnexpandedInstantTestLinks.md b/agents_api/docs/UnexpandedInstantTestLinks.md new file mode 100644 index 00000000..28511644 --- /dev/null +++ b/agents_api/docs/UnexpandedInstantTestLinks.md @@ -0,0 +1,30 @@ +# UnexpandedInstantTestLinks + +A list of links that can be accessed to get more information + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**UnexpandedInstantTestLinksSelf**](UnexpandedInstantTestLinksSelf.md) | | [optional] +**test_results** | [**UnexpandedInstantTestLinksTestResults**](UnexpandedInstantTestLinksTestResults.md) | | [optional] + +## Example + +```python +from agents_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinks from a JSON string +unexpanded_instant_test_links_instance = UnexpandedInstantTestLinks.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinks.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_dict = unexpanded_instant_test_links_instance.to_dict() +# create an instance of UnexpandedInstantTestLinks from a dict +unexpanded_instant_test_links_form_dict = unexpanded_instant_test_links.from_dict(unexpanded_instant_test_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/UnexpandedInstantTestLinksSelf.md b/agents_api/docs/UnexpandedInstantTestLinksSelf.md new file mode 100644 index 00000000..0b89e058 --- /dev/null +++ b/agents_api/docs/UnexpandedInstantTestLinksSelf.md @@ -0,0 +1,35 @@ +# UnexpandedInstantTestLinksSelf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from agents_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinksSelf from a JSON string +unexpanded_instant_test_links_self_instance = UnexpandedInstantTestLinksSelf.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinksSelf.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_self_dict = unexpanded_instant_test_links_self_instance.to_dict() +# create an instance of UnexpandedInstantTestLinksSelf from a dict +unexpanded_instant_test_links_self_form_dict = unexpanded_instant_test_links_self.from_dict(unexpanded_instant_test_links_self_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/UnexpandedInstantTestLinksTestResults.md b/agents_api/docs/UnexpandedInstantTestLinksTestResults.md new file mode 100644 index 00000000..2d5267b8 --- /dev/null +++ b/agents_api/docs/UnexpandedInstantTestLinksTestResults.md @@ -0,0 +1,35 @@ +# UnexpandedInstantTestLinksTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from agents_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinksTestResults from a JSON string +unexpanded_instant_test_links_test_results_instance = UnexpandedInstantTestLinksTestResults.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinksTestResults.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_test_results_dict = unexpanded_instant_test_links_test_results_instance.to_dict() +# create an instance of UnexpandedInstantTestLinksTestResults from a dict +unexpanded_instant_test_links_test_results_form_dict = unexpanded_instant_test_links_test_results.from_dict(unexpanded_instant_test_links_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/UnexpandedTest.md b/agents_api/docs/UnexpandedTest.md new file mode 100644 index 00000000..e2c7bbef --- /dev/null +++ b/agents_api/docs/UnexpandedTest.md @@ -0,0 +1,30 @@ +# UnexpandedTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] + +## Example + +```python +from agents_api.models.unexpanded_test import UnexpandedTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedTest from a JSON string +unexpanded_test_instance = UnexpandedTest.from_json(json) +# print the JSON string representation of the object +print UnexpandedTest.to_json() + +# convert the object into a dict +unexpanded_test_dict = unexpanded_test_instance.to_dict() +# create an instance of UnexpandedTest from a dict +unexpanded_test_form_dict = unexpanded_test.from_dict(unexpanded_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/docs/UpdateEnterpriseAgentDetails200Response.md b/agents_api/docs/UpdateEnterpriseAgentDetails200Response.md new file mode 100644 index 00000000..1c6a0bf0 --- /dev/null +++ b/agents_api/docs/UpdateEnterpriseAgentDetails200Response.md @@ -0,0 +1,55 @@ +# UpdateEnterpriseAgentDetails200Response + + +## 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 agent’s 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'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 `/tests` 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 `/labels` for more information. | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.update_enterprise_agent_details200_response import UpdateEnterpriseAgentDetails200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateEnterpriseAgentDetails200Response from a JSON string +update_enterprise_agent_details200_response_instance = UpdateEnterpriseAgentDetails200Response.from_json(json) +# print the JSON string representation of the object +print UpdateEnterpriseAgentDetails200Response.to_json() + +# convert the object into a dict +update_enterprise_agent_details200_response_dict = update_enterprise_agent_details200_response_instance.to_dict() +# create an instance of UpdateEnterpriseAgentDetails200Response from a dict +update_enterprise_agent_details200_response_form_dict = update_enterprise_agent_details200_response.from_dict(update_enterprise_agent_details200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/agents_api/git_push.sh b/agents_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/agents_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/agents_api/pyproject.toml b/agents_api/pyproject.toml new file mode 100644 index 00000000..2d11580a --- /dev/null +++ b/agents_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "agents_api" +version = "1.0.0" +description = "Agents API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Agents API"] +include = ["agents_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/agents_api/requirements.txt b/agents_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/agents_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/agents_api/setup.cfg b/agents_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/agents_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/agents_api/setup.py b/agents_api/setup.py new file mode 100644 index 00000000..286bb6cb --- /dev/null +++ b/agents_api/setup.py @@ -0,0 +1,49 @@ +# 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "agents-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Agents API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Agents API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + ## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents. + """, # noqa: E501 + package_data={"agents_api": ["py.typed"]}, +) diff --git a/agents_api/test-requirements.txt b/agents_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/agents_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/agents_api/test/__init__.py b/agents_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/agents_api/test/test_account_group.py b/agents_api/test/test_account_group.py new file mode 100644 index 00000000..42fd167a --- /dev/null +++ b/agents_api/test/test_account_group.py @@ -0,0 +1,53 @@ +# 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 unittest +import datetime + +from agents_api.models.account_group import AccountGroup + +class TestAccountGroup(unittest.TestCase): + """AccountGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroup: + """Test AccountGroup + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroup` + """ + model = AccountGroup() + if include_optional: + return AccountGroup( + aid = '11', + account_group_name = 'Account A' + ) + else: + return AccountGroup( + ) + """ + + def testAccountGroup(self): + """Test AccountGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_account_group_id.py b/agents_api/test/test_account_group_id.py new file mode 100644 index 00000000..dc3dde3b --- /dev/null +++ b/agents_api/test/test_account_group_id.py @@ -0,0 +1,52 @@ +# 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 unittest +import datetime + +from agents_api.models.account_group_id import AccountGroupId + +class TestAccountGroupId(unittest.TestCase): + """AccountGroupId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroupId: + """Test AccountGroupId + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroupId` + """ + model = AccountGroupId() + if include_optional: + return AccountGroupId( + aid = '11' + ) + else: + return AccountGroupId( + ) + """ + + def testAccountGroupId(self): + """Test AccountGroupId""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_agent.py b/agents_api/test/test_agent.py new file mode 100644 index 00000000..6c88aa70 --- /dev/null +++ b/agents_api/test/test_agent.py @@ -0,0 +1,61 @@ +# 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 unittest +import datetime + +from agents_api.models.agent import Agent + +class TestAgent(unittest.TestCase): + """Agent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Agent: + """Test Agent + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Agent` + """ + model = Agent() + if include_optional: + return Agent( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + agent_type = 'enterprise-cluster', + location = 'San Francisco Bay Area', + country_id = 'US', + enabled = True, + verify_ssl_certificates = True + ) + else: + return Agent( + ) + """ + + def testAgent(self): + """Test Agent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_agent_base.py b/agents_api/test/test_agent_base.py new file mode 100644 index 00000000..fd27a843 --- /dev/null +++ b/agents_api/test/test_agent_base.py @@ -0,0 +1,54 @@ +# 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 unittest +import datetime + +from agents_api.models.agent_base import AgentBase + +class TestAgentBase(unittest.TestCase): + """AgentBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentBase: + """Test AgentBase + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentBase` + """ + model = AgentBase() + if include_optional: + return AgentBase( + ip_addresses = ["99.139.65.220","99.139.65.221"], + public_ip_addresses = ["192.168.1.78","192.168.1.79"], + network = 'AT&T Services, Inc. (AS 7018)' + ) + else: + return AgentBase( + ) + """ + + def testAgentBase(self): + """Test AgentBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_agent_detail.py b/agents_api/test/test_agent_detail.py new file mode 100644 index 00000000..f7e272ba --- /dev/null +++ b/agents_api/test/test_agent_detail.py @@ -0,0 +1,69 @@ +# 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 unittest +import datetime + +from agents_api.models.agent_detail import AgentDetail + +class TestAgentDetail(unittest.TestCase): + """AgentDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentDetail: + """Test AgentDetail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentDetail` + """ + model = AgentDetail() + if include_optional: + return AgentDetail( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + agent_type = 'enterprise-cluster', + location = 'San Francisco Bay Area', + country_id = 'US', + enabled = True, + verify_ssl_certificates = True, + tests = [ + null + ], + labels = [ + agents_api.models.labels.Labels( + label_id = '11', + name = 'Label name', ) + ] + ) + else: + return AgentDetail( + ) + """ + + def testAgentDetail(self): + """Test AgentDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_agent_details.py b/agents_api/test/test_agent_details.py new file mode 100644 index 00000000..b4164023 --- /dev/null +++ b/agents_api/test/test_agent_details.py @@ -0,0 +1,101 @@ +# 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 unittest +import datetime + +from agents_api.models.agent_details import AgentDetails + +class TestAgentDetails(unittest.TestCase): + """AgentDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentDetails: + """Test AgentDetails + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentDetails` + """ + model = AgentDetails() + if include_optional: + return AgentDetails( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + agent_type = 'enterprise-cluster', + location = 'San Francisco Bay Area', + country_id = 'US', + enabled = True, + verify_ssl_certificates = True, + cluster_members = [ + null + ], + utilization = 25, + account_groups = [ + agents_api.models.account_group.AccountGroup() + ], + prefix = '99.128.0.0/11', + ipv6_policy = 'force-ipv4', + error_details = [ + agents_api.models.error_detail.ErrorDetail( + code = 'agent-version-outdated', + description = 'Agent Version 0.1.1 (latest: 1.0.0)', ) + ], + hostname = 'thousandeyes.com', + last_seen = '2022-07-17T22:00:54Z', + agent_state = 'online', + keep_browser_cache = True, + created_date = '2022-07-17T22:00:54Z', + target_for_tests = '1.1.1.1', + local_resolution_prefixes = [ + '10.2.3.3/24' + ], + interface_ip_mappings = [ + agents_api.models.interface_ip_mapping.InterfaceIpMapping( + interface_name = 'wlp4s0', + ip_addresses = ["73.252.207.219","2601:646:300:3ae0::b977"], ) + ], + tests = [ + null + ], + notification_rules = [ + agents_api.models.notification_rules.NotificationRules( + agent_alert_rules = [{"ruleId":"281474976710706","ruleName":"Default Agent Offline Notification","expression":"((lastContact >= 30 min))","notifyOnClear":true,"isDefault":false},{"ruleId":"281474976710709","ruleName":"Test Rule","expression":"((lastContact >= 40 min))","notifyOnClear":true,"isDefault":true}], ) + ], + labels = [ + agents_api.models.labels.Labels( + label_id = '11', + name = 'Label name', ) + ] + ) + else: + return AgentDetails( + ) + """ + + def testAgentDetails(self): + """Test AgentDetails""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_agent_details_expand.py b/agents_api/test/test_agent_details_expand.py new file mode 100644 index 00000000..420849bf --- /dev/null +++ b/agents_api/test/test_agent_details_expand.py @@ -0,0 +1,34 @@ +# 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 unittest +import datetime + +from agents_api.models.agent_details_expand import AgentDetailsExpand + +class TestAgentDetailsExpand(unittest.TestCase): + """AgentDetailsExpand unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAgentDetailsExpand(self): + """Test AgentDetailsExpand""" + # inst = AgentDetailsExpand() + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_agent_ipv6_policy.py b/agents_api/test/test_agent_ipv6_policy.py new file mode 100644 index 00000000..19ab392c --- /dev/null +++ b/agents_api/test/test_agent_ipv6_policy.py @@ -0,0 +1,34 @@ +# 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 unittest +import datetime + +from agents_api.models.agent_ipv6_policy import AgentIpv6Policy + +class TestAgentIpv6Policy(unittest.TestCase): + """AgentIpv6Policy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAgentIpv6Policy(self): + """Test AgentIpv6Policy""" + # inst = AgentIpv6Policy() + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_agent_list_expand.py b/agents_api/test/test_agent_list_expand.py new file mode 100644 index 00000000..0fa4f5d9 --- /dev/null +++ b/agents_api/test/test_agent_list_expand.py @@ -0,0 +1,34 @@ +# 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 unittest +import datetime + +from agents_api.models.agent_list_expand import AgentListExpand + +class TestAgentListExpand(unittest.TestCase): + """AgentListExpand unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAgentListExpand(self): + """Test AgentListExpand""" + # inst = AgentListExpand() + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_agent_proxies.py b/agents_api/test/test_agent_proxies.py new file mode 100644 index 00000000..90aafb78 --- /dev/null +++ b/agents_api/test/test_agent_proxies.py @@ -0,0 +1,65 @@ +# 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 unittest +import datetime + +from agents_api.models.agent_proxies import AgentProxies + +class TestAgentProxies(unittest.TestCase): + """AgentProxies unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentProxies: + """Test AgentProxies + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentProxies` + """ + model = AgentProxies() + if include_optional: + return AgentProxies( + agent_proxies = [ + agents_api.models.agent_proxy.AgentProxy( + aid = '105', + auth_type = 'basic', + bypass_list = ["10.0.0.0/16","*.thousandeyes.com"], + last_modified = '2022-07-17T22:00:54Z', + location = 'proxy.thousandeyes.com:3128', + is_local_configured = True, + name = 'Test Proxy - Auth Type - BASIC', + password = '****', + proxy_id = '281474976710706', + type = 'static', + user = 'user1', ) + ] + ) + else: + return AgentProxies( + ) + """ + + def testAgentProxies(self): + """Test AgentProxies""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_agent_proxy.py b/agents_api/test/test_agent_proxy.py new file mode 100644 index 00000000..b988f189 --- /dev/null +++ b/agents_api/test/test_agent_proxy.py @@ -0,0 +1,62 @@ +# 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 unittest +import datetime + +from agents_api.models.agent_proxy import AgentProxy + +class TestAgentProxy(unittest.TestCase): + """AgentProxy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentProxy: + """Test AgentProxy + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentProxy` + """ + model = AgentProxy() + if include_optional: + return AgentProxy( + aid = '105', + auth_type = 'basic', + bypass_list = ["10.0.0.0/16","*.thousandeyes.com"], + last_modified = '2022-07-17T22:00:54Z', + location = 'proxy.thousandeyes.com:3128', + is_local_configured = True, + name = 'Test Proxy - Auth Type - BASIC', + password = '****', + proxy_id = '281474976710706', + type = 'static', + user = 'user1' + ) + else: + return AgentProxy( + ) + """ + + def testAgentProxy(self): + """Test AgentProxy""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_agents.py b/agents_api/test/test_agents.py new file mode 100644 index 00000000..3ef0db14 --- /dev/null +++ b/agents_api/test/test_agents.py @@ -0,0 +1,54 @@ +# 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 unittest +import datetime + +from agents_api.models.agents import Agents + +class TestAgents(unittest.TestCase): + """Agents unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Agents: + """Test Agents + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Agents` + """ + model = Agents() + if include_optional: + return Agents( + agents = [ + agents_api.models.agent.Agent() + ] + ) + else: + return Agents( + ) + """ + + def testAgents(self): + """Test Agents""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_alert_email.py b/agents_api/test/test_alert_email.py new file mode 100644 index 00000000..ac5502ee --- /dev/null +++ b/agents_api/test/test_alert_email.py @@ -0,0 +1,53 @@ +# 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 unittest +import datetime + +from agents_api.models.alert_email import AlertEmail + +class TestAlertEmail(unittest.TestCase): + """AlertEmail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertEmail: + """Test AlertEmail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertEmail` + """ + model = AlertEmail() + if include_optional: + return AlertEmail( + message = 'This test is failing, check as soon as possible.', + recipients = ["user1@thousandeyes.com","user2@cisco.com"] + ) + else: + return AlertEmail( + ) + """ + + def testAlertEmail(self): + """Test AlertEmail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_alert_integration_base.py b/agents_api/test/test_alert_integration_base.py new file mode 100644 index 00000000..add5580a --- /dev/null +++ b/agents_api/test/test_alert_integration_base.py @@ -0,0 +1,59 @@ +# 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 unittest +import datetime + +from agents_api.models.alert_integration_base import AlertIntegrationBase + +class TestAlertIntegrationBase(unittest.TestCase): + """AlertIntegrationBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertIntegrationBase: + """Test AlertIntegrationBase + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertIntegrationBase` + """ + model = AlertIntegrationBase() + if include_optional: + return AlertIntegrationBase( + integration_id = 'wb-78', + integration_name = 'integrationSlack1', + integration_type = 'slack', + target = 'https://hooks.slack.com/services/asd/0VqDYEpidpHVAK397x8PBsmZ', + auth_method = 'Basic', + auth_user = 'user123', + auth_token = '0VqDYEpidpHVAK397x8PBsmZ', + channel = '#slackChannel' + ) + else: + return AlertIntegrationBase( + ) + """ + + def testAlertIntegrationBase(self): + """Test AlertIntegrationBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_alert_integration_type.py b/agents_api/test/test_alert_integration_type.py new file mode 100644 index 00000000..f3ee4fc8 --- /dev/null +++ b/agents_api/test/test_alert_integration_type.py @@ -0,0 +1,34 @@ +# 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 unittest +import datetime + +from agents_api.models.alert_integration_type import AlertIntegrationType + +class TestAlertIntegrationType(unittest.TestCase): + """AlertIntegrationType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAlertIntegrationType(self): + """Test AlertIntegrationType""" + # inst = AlertIntegrationType() + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_assign_enterprise_agent_cluster_request.py b/agents_api/test/test_assign_enterprise_agent_cluster_request.py new file mode 100644 index 00000000..d1d258e7 --- /dev/null +++ b/agents_api/test/test_assign_enterprise_agent_cluster_request.py @@ -0,0 +1,54 @@ +# 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 unittest +import datetime + +from agents_api.models.assign_enterprise_agent_cluster_request import AssignEnterpriseAgentClusterRequest + +class TestAssignEnterpriseAgentClusterRequest(unittest.TestCase): + """AssignEnterpriseAgentClusterRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AssignEnterpriseAgentClusterRequest: + """Test AssignEnterpriseAgentClusterRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AssignEnterpriseAgentClusterRequest` + """ + model = AssignEnterpriseAgentClusterRequest() + if include_optional: + return AssignEnterpriseAgentClusterRequest( + agents = [ + '281474976710706' + ] + ) + else: + return AssignEnterpriseAgentClusterRequest( + ) + """ + + def testAssignEnterpriseAgentClusterRequest(self): + """Test AssignEnterpriseAgentClusterRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_cloud_and_enterprise_agent_notification_rules_api.py b/agents_api/test/test_cloud_and_enterprise_agent_notification_rules_api.py new file mode 100644 index 00000000..3260cfd9 --- /dev/null +++ b/agents_api/test/test_cloud_and_enterprise_agent_notification_rules_api.py @@ -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 + + +import unittest + +from agents_api.api.cloud_and_enterprise_agent_notification_rules_api import CloudAndEnterpriseAgentNotificationRulesApi + + +class TestCloudAndEnterpriseAgentNotificationRulesApi(unittest.TestCase): + """CloudAndEnterpriseAgentNotificationRulesApi unit test stubs""" + + def setUp(self) -> None: + self.api = CloudAndEnterpriseAgentNotificationRulesApi() + + def tearDown(self) -> None: + pass + + def test_get_agents_notification_rule(self) -> None: + """Test case for get_agents_notification_rule + + Retrieve agent notification rule + """ + pass + + def test_get_agents_notification_rules(self) -> None: + """Test case for get_agents_notification_rules + + List agent notification rules + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_cloud_and_enterprise_agents_api.py b/agents_api/test/test_cloud_and_enterprise_agents_api.py new file mode 100644 index 00000000..15ea98cc --- /dev/null +++ b/agents_api/test/test_cloud_and_enterprise_agents_api.py @@ -0,0 +1,59 @@ +# 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 unittest + +from agents_api.api.cloud_and_enterprise_agents_api import CloudAndEnterpriseAgentsApi + + +class TestCloudAndEnterpriseAgentsApi(unittest.TestCase): + """CloudAndEnterpriseAgentsApi unit test stubs""" + + def setUp(self) -> None: + self.api = CloudAndEnterpriseAgentsApi() + + def tearDown(self) -> None: + pass + + def test_delete_enterprise_agent(self) -> None: + """Test case for delete_enterprise_agent + + Delete Enterprise Agent + """ + pass + + def test_get_agent_details(self) -> None: + """Test case for get_agent_details + + Retrieve Cloud and Enterprise Agent + """ + pass + + def test_get_agents(self) -> None: + """Test case for get_agents + + List Cloud and Enterprise Agents + """ + pass + + def test_update_enterprise_agent_details(self) -> None: + """Test case for update_enterprise_agent_details + + Update Enterprise Agent + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_cloud_enterprise_agent.py b/agents_api/test/test_cloud_enterprise_agent.py new file mode 100644 index 00000000..3a79fa5a --- /dev/null +++ b/agents_api/test/test_cloud_enterprise_agent.py @@ -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 + + +import unittest +import datetime + +from agents_api.models.cloud_enterprise_agent import CloudEnterpriseAgent + +class TestCloudEnterpriseAgent(unittest.TestCase): + """CloudEnterpriseAgent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CloudEnterpriseAgent: + """Test CloudEnterpriseAgent + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CloudEnterpriseAgent` + """ + model = CloudEnterpriseAgent() + if include_optional: + return CloudEnterpriseAgent( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + agent_type = 'enterprise-cluster', + location = 'San Francisco Bay Area', + country_id = 'US', + enabled = True, + verify_ssl_certificates = True, + cluster_members = [ + null + ], + utilization = 25, + account_groups = [ + agents_api.models.account_group.AccountGroup() + ], + prefix = '99.128.0.0/11', + ipv6_policy = 'force-ipv4', + error_details = [ + agents_api.models.error_detail.ErrorDetail( + code = 'agent-version-outdated', + description = 'Agent Version 0.1.1 (latest: 1.0.0)', ) + ], + hostname = 'thousandeyes.com', + last_seen = '2022-07-17T22:00:54Z', + agent_state = 'online', + keep_browser_cache = True, + created_date = '2022-07-17T22:00:54Z', + target_for_tests = '1.1.1.1', + local_resolution_prefixes = [ + '10.2.3.3/24' + ], + interface_ip_mappings = [ + agents_api.models.interface_ip_mapping.InterfaceIpMapping( + interface_name = 'wlp4s0', + ip_addresses = ["73.252.207.219","2601:646:300:3ae0::b977"], ) + ] + ) + else: + return CloudEnterpriseAgent( + ) + """ + + def testCloudEnterpriseAgent(self): + """Test CloudEnterpriseAgent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_cloud_enterprise_agent_type.py b/agents_api/test/test_cloud_enterprise_agent_type.py new file mode 100644 index 00000000..80e23faf --- /dev/null +++ b/agents_api/test/test_cloud_enterprise_agent_type.py @@ -0,0 +1,34 @@ +# 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 unittest +import datetime + +from agents_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType + +class TestCloudEnterpriseAgentType(unittest.TestCase): + """CloudEnterpriseAgentType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCloudEnterpriseAgentType(self): + """Test CloudEnterpriseAgentType""" + # inst = CloudEnterpriseAgentType() + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_cloud_enterprise_agents.py b/agents_api/test/test_cloud_enterprise_agents.py new file mode 100644 index 00000000..d6d2d7ba --- /dev/null +++ b/agents_api/test/test_cloud_enterprise_agents.py @@ -0,0 +1,54 @@ +# 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 unittest +import datetime + +from agents_api.models.cloud_enterprise_agents import CloudEnterpriseAgents + +class TestCloudEnterpriseAgents(unittest.TestCase): + """CloudEnterpriseAgents unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CloudEnterpriseAgents: + """Test CloudEnterpriseAgents + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CloudEnterpriseAgents` + """ + model = CloudEnterpriseAgents() + if include_optional: + return CloudEnterpriseAgents( + agents = [ + null + ] + ) + else: + return CloudEnterpriseAgents( + ) + """ + + def testCloudEnterpriseAgents(self): + """Test CloudEnterpriseAgents""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_cluster_member.py b/agents_api/test/test_cluster_member.py new file mode 100644 index 00000000..319779fb --- /dev/null +++ b/agents_api/test/test_cluster_member.py @@ -0,0 +1,65 @@ +# 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 unittest +import datetime + +from agents_api.models.cluster_member import ClusterMember + +class TestClusterMember(unittest.TestCase): + """ClusterMember unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ClusterMember: + """Test ClusterMember + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ClusterMember` + """ + model = ClusterMember() + if include_optional: + return ClusterMember( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + member_id = '10', + name = 'Cluster member name', + error_details = [ + agents_api.models.error_detail.ErrorDetail( + code = 'agent-version-outdated', + description = 'Agent Version 0.1.1 (latest: 1.0.0)', ) + ], + last_seen = '2022-07-17T22:00:54Z', + agent_state = 'online', + target_for_tests = '1.1.1.1', + utilization = 25 + ) + else: + return ClusterMember( + ) + """ + + def testClusterMember(self): + """Test ClusterMember""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_enterprise_agent.py b/agents_api/test/test_enterprise_agent.py new file mode 100644 index 00000000..6f673d24 --- /dev/null +++ b/agents_api/test/test_enterprise_agent.py @@ -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 + + +import unittest +import datetime + +from agents_api.models.enterprise_agent import EnterpriseAgent + +class TestEnterpriseAgent(unittest.TestCase): + """EnterpriseAgent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EnterpriseAgent: + """Test EnterpriseAgent + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EnterpriseAgent` + """ + model = EnterpriseAgent() + if include_optional: + return EnterpriseAgent( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + agent_type = 'enterprise-cluster', + location = 'San Francisco Bay Area', + country_id = 'US', + enabled = True, + verify_ssl_certificates = True, + cluster_members = [ + null + ], + utilization = 25, + account_groups = [ + agents_api.models.account_group.AccountGroup() + ], + prefix = '99.128.0.0/11', + ipv6_policy = 'force-ipv4', + error_details = [ + agents_api.models.error_detail.ErrorDetail( + code = 'agent-version-outdated', + description = 'Agent Version 0.1.1 (latest: 1.0.0)', ) + ], + hostname = 'thousandeyes.com', + last_seen = '2022-07-17T22:00:54Z', + agent_state = 'online', + keep_browser_cache = True, + created_date = '2022-07-17T22:00:54Z', + target_for_tests = '1.1.1.1', + local_resolution_prefixes = [ + '10.2.3.3/24' + ], + interface_ip_mappings = [ + agents_api.models.interface_ip_mapping.InterfaceIpMapping( + interface_name = 'wlp4s0', + ip_addresses = ["73.252.207.219","2601:646:300:3ae0::b977"], ) + ] + ) + else: + return EnterpriseAgent( + ) + """ + + def testEnterpriseAgent(self): + """Test EnterpriseAgent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_enterprise_agent_cluster_api.py b/agents_api/test/test_enterprise_agent_cluster_api.py new file mode 100644 index 00000000..8644ffa7 --- /dev/null +++ b/agents_api/test/test_enterprise_agent_cluster_api.py @@ -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 + + +import unittest + +from agents_api.api.enterprise_agent_cluster_api import EnterpriseAgentClusterApi + + +class TestEnterpriseAgentClusterApi(unittest.TestCase): + """EnterpriseAgentClusterApi unit test stubs""" + + def setUp(self) -> None: + self.api = EnterpriseAgentClusterApi() + + def tearDown(self) -> None: + pass + + def test_assign_enterprise_agent_cluster(self) -> None: + """Test case for assign_enterprise_agent_cluster + + Add member to Enterprise Agent cluster + """ + pass + + def test_unassign_enterprise_agent_from_cluster(self) -> None: + """Test case for unassign_enterprise_agent_from_cluster + + Remove member from Enterprise Agent cluster + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_enterprise_agent_detail.py b/agents_api/test/test_enterprise_agent_detail.py new file mode 100644 index 00000000..1b756918 --- /dev/null +++ b/agents_api/test/test_enterprise_agent_detail.py @@ -0,0 +1,101 @@ +# 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 unittest +import datetime + +from agents_api.models.enterprise_agent_detail import EnterpriseAgentDetail + +class TestEnterpriseAgentDetail(unittest.TestCase): + """EnterpriseAgentDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EnterpriseAgentDetail: + """Test EnterpriseAgentDetail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EnterpriseAgentDetail` + """ + model = EnterpriseAgentDetail() + if include_optional: + return EnterpriseAgentDetail( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + agent_type = 'enterprise-cluster', + location = 'San Francisco Bay Area', + country_id = 'US', + enabled = True, + verify_ssl_certificates = True, + cluster_members = [ + null + ], + utilization = 25, + account_groups = [ + agents_api.models.account_group.AccountGroup() + ], + prefix = '99.128.0.0/11', + ipv6_policy = 'force-ipv4', + error_details = [ + agents_api.models.error_detail.ErrorDetail( + code = 'agent-version-outdated', + description = 'Agent Version 0.1.1 (latest: 1.0.0)', ) + ], + hostname = 'thousandeyes.com', + last_seen = '2022-07-17T22:00:54Z', + agent_state = 'online', + keep_browser_cache = True, + created_date = '2022-07-17T22:00:54Z', + target_for_tests = '1.1.1.1', + local_resolution_prefixes = [ + '10.2.3.3/24' + ], + interface_ip_mappings = [ + agents_api.models.interface_ip_mapping.InterfaceIpMapping( + interface_name = 'wlp4s0', + ip_addresses = ["73.252.207.219","2601:646:300:3ae0::b977"], ) + ], + tests = [ + null + ], + notification_rules = [ + agents_api.models.notification_rules.NotificationRules( + agent_alert_rules = [{"ruleId":"281474976710706","ruleName":"Default Agent Offline Notification","expression":"((lastContact >= 30 min))","notifyOnClear":true,"isDefault":false},{"ruleId":"281474976710709","ruleName":"Test Rule","expression":"((lastContact >= 40 min))","notifyOnClear":true,"isDefault":true}], ) + ], + labels = [ + agents_api.models.labels.Labels( + label_id = '11', + name = 'Label name', ) + ] + ) + else: + return EnterpriseAgentDetail( + ) + """ + + def testEnterpriseAgentDetail(self): + """Test EnterpriseAgentDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_enterprise_agent_ipv6_policy.py b/agents_api/test/test_enterprise_agent_ipv6_policy.py new file mode 100644 index 00000000..471b9145 --- /dev/null +++ b/agents_api/test/test_enterprise_agent_ipv6_policy.py @@ -0,0 +1,34 @@ +# 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 unittest +import datetime + +from agents_api.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy + +class TestEnterpriseAgentIpv6Policy(unittest.TestCase): + """EnterpriseAgentIpv6Policy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnterpriseAgentIpv6Policy(self): + """Test EnterpriseAgentIpv6Policy""" + # inst = EnterpriseAgentIpv6Policy() + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_enterprise_agent_request_body.py b/agents_api/test/test_enterprise_agent_request_body.py new file mode 100644 index 00000000..19c64298 --- /dev/null +++ b/agents_api/test/test_enterprise_agent_request_body.py @@ -0,0 +1,59 @@ +# 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 unittest +import datetime + +from agents_api.models.enterprise_agent_request_body import EnterpriseAgentRequestBody + +class TestEnterpriseAgentRequestBody(unittest.TestCase): + """EnterpriseAgentRequestBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EnterpriseAgentRequestBody: + """Test EnterpriseAgentRequestBody + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EnterpriseAgentRequestBody` + """ + model = EnterpriseAgentRequestBody() + if include_optional: + return EnterpriseAgentRequestBody( + agent_name = 'thousandeyes-stg-va-254', + enabled = True, + account_groups = ["1234","1"], + ipv6_policy = 'force-ipv4', + keep_browser_cache = True, + target_for_tests = '1.1.1.1', + local_resolution_prefixes = ["10.2.3.3/24","10.2.3.3/25"], + tests = ["12313145","12345"] + ) + else: + return EnterpriseAgentRequestBody( + ) + """ + + def testEnterpriseAgentRequestBody(self): + """Test EnterpriseAgentRequestBody""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_enterprise_agent_state.py b/agents_api/test/test_enterprise_agent_state.py new file mode 100644 index 00000000..41becb46 --- /dev/null +++ b/agents_api/test/test_enterprise_agent_state.py @@ -0,0 +1,34 @@ +# 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 unittest +import datetime + +from agents_api.models.enterprise_agent_state import EnterpriseAgentState + +class TestEnterpriseAgentState(unittest.TestCase): + """EnterpriseAgentState unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnterpriseAgentState(self): + """Test EnterpriseAgentState""" + # inst = EnterpriseAgentState() + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_error.py b/agents_api/test/test_error.py new file mode 100644 index 00000000..e64fc6ce --- /dev/null +++ b/agents_api/test/test_error.py @@ -0,0 +1,56 @@ +# 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 unittest +import datetime + +from agents_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_error_detail.py b/agents_api/test/test_error_detail.py new file mode 100644 index 00000000..3a734e28 --- /dev/null +++ b/agents_api/test/test_error_detail.py @@ -0,0 +1,53 @@ +# 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 unittest +import datetime + +from agents_api.models.error_detail import ErrorDetail + +class TestErrorDetail(unittest.TestCase): + """ErrorDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ErrorDetail: + """Test ErrorDetail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ErrorDetail` + """ + model = ErrorDetail() + if include_optional: + return ErrorDetail( + code = 'agent-version-outdated', + description = 'Agent Version 0.1.1 (latest: 1.0.0)' + ) + else: + return ErrorDetail( + ) + """ + + def testErrorDetail(self): + """Test ErrorDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_error_detail_code.py b/agents_api/test/test_error_detail_code.py new file mode 100644 index 00000000..bd215df3 --- /dev/null +++ b/agents_api/test/test_error_detail_code.py @@ -0,0 +1,34 @@ +# 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 unittest +import datetime + +from agents_api.models.error_detail_code import ErrorDetailCode + +class TestErrorDetailCode(unittest.TestCase): + """ErrorDetailCode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testErrorDetailCode(self): + """Test ErrorDetailCode""" + # inst = ErrorDetailCode() + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_get_agent_details200_response.py b/agents_api/test/test_get_agent_details200_response.py new file mode 100644 index 00000000..f765b7f0 --- /dev/null +++ b/agents_api/test/test_get_agent_details200_response.py @@ -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 + + +import unittest +import datetime + +from agents_api.models.get_agent_details200_response import GetAgentDetails200Response + +class TestGetAgentDetails200Response(unittest.TestCase): + """GetAgentDetails200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAgentDetails200Response: + """Test GetAgentDetails200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAgentDetails200Response` + """ + model = GetAgentDetails200Response() + if include_optional: + return GetAgentDetails200Response( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + agent_type = 'enterprise-cluster', + location = 'San Francisco Bay Area', + country_id = 'US', + enabled = True, + verify_ssl_certificates = True, + cluster_members = [ + null + ], + utilization = 25, + account_groups = [ + agents_api.models.account_group.AccountGroup() + ], + prefix = '99.128.0.0/11', + ipv6_policy = 'force-ipv4', + error_details = [ + agents_api.models.error_detail.ErrorDetail( + code = 'agent-version-outdated', + description = 'Agent Version 0.1.1 (latest: 1.0.0)', ) + ], + hostname = 'thousandeyes.com', + last_seen = '2022-07-17T22:00:54Z', + agent_state = 'online', + keep_browser_cache = True, + created_date = '2022-07-17T22:00:54Z', + target_for_tests = '1.1.1.1', + local_resolution_prefixes = [ + '10.2.3.3/24' + ], + interface_ip_mappings = [ + agents_api.models.interface_ip_mapping.InterfaceIpMapping( + interface_name = 'wlp4s0', + ip_addresses = ["73.252.207.219","2601:646:300:3ae0::b977"], ) + ], + tests = [ + null + ], + notification_rules = [ + agents_api.models.notification_rules.NotificationRules( + agent_alert_rules = [{"ruleId":"281474976710706","ruleName":"Default Agent Offline Notification","expression":"((lastContact >= 30 min))","notifyOnClear":true,"isDefault":false},{"ruleId":"281474976710709","ruleName":"Test Rule","expression":"((lastContact >= 40 min))","notifyOnClear":true,"isDefault":true}], ) + ], + labels = [ + agents_api.models.labels.Labels( + label_id = '11', + name = 'Label name', ) + ], + links = agents_api.models.self_links__links.SelfLinks__links( + self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetAgentDetails200Response( + ) + """ + + def testGetAgentDetails200Response(self): + """Test GetAgentDetails200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_get_agent_proxies200_response.py b/agents_api/test/test_get_agent_proxies200_response.py new file mode 100644 index 00000000..f7967541 --- /dev/null +++ b/agents_api/test/test_get_agent_proxies200_response.py @@ -0,0 +1,75 @@ +# 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 unittest +import datetime + +from agents_api.models.get_agent_proxies200_response import GetAgentProxies200Response + +class TestGetAgentProxies200Response(unittest.TestCase): + """GetAgentProxies200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAgentProxies200Response: + """Test GetAgentProxies200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAgentProxies200Response` + """ + model = GetAgentProxies200Response() + if include_optional: + return GetAgentProxies200Response( + agent_proxies = [ + agents_api.models.agent_proxy.AgentProxy( + aid = '105', + auth_type = 'basic', + bypass_list = ["10.0.0.0/16","*.thousandeyes.com"], + last_modified = '2022-07-17T22:00:54Z', + location = 'proxy.thousandeyes.com:3128', + is_local_configured = True, + name = 'Test Proxy - Auth Type - BASIC', + password = '****', + proxy_id = '281474976710706', + type = 'static', + user = 'user1', ) + ], + links = agents_api.models.self_links__links.SelfLinks__links( + self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetAgentProxies200Response( + ) + """ + + def testGetAgentProxies200Response(self): + """Test GetAgentProxies200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_get_agents200_response.py b/agents_api/test/test_get_agents200_response.py new file mode 100644 index 00000000..8a45fad1 --- /dev/null +++ b/agents_api/test/test_get_agents200_response.py @@ -0,0 +1,64 @@ +# 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 unittest +import datetime + +from agents_api.models.get_agents200_response import GetAgents200Response + +class TestGetAgents200Response(unittest.TestCase): + """GetAgents200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAgents200Response: + """Test GetAgents200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAgents200Response` + """ + model = GetAgents200Response() + if include_optional: + return GetAgents200Response( + agents = [ + null + ], + links = agents_api.models.self_links__links.SelfLinks__links( + self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetAgents200Response( + ) + """ + + def testGetAgents200Response(self): + """Test GetAgents200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_get_agents_notification_rule200_response.py b/agents_api/test/test_get_agents_notification_rule200_response.py new file mode 100644 index 00000000..0d8e1928 --- /dev/null +++ b/agents_api/test/test_get_agents_notification_rule200_response.py @@ -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 + + +import unittest +import datetime + +from agents_api.models.get_agents_notification_rule200_response import GetAgentsNotificationRule200Response + +class TestGetAgentsNotificationRule200Response(unittest.TestCase): + """GetAgentsNotificationRule200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAgentsNotificationRule200Response: + """Test GetAgentsNotificationRule200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAgentsNotificationRule200Response` + """ + model = GetAgentsNotificationRule200Response() + if include_optional: + return GetAgentsNotificationRule200Response( + rule_id = '281474976710706', + rule_name = 'Default Agent Offline Notification', + expression = '((lastContact >= 30 min))', + notify_on_clear = True, + is_default = False, + agents = [ + agents_api.models.agent.Agent() + ], + notifications = agents_api.models.notification.Notification( + email = agents_api.models.alert_email.AlertEmail( + message = 'This test is failing, check as soon as possible.', + recipients = ["user1@thousandeyes.com","user2@cisco.com"], ), + third_party = [ + agents_api.models.alert_integration_base.AlertIntegrationBase( + integration_id = 'wb-78', + integration_name = 'integrationSlack1', + integration_type = 'slack', + target = 'https://hooks.slack.com/services/asd/0VqDYEpidpHVAK397x8PBsmZ', + auth_method = 'Basic', + auth_user = 'user123', + auth_token = '0VqDYEpidpHVAK397x8PBsmZ', + channel = '#slackChannel', ) + ], + webhook = [ + agents_api.models.alert_integration_base.AlertIntegrationBase( + integration_id = 'wb-78', + integration_name = 'integrationSlack1', + target = 'https://hooks.slack.com/services/asd/0VqDYEpidpHVAK397x8PBsmZ', + auth_method = 'Basic', + auth_user = 'user123', + auth_token = '0VqDYEpidpHVAK397x8PBsmZ', + channel = '#slackChannel', ) + ], ), + links = agents_api.models.self_links__links.SelfLinks__links( + self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetAgentsNotificationRule200Response( + ) + """ + + def testGetAgentsNotificationRule200Response(self): + """Test GetAgentsNotificationRule200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_get_agents_notification_rules200_response.py b/agents_api/test/test_get_agents_notification_rules200_response.py new file mode 100644 index 00000000..2c1cc0b8 --- /dev/null +++ b/agents_api/test/test_get_agents_notification_rules200_response.py @@ -0,0 +1,62 @@ +# 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 unittest +import datetime + +from agents_api.models.get_agents_notification_rules200_response import GetAgentsNotificationRules200Response + +class TestGetAgentsNotificationRules200Response(unittest.TestCase): + """GetAgentsNotificationRules200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAgentsNotificationRules200Response: + """Test GetAgentsNotificationRules200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAgentsNotificationRules200Response` + """ + model = GetAgentsNotificationRules200Response() + if include_optional: + return GetAgentsNotificationRules200Response( + agent_alert_rules = [{ruleId=281474976710706, ruleName=Default Agent Offline Notification, expression=((lastContact >= 30 min)), notifyOnClear=true, isDefault=false}, {ruleId=281474976710709, ruleName=Test Rule, expression=((lastContact >= 40 min)), notifyOnClear=true, isDefault=true}], + links = agents_api.models.self_links__links.SelfLinks__links( + self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetAgentsNotificationRules200Response( + ) + """ + + def testGetAgentsNotificationRules200Response(self): + """Test GetAgentsNotificationRules200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_interface_ip_mapping.py b/agents_api/test/test_interface_ip_mapping.py new file mode 100644 index 00000000..caaee9d7 --- /dev/null +++ b/agents_api/test/test_interface_ip_mapping.py @@ -0,0 +1,53 @@ +# 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 unittest +import datetime + +from agents_api.models.interface_ip_mapping import InterfaceIpMapping + +class TestInterfaceIpMapping(unittest.TestCase): + """InterfaceIpMapping unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterfaceIpMapping: + """Test InterfaceIpMapping + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InterfaceIpMapping` + """ + model = InterfaceIpMapping() + if include_optional: + return InterfaceIpMapping( + interface_name = 'wlp4s0', + ip_addresses = ["73.252.207.219","2601:646:300:3ae0::b977"] + ) + else: + return InterfaceIpMapping( + ) + """ + + def testInterfaceIpMapping(self): + """Test InterfaceIpMapping""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_labels.py b/agents_api/test/test_labels.py new file mode 100644 index 00000000..3079c90d --- /dev/null +++ b/agents_api/test/test_labels.py @@ -0,0 +1,53 @@ +# 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 unittest +import datetime + +from agents_api.models.labels import Labels + +class TestLabels(unittest.TestCase): + """Labels unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Labels: + """Test Labels + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Labels` + """ + model = Labels() + if include_optional: + return Labels( + label_id = '11', + name = 'Label name' + ) + else: + return Labels( + ) + """ + + def testLabels(self): + """Test Labels""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_link.py b/agents_api/test/test_link.py new file mode 100644 index 00000000..6fb41455 --- /dev/null +++ b/agents_api/test/test_link.py @@ -0,0 +1,60 @@ +# 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 unittest +import datetime + +from agents_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_notification.py b/agents_api/test/test_notification.py new file mode 100644 index 00000000..bd9ff7e5 --- /dev/null +++ b/agents_api/test/test_notification.py @@ -0,0 +1,76 @@ +# 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 unittest +import datetime + +from agents_api.models.notification import Notification + +class TestNotification(unittest.TestCase): + """Notification unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Notification: + """Test Notification + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Notification` + """ + model = Notification() + if include_optional: + return Notification( + email = agents_api.models.alert_email.AlertEmail( + message = 'This test is failing, check as soon as possible.', + recipients = ["user1@thousandeyes.com","user2@cisco.com"], ), + third_party = [ + agents_api.models.alert_integration_base.AlertIntegrationBase( + integration_id = 'wb-78', + integration_name = 'integrationSlack1', + integration_type = 'slack', + target = 'https://hooks.slack.com/services/asd/0VqDYEpidpHVAK397x8PBsmZ', + auth_method = 'Basic', + auth_user = 'user123', + auth_token = '0VqDYEpidpHVAK397x8PBsmZ', + channel = '#slackChannel', ) + ], + webhook = [ + agents_api.models.alert_integration_base.AlertIntegrationBase( + integration_id = 'wb-78', + integration_name = 'integrationSlack1', + integration_type = 'slack', + target = 'https://hooks.slack.com/services/asd/0VqDYEpidpHVAK397x8PBsmZ', + auth_method = 'Basic', + auth_user = 'user123', + auth_token = '0VqDYEpidpHVAK397x8PBsmZ', + channel = '#slackChannel', ) + ] + ) + else: + return Notification( + ) + """ + + def testNotification(self): + """Test Notification""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_notification_rule.py b/agents_api/test/test_notification_rule.py new file mode 100644 index 00000000..49fe680e --- /dev/null +++ b/agents_api/test/test_notification_rule.py @@ -0,0 +1,56 @@ +# 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 unittest +import datetime + +from agents_api.models.notification_rule import NotificationRule + +class TestNotificationRule(unittest.TestCase): + """NotificationRule unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NotificationRule: + """Test NotificationRule + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NotificationRule` + """ + model = NotificationRule() + if include_optional: + return NotificationRule( + rule_id = '281474976710706', + rule_name = 'Default Agent Offline Notification', + expression = '((lastContact >= 30 min))', + notify_on_clear = True, + is_default = False + ) + else: + return NotificationRule( + ) + """ + + def testNotificationRule(self): + """Test NotificationRule""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_notification_rule_detail.py b/agents_api/test/test_notification_rule_detail.py new file mode 100644 index 00000000..5cd2403e --- /dev/null +++ b/agents_api/test/test_notification_rule_detail.py @@ -0,0 +1,84 @@ +# 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 unittest +import datetime + +from agents_api.models.notification_rule_detail import NotificationRuleDetail + +class TestNotificationRuleDetail(unittest.TestCase): + """NotificationRuleDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NotificationRuleDetail: + """Test NotificationRuleDetail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NotificationRuleDetail` + """ + model = NotificationRuleDetail() + if include_optional: + return NotificationRuleDetail( + rule_id = '281474976710706', + rule_name = 'Default Agent Offline Notification', + expression = '((lastContact >= 30 min))', + notify_on_clear = True, + is_default = False, + agents = [ + agents_api.models.agent.Agent() + ], + notifications = agents_api.models.notification.Notification( + email = agents_api.models.alert_email.AlertEmail( + message = 'This test is failing, check as soon as possible.', + recipients = ["user1@thousandeyes.com","user2@cisco.com"], ), + third_party = [ + agents_api.models.alert_integration_base.AlertIntegrationBase( + integration_id = 'wb-78', + integration_name = 'integrationSlack1', + integration_type = 'slack', + target = 'https://hooks.slack.com/services/asd/0VqDYEpidpHVAK397x8PBsmZ', + auth_method = 'Basic', + auth_user = 'user123', + auth_token = '0VqDYEpidpHVAK397x8PBsmZ', + channel = '#slackChannel', ) + ], + webhook = [ + agents_api.models.alert_integration_base.AlertIntegrationBase( + integration_id = 'wb-78', + integration_name = 'integrationSlack1', + target = 'https://hooks.slack.com/services/asd/0VqDYEpidpHVAK397x8PBsmZ', + auth_method = 'Basic', + auth_user = 'user123', + auth_token = '0VqDYEpidpHVAK397x8PBsmZ', + channel = '#slackChannel', ) + ], ) + ) + else: + return NotificationRuleDetail( + ) + """ + + def testNotificationRuleDetail(self): + """Test NotificationRuleDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_notification_rules.py b/agents_api/test/test_notification_rules.py new file mode 100644 index 00000000..ecb56501 --- /dev/null +++ b/agents_api/test/test_notification_rules.py @@ -0,0 +1,52 @@ +# 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 unittest +import datetime + +from agents_api.models.notification_rules import NotificationRules + +class TestNotificationRules(unittest.TestCase): + """NotificationRules unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NotificationRules: + """Test NotificationRules + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NotificationRules` + """ + model = NotificationRules() + if include_optional: + return NotificationRules( + agent_alert_rules = [{"ruleId":"281474976710706","ruleName":"Default Agent Offline Notification","expression":"((lastContact >= 30 min))","notifyOnClear":true,"isDefault":false},{"ruleId":"281474976710709","ruleName":"Test Rule","expression":"((lastContact >= 40 min))","notifyOnClear":true,"isDefault":true}] + ) + else: + return NotificationRules( + ) + """ + + def testNotificationRules(self): + """Test NotificationRules""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_notifications.py b/agents_api/test/test_notifications.py new file mode 100644 index 00000000..2f928cb6 --- /dev/null +++ b/agents_api/test/test_notifications.py @@ -0,0 +1,76 @@ +# 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 unittest +import datetime + +from agents_api.models.notifications import Notifications + +class TestNotifications(unittest.TestCase): + """Notifications unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Notifications: + """Test Notifications + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Notifications` + """ + model = Notifications() + if include_optional: + return Notifications( + notifications = agents_api.models.notification.Notification( + email = agents_api.models.alert_email.AlertEmail( + message = 'This test is failing, check as soon as possible.', + recipients = ["user1@thousandeyes.com","user2@cisco.com"], ), + third_party = [ + agents_api.models.alert_integration_base.AlertIntegrationBase( + integration_id = 'wb-78', + integration_name = 'integrationSlack1', + integration_type = 'slack', + target = 'https://hooks.slack.com/services/asd/0VqDYEpidpHVAK397x8PBsmZ', + auth_method = 'Basic', + auth_user = 'user123', + auth_token = '0VqDYEpidpHVAK397x8PBsmZ', + channel = '#slackChannel', ) + ], + webhook = [ + agents_api.models.alert_integration_base.AlertIntegrationBase( + integration_id = 'wb-78', + integration_name = 'integrationSlack1', + target = 'https://hooks.slack.com/services/asd/0VqDYEpidpHVAK397x8PBsmZ', + auth_method = 'Basic', + auth_user = 'user123', + auth_token = '0VqDYEpidpHVAK397x8PBsmZ', + channel = '#slackChannel', ) + ], ) + ) + else: + return Notifications( + ) + """ + + def testNotifications(self): + """Test Notifications""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_proxies_api.py b/agents_api/test/test_proxies_api.py new file mode 100644 index 00000000..e9df1189 --- /dev/null +++ b/agents_api/test/test_proxies_api.py @@ -0,0 +1,38 @@ +# 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 unittest + +from agents_api.api.proxies_api import ProxiesApi + + +class TestProxiesApi(unittest.TestCase): + """ProxiesApi unit test stubs""" + + def setUp(self) -> None: + self.api = ProxiesApi() + + def tearDown(self) -> None: + pass + + def test_get_agent_proxies(self) -> None: + """Test case for get_agent_proxies + + List agent proxies + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_proxy_auth_type.py b/agents_api/test/test_proxy_auth_type.py new file mode 100644 index 00000000..69e56965 --- /dev/null +++ b/agents_api/test/test_proxy_auth_type.py @@ -0,0 +1,34 @@ +# 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 unittest +import datetime + +from agents_api.models.proxy_auth_type import ProxyAuthType + +class TestProxyAuthType(unittest.TestCase): + """ProxyAuthType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testProxyAuthType(self): + """Test ProxyAuthType""" + # inst = ProxyAuthType() + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_proxy_type.py b/agents_api/test/test_proxy_type.py new file mode 100644 index 00000000..66ecf42c --- /dev/null +++ b/agents_api/test/test_proxy_type.py @@ -0,0 +1,34 @@ +# 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 unittest +import datetime + +from agents_api.models.proxy_type import ProxyType + +class TestProxyType(unittest.TestCase): + """ProxyType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testProxyType(self): + """Test ProxyType""" + # inst = ProxyType() + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_self_links.py b/agents_api/test/test_self_links.py new file mode 100644 index 00000000..774ce1a4 --- /dev/null +++ b/agents_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# 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 unittest +import datetime + +from agents_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = agents_api.models.self_links__links.SelfLinks__links( + self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_self_links_links.py b/agents_api/test/test_self_links_links.py new file mode 100644 index 00000000..9f292d80 --- /dev/null +++ b/agents_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# 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 unittest +import datetime + +from agents_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_simple_test.py b/agents_api/test/test_simple_test.py new file mode 100644 index 00000000..877a0130 --- /dev/null +++ b/agents_api/test/test_simple_test.py @@ -0,0 +1,67 @@ +# 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 unittest +import datetime + +from agents_api.models.simple_test import SimpleTest + +class TestSimpleTest(unittest.TestCase): + """SimpleTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SimpleTest: + """Test SimpleTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SimpleTest` + """ + model = SimpleTest() + if include_optional: + return SimpleTest( + interval = 120, + alerts_enabled = True, + enabled = True, + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = agents_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ) + ) + else: + return SimpleTest( + ) + """ + + def testSimpleTest(self): + """Test SimpleTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_test_interval.py b/agents_api/test/test_test_interval.py new file mode 100644 index 00000000..64fb49eb --- /dev/null +++ b/agents_api/test/test_test_interval.py @@ -0,0 +1,34 @@ +# 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 unittest +import datetime + +from agents_api.models.test_interval import TestInterval + +class TestTestInterval(unittest.TestCase): + """TestInterval unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestInterval(self): + """Test TestInterval""" + # inst = TestInterval() + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_test_type.py b/agents_api/test/test_test_type.py new file mode 100644 index 00000000..205cd405 --- /dev/null +++ b/agents_api/test/test_test_type.py @@ -0,0 +1,34 @@ +# 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 unittest +import datetime + +from agents_api.models.test_type import TestType + +class TestTestType(unittest.TestCase): + """TestType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestType(self): + """Test TestType""" + # inst = TestType() + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_unassign_enterprise_agent_from_cluster_request.py b/agents_api/test/test_unassign_enterprise_agent_from_cluster_request.py new file mode 100644 index 00000000..f813bee5 --- /dev/null +++ b/agents_api/test/test_unassign_enterprise_agent_from_cluster_request.py @@ -0,0 +1,54 @@ +# 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 unittest +import datetime + +from agents_api.models.unassign_enterprise_agent_from_cluster_request import UnassignEnterpriseAgentFromClusterRequest + +class TestUnassignEnterpriseAgentFromClusterRequest(unittest.TestCase): + """UnassignEnterpriseAgentFromClusterRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnassignEnterpriseAgentFromClusterRequest: + """Test UnassignEnterpriseAgentFromClusterRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnassignEnterpriseAgentFromClusterRequest` + """ + model = UnassignEnterpriseAgentFromClusterRequest() + if include_optional: + return UnassignEnterpriseAgentFromClusterRequest( + members = [ + '281474976710706' + ] + ) + else: + return UnassignEnterpriseAgentFromClusterRequest( + ) + """ + + def testUnassignEnterpriseAgentFromClusterRequest(self): + """Test UnassignEnterpriseAgentFromClusterRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_unauthorized_error.py b/agents_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..aa5bcb3f --- /dev/null +++ b/agents_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# 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 unittest +import datetime + +from agents_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_unexpanded_instant_test.py b/agents_api/test/test_unexpanded_instant_test.py new file mode 100644 index 00000000..6046d12c --- /dev/null +++ b/agents_api/test/test_unexpanded_instant_test.py @@ -0,0 +1,64 @@ +# 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 unittest +import datetime + +from agents_api.models.unexpanded_instant_test import UnexpandedInstantTest + +class TestUnexpandedInstantTest(unittest.TestCase): + """UnexpandedInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTest: + """Test UnexpandedInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTest` + """ + model = UnexpandedInstantTest() + if include_optional: + return UnexpandedInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = agents_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ) + ) + else: + return UnexpandedInstantTest( + ) + """ + + def testUnexpandedInstantTest(self): + """Test UnexpandedInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_unexpanded_instant_test_links.py b/agents_api/test/test_unexpanded_instant_test_links.py new file mode 100644 index 00000000..1c9a393e --- /dev/null +++ b/agents_api/test/test_unexpanded_instant_test_links.py @@ -0,0 +1,53 @@ +# 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 unittest +import datetime + +from agents_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks + +class TestUnexpandedInstantTestLinks(unittest.TestCase): + """UnexpandedInstantTestLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinks: + """Test UnexpandedInstantTestLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinks` + """ + model = UnexpandedInstantTestLinks() + if include_optional: + return UnexpandedInstantTestLinks( + var_self = None, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}] + ) + else: + return UnexpandedInstantTestLinks( + ) + """ + + def testUnexpandedInstantTestLinks(self): + """Test UnexpandedInstantTestLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_unexpanded_instant_test_links_self.py b/agents_api/test/test_unexpanded_instant_test_links_self.py new file mode 100644 index 00000000..90dd56b1 --- /dev/null +++ b/agents_api/test/test_unexpanded_instant_test_links_self.py @@ -0,0 +1,60 @@ +# 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 unittest +import datetime + +from agents_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf + +class TestUnexpandedInstantTestLinksSelf(unittest.TestCase): + """UnexpandedInstantTestLinksSelf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinksSelf: + """Test UnexpandedInstantTestLinksSelf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinksSelf` + """ + model = UnexpandedInstantTestLinksSelf() + if include_optional: + return UnexpandedInstantTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return UnexpandedInstantTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testUnexpandedInstantTestLinksSelf(self): + """Test UnexpandedInstantTestLinksSelf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_unexpanded_instant_test_links_test_results.py b/agents_api/test/test_unexpanded_instant_test_links_test_results.py new file mode 100644 index 00000000..f9446982 --- /dev/null +++ b/agents_api/test/test_unexpanded_instant_test_links_test_results.py @@ -0,0 +1,60 @@ +# 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 unittest +import datetime + +from agents_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults + +class TestUnexpandedInstantTestLinksTestResults(unittest.TestCase): + """UnexpandedInstantTestLinksTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinksTestResults: + """Test UnexpandedInstantTestLinksTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinksTestResults` + """ + model = UnexpandedInstantTestLinksTestResults() + if include_optional: + return UnexpandedInstantTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return UnexpandedInstantTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testUnexpandedInstantTestLinksTestResults(self): + """Test UnexpandedInstantTestLinksTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_unexpanded_test.py b/agents_api/test/test_unexpanded_test.py new file mode 100644 index 00000000..747ec0d9 --- /dev/null +++ b/agents_api/test/test_unexpanded_test.py @@ -0,0 +1,54 @@ +# 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 unittest +import datetime + +from agents_api.models.unexpanded_test import UnexpandedTest + +class TestUnexpandedTest(unittest.TestCase): + """UnexpandedTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedTest: + """Test UnexpandedTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedTest` + """ + model = UnexpandedTest() + if include_optional: + return UnexpandedTest( + interval = 120, + alerts_enabled = True, + enabled = True + ) + else: + return UnexpandedTest( + ) + """ + + def testUnexpandedTest(self): + """Test UnexpandedTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/test/test_update_enterprise_agent_details200_response.py b/agents_api/test/test_update_enterprise_agent_details200_response.py new file mode 100644 index 00000000..a6e04ce3 --- /dev/null +++ b/agents_api/test/test_update_enterprise_agent_details200_response.py @@ -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 + + +import unittest +import datetime + +from agents_api.models.update_enterprise_agent_details200_response import UpdateEnterpriseAgentDetails200Response + +class TestUpdateEnterpriseAgentDetails200Response(unittest.TestCase): + """UpdateEnterpriseAgentDetails200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateEnterpriseAgentDetails200Response: + """Test UpdateEnterpriseAgentDetails200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateEnterpriseAgentDetails200Response` + """ + model = UpdateEnterpriseAgentDetails200Response() + if include_optional: + return UpdateEnterpriseAgentDetails200Response( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + agent_type = 'enterprise-cluster', + location = 'San Francisco Bay Area', + country_id = 'US', + enabled = True, + verify_ssl_certificates = True, + cluster_members = [ + null + ], + utilization = 25, + account_groups = [ + agents_api.models.account_group.AccountGroup() + ], + prefix = '99.128.0.0/11', + ipv6_policy = 'force-ipv4', + error_details = [ + agents_api.models.error_detail.ErrorDetail( + code = 'agent-version-outdated', + description = 'Agent Version 0.1.1 (latest: 1.0.0)', ) + ], + hostname = 'thousandeyes.com', + last_seen = '2022-07-17T22:00:54Z', + agent_state = 'online', + keep_browser_cache = True, + created_date = '2022-07-17T22:00:54Z', + target_for_tests = '1.1.1.1', + local_resolution_prefixes = [ + '10.2.3.3/24' + ], + interface_ip_mappings = [ + agents_api.models.interface_ip_mapping.InterfaceIpMapping( + interface_name = 'wlp4s0', + ip_addresses = ["73.252.207.219","2601:646:300:3ae0::b977"], ) + ], + tests = [ + null + ], + notification_rules = [ + agents_api.models.notification_rules.NotificationRules( + agent_alert_rules = [{"ruleId":"281474976710706","ruleName":"Default Agent Offline Notification","expression":"((lastContact >= 30 min))","notifyOnClear":true,"isDefault":false},{"ruleId":"281474976710709","ruleName":"Test Rule","expression":"((lastContact >= 40 min))","notifyOnClear":true,"isDefault":true}], ) + ], + labels = [ + agents_api.models.labels.Labels( + label_id = '11', + name = 'Label name', ) + ], + links = agents_api.models.self_links__links.SelfLinks__links( + self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return UpdateEnterpriseAgentDetails200Response( + ) + """ + + def testUpdateEnterpriseAgentDetails200Response(self): + """Test UpdateEnterpriseAgentDetails200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/agents_api/tox.ini b/agents_api/tox.ini new file mode 100644 index 00000000..5d4caa48 --- /dev/null +++ b/agents_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=agents_api diff --git a/alerts_api/.github/workflows/python.yml b/alerts_api/.github/workflows/python.yml new file mode 100644 index 00000000..9c698eb6 --- /dev/null +++ b/alerts_api/.github/workflows/python.yml @@ -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: alerts_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 diff --git a/alerts_api/.gitignore b/alerts_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/alerts_api/.gitignore @@ -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 diff --git a/alerts_api/.gitlab-ci.yml b/alerts_api/.gitlab-ci.yml new file mode 100644 index 00000000..178a5bec --- /dev/null +++ b/alerts_api/.gitlab-ci.yml @@ -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=alerts_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 diff --git a/alerts_api/.openapi-generator-ignore b/alerts_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/alerts_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/alerts_api/.openapi-generator/FILES b/alerts_api/.openapi-generator/FILES new file mode 100644 index 00000000..4fe2148b --- /dev/null +++ b/alerts_api/.openapi-generator/FILES @@ -0,0 +1,206 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +alerts_api/__init__.py +alerts_api/api/__init__.py +alerts_api/api/alert_rules_api.py +alerts_api/api/alert_suppression_windows_api.py +alerts_api/api/alerts_api.py +alerts_api/api_client.py +alerts_api/api_response.py +alerts_api/configuration.py +alerts_api/exceptions.py +alerts_api/models/__init__.py +alerts_api/models/alert.py +alerts_api/models/alert_detail.py +alerts_api/models/alert_links.py +alerts_api/models/alert_metric_detail.py +alerts_api/models/alert_metric_detail_end.py +alerts_api/models/alert_metric_detail_start.py +alerts_api/models/alert_metrics.py +alerts_api/models/alert_rounds_violation_mode.py +alerts_api/models/alert_rule.py +alerts_api/models/alert_suppression_window.py +alerts_api/models/alert_suppression_window_request.py +alerts_api/models/alert_suppression_window_state.py +alerts_api/models/alert_suppression_windows.py +alerts_api/models/alert_suppression_windows_alert_suppression_windows_inner.py +alerts_api/models/alert_type.py +alerts_api/models/alerts.py +alerts_api/models/app_links.py +alerts_api/models/app_links_links.py +alerts_api/models/base_alert.py +alerts_api/models/base_test.py +alerts_api/models/complete_alert_suppression_window.py +alerts_api/models/create_alert_rule201_response.py +alerts_api/models/create_suppression_windows201_response.py +alerts_api/models/days_of_week.py +alerts_api/models/end_repeat.py +alerts_api/models/end_repeat_type.py +alerts_api/models/error.py +alerts_api/models/expand.py +alerts_api/models/get_alert_rule_details200_response.py +alerts_api/models/get_alerts200_response.py +alerts_api/models/get_alerts_rules200_response.py +alerts_api/models/get_suppression_windows200_response.py +alerts_api/models/interval_type.py +alerts_api/models/link.py +alerts_api/models/notification.py +alerts_api/models/notification_email.py +alerts_api/models/notification_third_party.py +alerts_api/models/notification_webhook.py +alerts_api/models/pagination_links.py +alerts_api/models/pagination_links_links.py +alerts_api/models/repeat.py +alerts_api/models/repeat_type.py +alerts_api/models/rule.py +alerts_api/models/rule_detail.py +alerts_api/models/rule_detail_update.py +alerts_api/models/rule_links.py +alerts_api/models/rule_links_links.py +alerts_api/models/rules.py +alerts_api/models/self_links.py +alerts_api/models/self_links_links.py +alerts_api/models/severity.py +alerts_api/models/state.py +alerts_api/models/test_direction.py +alerts_api/models/test_interval.py +alerts_api/models/third_party_integration_type.py +alerts_api/models/unauthorized_error.py +alerts_api/models/unexpanded_test.py +alerts_api/models/webhook_integration_type.py +alerts_api/py.typed +alerts_api/rest.py +docs/Alert.md +docs/AlertDetail.md +docs/AlertLinks.md +docs/AlertMetricDetail.md +docs/AlertMetricDetailEnd.md +docs/AlertMetricDetailStart.md +docs/AlertMetrics.md +docs/AlertRoundsViolationMode.md +docs/AlertRule.md +docs/AlertRulesApi.md +docs/AlertSuppressionWindow.md +docs/AlertSuppressionWindowRequest.md +docs/AlertSuppressionWindowState.md +docs/AlertSuppressionWindows.md +docs/AlertSuppressionWindowsAlertSuppressionWindowsInner.md +docs/AlertSuppressionWindowsApi.md +docs/AlertType.md +docs/Alerts.md +docs/AlertsApi.md +docs/AppLinks.md +docs/AppLinksLinks.md +docs/BaseAlert.md +docs/BaseTest.md +docs/CompleteAlertSuppressionWindow.md +docs/CreateAlertRule201Response.md +docs/CreateSuppressionWindows201Response.md +docs/DaysOfWeek.md +docs/EndRepeat.md +docs/EndRepeatType.md +docs/Error.md +docs/Expand.md +docs/GetAlertRuleDetails200Response.md +docs/GetAlerts200Response.md +docs/GetAlertsRules200Response.md +docs/GetSuppressionWindows200Response.md +docs/IntervalType.md +docs/Link.md +docs/Notification.md +docs/NotificationEmail.md +docs/NotificationThirdParty.md +docs/NotificationWebhook.md +docs/PaginationLinks.md +docs/PaginationLinksLinks.md +docs/Repeat.md +docs/RepeatType.md +docs/Rule.md +docs/RuleDetail.md +docs/RuleDetailUpdate.md +docs/RuleLinks.md +docs/RuleLinksLinks.md +docs/Rules.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/Severity.md +docs/State.md +docs/TestDirection.md +docs/TestInterval.md +docs/ThirdPartyIntegrationType.md +docs/UnauthorizedError.md +docs/UnexpandedTest.md +docs/WebhookIntegrationType.md +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_alert.py +test/test_alert_detail.py +test/test_alert_links.py +test/test_alert_metric_detail.py +test/test_alert_metric_detail_end.py +test/test_alert_metric_detail_start.py +test/test_alert_metrics.py +test/test_alert_rounds_violation_mode.py +test/test_alert_rule.py +test/test_alert_rules_api.py +test/test_alert_suppression_window.py +test/test_alert_suppression_window_request.py +test/test_alert_suppression_window_state.py +test/test_alert_suppression_windows.py +test/test_alert_suppression_windows_alert_suppression_windows_inner.py +test/test_alert_suppression_windows_api.py +test/test_alert_type.py +test/test_alerts.py +test/test_alerts_api.py +test/test_app_links.py +test/test_app_links_links.py +test/test_base_alert.py +test/test_base_test.py +test/test_complete_alert_suppression_window.py +test/test_create_alert_rule201_response.py +test/test_create_suppression_windows201_response.py +test/test_days_of_week.py +test/test_end_repeat.py +test/test_end_repeat_type.py +test/test_error.py +test/test_expand.py +test/test_get_alert_rule_details200_response.py +test/test_get_alerts200_response.py +test/test_get_alerts_rules200_response.py +test/test_get_suppression_windows200_response.py +test/test_interval_type.py +test/test_link.py +test/test_notification.py +test/test_notification_email.py +test/test_notification_third_party.py +test/test_notification_webhook.py +test/test_pagination_links.py +test/test_pagination_links_links.py +test/test_repeat.py +test/test_repeat_type.py +test/test_rule.py +test/test_rule_detail.py +test/test_rule_detail_update.py +test/test_rule_links.py +test/test_rule_links_links.py +test/test_rules.py +test/test_self_links.py +test/test_self_links_links.py +test/test_severity.py +test/test_state.py +test/test_test_direction.py +test/test_test_interval.py +test/test_third_party_integration_type.py +test/test_unauthorized_error.py +test/test_unexpanded_test.py +test/test_webhook_integration_type.py +tox.ini diff --git a/alerts_api/.openapi-generator/VERSION b/alerts_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/alerts_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/alerts_api/.travis.yml b/alerts_api/.travis.yml new file mode 100644 index 00000000..6dbdd95e --- /dev/null +++ b/alerts_api/.travis.yml @@ -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=alerts_api diff --git a/alerts_api/README.md b/alerts_api/README.md new file mode 100644 index 00000000..e19af28a --- /dev/null +++ b/alerts_api/README.md @@ -0,0 +1,191 @@ +# alerts-api + +## Overview +Manage all alerts, alert rules and alert suppression windows. + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 7.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 3.7+ + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/thousandeyes/thousandeyes-python-sdk.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/thousandeyes/thousandeyes-python-sdk.git`) + +Then import the package: +```python +import alerts_api +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import alerts_api +``` + +### Tests + +Execute `pytest` to run the tests. + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python + +import time +import alerts_api +from alerts_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = alerts_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = alerts_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with alerts_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = alerts_api.AlertRulesApi(api_client) + rule_detail_update = alerts_api.RuleDetailUpdate() # RuleDetailUpdate | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create alert rule + api_response = api_instance.create_alert_rule(rule_detail_update, aid=aid) + print("The response of AlertRulesApi->create_alert_rule:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling AlertRulesApi->create_alert_rule: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AlertRulesApi* | [**create_alert_rule**](docs/AlertRulesApi.md#create_alert_rule) | **POST** /v7/alerts/rules | Create alert rule +*AlertRulesApi* | [**delete_alert_rule**](docs/AlertRulesApi.md#delete_alert_rule) | **DELETE** /v7/alerts/rules/{ruleId} | Delete alert rule +*AlertRulesApi* | [**get_alert_rule_details**](docs/AlertRulesApi.md#get_alert_rule_details) | **GET** /v7/alerts/rules/{ruleId} | Retrieve alert rule +*AlertRulesApi* | [**get_alerts_rules**](docs/AlertRulesApi.md#get_alerts_rules) | **GET** /v7/alerts/rules | List alert rules +*AlertRulesApi* | [**update_alert_rule**](docs/AlertRulesApi.md#update_alert_rule) | **PUT** /v7/alerts/rules/{ruleId} | Update alert rule +*AlertSuppressionWindowsApi* | [**create_suppression_windows**](docs/AlertSuppressionWindowsApi.md#create_suppression_windows) | **POST** /v7/alert-suppression-windows | Create alert suppression window +*AlertSuppressionWindowsApi* | [**delete_suppression_window**](docs/AlertSuppressionWindowsApi.md#delete_suppression_window) | **DELETE** /v7/alert-suppression-windows/{windowId} | Delete alert suppression window +*AlertSuppressionWindowsApi* | [**get_suppression_window_details**](docs/AlertSuppressionWindowsApi.md#get_suppression_window_details) | **GET** /v7/alert-suppression-windows/{windowId} | Retrieve alert suppression window +*AlertSuppressionWindowsApi* | [**get_suppression_windows**](docs/AlertSuppressionWindowsApi.md#get_suppression_windows) | **GET** /v7/alert-suppression-windows | List alert suppression windows +*AlertSuppressionWindowsApi* | [**update_suppression_window**](docs/AlertSuppressionWindowsApi.md#update_suppression_window) | **PUT** /v7/alert-suppression-windows/{windowId} | Update alert suppression window +*AlertsApi* | [**get_alert_details**](docs/AlertsApi.md#get_alert_details) | **GET** /v7/alerts/{alertId} | Retrieve alert details +*AlertsApi* | [**get_alerts**](docs/AlertsApi.md#get_alerts) | **GET** /v7/alerts | List active alerts + + +## Documentation For Models + + - [Alert](docs/Alert.md) + - [AlertDetail](docs/AlertDetail.md) + - [AlertLinks](docs/AlertLinks.md) + - [AlertMetricDetail](docs/AlertMetricDetail.md) + - [AlertMetricDetailEnd](docs/AlertMetricDetailEnd.md) + - [AlertMetricDetailStart](docs/AlertMetricDetailStart.md) + - [AlertMetrics](docs/AlertMetrics.md) + - [AlertRoundsViolationMode](docs/AlertRoundsViolationMode.md) + - [AlertRule](docs/AlertRule.md) + - [AlertSuppressionWindow](docs/AlertSuppressionWindow.md) + - [AlertSuppressionWindowRequest](docs/AlertSuppressionWindowRequest.md) + - [AlertSuppressionWindowState](docs/AlertSuppressionWindowState.md) + - [AlertSuppressionWindows](docs/AlertSuppressionWindows.md) + - [AlertSuppressionWindowsAlertSuppressionWindowsInner](docs/AlertSuppressionWindowsAlertSuppressionWindowsInner.md) + - [AlertType](docs/AlertType.md) + - [Alerts](docs/Alerts.md) + - [AppLinks](docs/AppLinks.md) + - [AppLinksLinks](docs/AppLinksLinks.md) + - [BaseAlert](docs/BaseAlert.md) + - [BaseTest](docs/BaseTest.md) + - [CompleteAlertSuppressionWindow](docs/CompleteAlertSuppressionWindow.md) + - [CreateAlertRule201Response](docs/CreateAlertRule201Response.md) + - [CreateSuppressionWindows201Response](docs/CreateSuppressionWindows201Response.md) + - [DaysOfWeek](docs/DaysOfWeek.md) + - [EndRepeat](docs/EndRepeat.md) + - [EndRepeatType](docs/EndRepeatType.md) + - [Error](docs/Error.md) + - [Expand](docs/Expand.md) + - [GetAlertRuleDetails200Response](docs/GetAlertRuleDetails200Response.md) + - [GetAlerts200Response](docs/GetAlerts200Response.md) + - [GetAlertsRules200Response](docs/GetAlertsRules200Response.md) + - [GetSuppressionWindows200Response](docs/GetSuppressionWindows200Response.md) + - [IntervalType](docs/IntervalType.md) + - [Link](docs/Link.md) + - [Notification](docs/Notification.md) + - [NotificationEmail](docs/NotificationEmail.md) + - [NotificationThirdParty](docs/NotificationThirdParty.md) + - [NotificationWebhook](docs/NotificationWebhook.md) + - [PaginationLinks](docs/PaginationLinks.md) + - [PaginationLinksLinks](docs/PaginationLinksLinks.md) + - [Repeat](docs/Repeat.md) + - [RepeatType](docs/RepeatType.md) + - [Rule](docs/Rule.md) + - [RuleDetail](docs/RuleDetail.md) + - [RuleDetailUpdate](docs/RuleDetailUpdate.md) + - [RuleLinks](docs/RuleLinks.md) + - [RuleLinksLinks](docs/RuleLinksLinks.md) + - [Rules](docs/Rules.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [Severity](docs/Severity.md) + - [State](docs/State.md) + - [TestDirection](docs/TestDirection.md) + - [TestInterval](docs/TestInterval.md) + - [ThirdPartyIntegrationType](docs/ThirdPartyIntegrationType.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + - [UnexpandedTest](docs/UnexpandedTest.md) + - [WebhookIntegrationType](docs/WebhookIntegrationType.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/alerts_api/alerts_api/__init__.py b/alerts_api/alerts_api/__init__.py new file mode 100644 index 00000000..118563fd --- /dev/null +++ b/alerts_api/alerts_api/__init__.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.api.alert_rules_api import AlertRulesApi +from alerts_api.api.alert_suppression_windows_api import AlertSuppressionWindowsApi +from alerts_api.api.alerts_api import AlertsApi + +# import ApiClient +from alerts_api.api_response import ApiResponse +from alerts_api.api_client import ApiClient +from alerts_api.configuration import Configuration +from alerts_api.exceptions import OpenApiException +from alerts_api.exceptions import ApiTypeError +from alerts_api.exceptions import ApiValueError +from alerts_api.exceptions import ApiKeyError +from alerts_api.exceptions import ApiAttributeError +from alerts_api.exceptions import ApiException + +# import models into sdk package +from alerts_api.models.alert import Alert +from alerts_api.models.alert_detail import AlertDetail +from alerts_api.models.alert_links import AlertLinks +from alerts_api.models.alert_metric_detail import AlertMetricDetail +from alerts_api.models.alert_metric_detail_end import AlertMetricDetailEnd +from alerts_api.models.alert_metric_detail_start import AlertMetricDetailStart +from alerts_api.models.alert_metrics import AlertMetrics +from alerts_api.models.alert_rounds_violation_mode import AlertRoundsViolationMode +from alerts_api.models.alert_rule import AlertRule +from alerts_api.models.alert_suppression_window import AlertSuppressionWindow +from alerts_api.models.alert_suppression_window_request import AlertSuppressionWindowRequest +from alerts_api.models.alert_suppression_window_state import AlertSuppressionWindowState +from alerts_api.models.alert_suppression_windows import AlertSuppressionWindows +from alerts_api.models.alert_suppression_windows_alert_suppression_windows_inner import AlertSuppressionWindowsAlertSuppressionWindowsInner +from alerts_api.models.alert_type import AlertType +from alerts_api.models.alerts import Alerts +from alerts_api.models.app_links import AppLinks +from alerts_api.models.app_links_links import AppLinksLinks +from alerts_api.models.base_alert import BaseAlert +from alerts_api.models.base_test import BaseTest +from alerts_api.models.complete_alert_suppression_window import CompleteAlertSuppressionWindow +from alerts_api.models.create_alert_rule201_response import CreateAlertRule201Response +from alerts_api.models.create_suppression_windows201_response import CreateSuppressionWindows201Response +from alerts_api.models.days_of_week import DaysOfWeek +from alerts_api.models.end_repeat import EndRepeat +from alerts_api.models.end_repeat_type import EndRepeatType +from alerts_api.models.error import Error +from alerts_api.models.expand import Expand +from alerts_api.models.get_alert_rule_details200_response import GetAlertRuleDetails200Response +from alerts_api.models.get_alerts200_response import GetAlerts200Response +from alerts_api.models.get_alerts_rules200_response import GetAlertsRules200Response +from alerts_api.models.get_suppression_windows200_response import GetSuppressionWindows200Response +from alerts_api.models.interval_type import IntervalType +from alerts_api.models.link import Link +from alerts_api.models.notification import Notification +from alerts_api.models.notification_email import NotificationEmail +from alerts_api.models.notification_third_party import NotificationThirdParty +from alerts_api.models.notification_webhook import NotificationWebhook +from alerts_api.models.pagination_links import PaginationLinks +from alerts_api.models.pagination_links_links import PaginationLinksLinks +from alerts_api.models.repeat import Repeat +from alerts_api.models.repeat_type import RepeatType +from alerts_api.models.rule import Rule +from alerts_api.models.rule_detail import RuleDetail +from alerts_api.models.rule_detail_update import RuleDetailUpdate +from alerts_api.models.rule_links import RuleLinks +from alerts_api.models.rule_links_links import RuleLinksLinks +from alerts_api.models.rules import Rules +from alerts_api.models.self_links import SelfLinks +from alerts_api.models.self_links_links import SelfLinksLinks +from alerts_api.models.severity import Severity +from alerts_api.models.state import State +from alerts_api.models.test_direction import TestDirection +from alerts_api.models.test_interval import TestInterval +from alerts_api.models.third_party_integration_type import ThirdPartyIntegrationType +from alerts_api.models.unauthorized_error import UnauthorizedError +from alerts_api.models.unexpanded_test import UnexpandedTest +from alerts_api.models.webhook_integration_type import WebhookIntegrationType diff --git a/alerts_api/alerts_api/api/__init__.py b/alerts_api/alerts_api/api/__init__.py new file mode 100644 index 00000000..72f95fe1 --- /dev/null +++ b/alerts_api/alerts_api/api/__init__.py @@ -0,0 +1,7 @@ +# flake8: noqa + +# import apis into api package +from alerts_api.api.alert_rules_api import AlertRulesApi +from alerts_api.api.alert_suppression_windows_api import AlertSuppressionWindowsApi +from alerts_api.api.alerts_api import AlertsApi + diff --git a/alerts_api/alerts_api/api/alert_rules_api.py b/alerts_api/alerts_api/api/alert_rules_api.py new file mode 100644 index 00000000..d875e27d --- /dev/null +++ b/alerts_api/alerts_api/api/alert_rules_api.py @@ -0,0 +1,1541 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.create_alert_rule201_response import CreateAlertRule201Response +from alerts_api.models.get_alert_rule_details200_response import GetAlertRuleDetails200Response +from alerts_api.models.get_alerts_rules200_response import GetAlertsRules200Response +from alerts_api.models.rule_detail_update import RuleDetailUpdate + +from alerts_api.api_client import ApiClient +from alerts_api.api_response import ApiResponse +from alerts_api.rest import RESTResponseType + + +class AlertRulesApi: + """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 create_alert_rule( + self, + rule_detail_update: RuleDetailUpdate, + 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, + ) -> CreateAlertRule201Response: + """Create alert rule + + Creates a new alert rule in your account, using the provided POST data. The `Edit alert rules` permission is required to create an alert rule. Note: Assigning an alert rule to a test during creation requires the `Edit tests` permission. + + :param rule_detail_update: (required) + :type rule_detail_update: RuleDetailUpdate + :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._create_alert_rule_serialize( + rule_detail_update=rule_detail_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAlertRule201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_alert_rule_with_http_info( + self, + rule_detail_update: RuleDetailUpdate, + 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[CreateAlertRule201Response]: + """Create alert rule + + Creates a new alert rule in your account, using the provided POST data. The `Edit alert rules` permission is required to create an alert rule. Note: Assigning an alert rule to a test during creation requires the `Edit tests` permission. + + :param rule_detail_update: (required) + :type rule_detail_update: RuleDetailUpdate + :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._create_alert_rule_serialize( + rule_detail_update=rule_detail_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAlertRule201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_alert_rule_without_preload_content( + self, + rule_detail_update: RuleDetailUpdate, + 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: + """Create alert rule + + Creates a new alert rule in your account, using the provided POST data. The `Edit alert rules` permission is required to create an alert rule. Note: Assigning an alert rule to a test during creation requires the `Edit tests` permission. + + :param rule_detail_update: (required) + :type rule_detail_update: RuleDetailUpdate + :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._create_alert_rule_serialize( + rule_detail_update=rule_detail_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAlertRule201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_alert_rule_serialize( + self, + rule_detail_update, + 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 + if rule_detail_update is not None: + _body_params = rule_detail_update + + + # 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/hal+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/alerts/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 + ) + + + + + @validate_call + def delete_alert_rule( + self, + rule_id: Annotated[StrictStr, Field(description="Unique alert rule ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete alert rule + + Deletes an alert rule from your account. Users must have both `Edit alert rules` and `Edit tests` permissions, especially if the rule is linked to any tests. Without these permissions, an error occurs. + + :param rule_id: Unique alert rule ID. (required) + :type 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._delete_alert_rule_serialize( + rule_id=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]] = { + + } + 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 delete_alert_rule_with_http_info( + self, + rule_id: Annotated[StrictStr, Field(description="Unique alert rule ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete alert rule + + Deletes an alert rule from your account. Users must have both `Edit alert rules` and `Edit tests` permissions, especially if the rule is linked to any tests. Without these permissions, an error occurs. + + :param rule_id: Unique alert rule ID. (required) + :type 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._delete_alert_rule_serialize( + rule_id=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]] = { + + } + 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 delete_alert_rule_without_preload_content( + self, + rule_id: Annotated[StrictStr, Field(description="Unique alert rule ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete alert rule + + Deletes an alert rule from your account. Users must have both `Edit alert rules` and `Edit tests` permissions, especially if the rule is linked to any tests. Without these permissions, an error occurs. + + :param rule_id: Unique alert rule ID. (required) + :type 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._delete_alert_rule_serialize( + rule_id=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]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_alert_rule_serialize( + self, + 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 rule_id is not None: + _path_params['ruleId'] = 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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/alerts/rules/{ruleId}', + 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_alert_rule_details( + self, + rule_id: Annotated[StrictStr, Field(description="Unique alert rule ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetAlertRuleDetails200Response: + """Retrieve alert rule + + Returns detailed information about an alert rule using the `ruleId`. If the `ruleId` doesn’t exist or is inaccessible by your account, an empty response is returned. + + :param rule_id: Unique alert rule ID. (required) + :type 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_alert_rule_details_serialize( + rule_id=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': "GetAlertRuleDetails200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_alert_rule_details_with_http_info( + self, + rule_id: Annotated[StrictStr, Field(description="Unique alert rule ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetAlertRuleDetails200Response]: + """Retrieve alert rule + + Returns detailed information about an alert rule using the `ruleId`. If the `ruleId` doesn’t exist or is inaccessible by your account, an empty response is returned. + + :param rule_id: Unique alert rule ID. (required) + :type 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_alert_rule_details_serialize( + rule_id=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': "GetAlertRuleDetails200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_alert_rule_details_without_preload_content( + self, + rule_id: Annotated[StrictStr, Field(description="Unique alert rule ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve alert rule + + Returns detailed information about an alert rule using the `ruleId`. If the `ruleId` doesn’t exist or is inaccessible by your account, an empty response is returned. + + :param rule_id: Unique alert rule ID. (required) + :type 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_alert_rule_details_serialize( + rule_id=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': "GetAlertRuleDetails200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_alert_rule_details_serialize( + self, + 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 rule_id is not None: + _path_params['ruleId'] = 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/alerts/rules/{ruleId}', + 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_alerts_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, + ) -> GetAlertsRules200Response: + """List alert rules + + Returns a list of alert rules. Default rules for each test type are indicated with a boolean response (true or false); these default alert rules automatically apply to their respective test types. + + :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_alerts_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': "GetAlertsRules200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_alerts_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[GetAlertsRules200Response]: + """List alert rules + + Returns a list of alert rules. Default rules for each test type are indicated with a boolean response (true or false); these default alert rules automatically apply to their respective test types. + + :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_alerts_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': "GetAlertsRules200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_alerts_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 alert rules + + Returns a list of alert rules. Default rules for each test type are indicated with a boolean response (true or false); these default alert rules automatically apply to their respective test types. + + :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_alerts_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': "GetAlertsRules200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_alerts_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/alerts/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 + ) + + + + + @validate_call + def update_alert_rule( + self, + rule_id: Annotated[StrictStr, Field(description="Unique alert rule ID.")], + rule_detail_update: RuleDetailUpdate, + 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, + ) -> CreateAlertRule201Response: + """Update alert rule + + Modifies an existing alert rule in your account, using the provided POST data. The `Edit alert rules` permission is required to modify an alert rule. Note: Assigning an alert rule to a test during creation requires the `Edit tests` permission. + + :param rule_id: Unique alert rule ID. (required) + :type rule_id: str + :param rule_detail_update: (required) + :type rule_detail_update: RuleDetailUpdate + :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._update_alert_rule_serialize( + rule_id=rule_id, + rule_detail_update=rule_detail_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAlertRule201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_alert_rule_with_http_info( + self, + rule_id: Annotated[StrictStr, Field(description="Unique alert rule ID.")], + rule_detail_update: RuleDetailUpdate, + 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[CreateAlertRule201Response]: + """Update alert rule + + Modifies an existing alert rule in your account, using the provided POST data. The `Edit alert rules` permission is required to modify an alert rule. Note: Assigning an alert rule to a test during creation requires the `Edit tests` permission. + + :param rule_id: Unique alert rule ID. (required) + :type rule_id: str + :param rule_detail_update: (required) + :type rule_detail_update: RuleDetailUpdate + :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._update_alert_rule_serialize( + rule_id=rule_id, + rule_detail_update=rule_detail_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAlertRule201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_alert_rule_without_preload_content( + self, + rule_id: Annotated[StrictStr, Field(description="Unique alert rule ID.")], + rule_detail_update: RuleDetailUpdate, + 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: + """Update alert rule + + Modifies an existing alert rule in your account, using the provided POST data. The `Edit alert rules` permission is required to modify an alert rule. Note: Assigning an alert rule to a test during creation requires the `Edit tests` permission. + + :param rule_id: Unique alert rule ID. (required) + :type rule_id: str + :param rule_detail_update: (required) + :type rule_detail_update: RuleDetailUpdate + :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._update_alert_rule_serialize( + rule_id=rule_id, + rule_detail_update=rule_detail_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAlertRule201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_alert_rule_serialize( + self, + rule_id, + rule_detail_update, + 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 rule_id is not None: + _path_params['ruleId'] = 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 + if rule_detail_update is not None: + _body_params = rule_detail_update + + + # 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/hal+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='PUT', + resource_path='/v7/alerts/rules/{ruleId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/alerts_api/alerts_api/api/alert_suppression_windows_api.py b/alerts_api/alerts_api/api/alert_suppression_windows_api.py new file mode 100644 index 00000000..0ef0e1a2 --- /dev/null +++ b/alerts_api/alerts_api/api/alert_suppression_windows_api.py @@ -0,0 +1,1595 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.alert_suppression_window_request import AlertSuppressionWindowRequest +from alerts_api.models.create_suppression_windows201_response import CreateSuppressionWindows201Response +from alerts_api.models.expand import Expand +from alerts_api.models.get_suppression_windows200_response import GetSuppressionWindows200Response + +from alerts_api.api_client import ApiClient +from alerts_api.api_response import ApiResponse +from alerts_api.rest import RESTResponseType + + +class AlertSuppressionWindowsApi: + """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 create_suppression_windows( + self, + alert_suppression_window_request: AlertSuppressionWindowRequest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` 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, + ) -> CreateSuppressionWindows201Response: + """Create alert suppression window + + Creates a new alert suppression window in ThousandEyes, using the provided POST data. Only Account Admins can create alert suppression windows. + + :param alert_suppression_window_request: (required) + :type alert_suppression_window_request: AlertSuppressionWindowRequest + :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 on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. + :type expand: List[Expand] + :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._create_suppression_windows_serialize( + alert_suppression_window_request=alert_suppression_window_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]] = { + '201': "CreateSuppressionWindows201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_suppression_windows_with_http_info( + self, + alert_suppression_window_request: AlertSuppressionWindowRequest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` 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[CreateSuppressionWindows201Response]: + """Create alert suppression window + + Creates a new alert suppression window in ThousandEyes, using the provided POST data. Only Account Admins can create alert suppression windows. + + :param alert_suppression_window_request: (required) + :type alert_suppression_window_request: AlertSuppressionWindowRequest + :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 on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. + :type expand: List[Expand] + :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._create_suppression_windows_serialize( + alert_suppression_window_request=alert_suppression_window_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]] = { + '201': "CreateSuppressionWindows201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_suppression_windows_without_preload_content( + self, + alert_suppression_window_request: AlertSuppressionWindowRequest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` 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: + """Create alert suppression window + + Creates a new alert suppression window in ThousandEyes, using the provided POST data. Only Account Admins can create alert suppression windows. + + :param alert_suppression_window_request: (required) + :type alert_suppression_window_request: AlertSuppressionWindowRequest + :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 on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. + :type expand: List[Expand] + :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._create_suppression_windows_serialize( + alert_suppression_window_request=alert_suppression_window_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]] = { + '201': "CreateSuppressionWindows201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_suppression_windows_serialize( + self, + alert_suppression_window_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 + # 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 alert_suppression_window_request is not None: + _body_params = alert_suppression_window_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/hal+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/alert-suppression-windows', + 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 delete_suppression_window( + self, + window_id: Annotated[StrictStr, Field(description="Unique window ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete alert suppression window + + Deletes an alert suppression window. + + :param window_id: Unique window ID. (required) + :type window_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._delete_suppression_window_serialize( + window_id=window_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_suppression_window_with_http_info( + self, + window_id: Annotated[StrictStr, Field(description="Unique window ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete alert suppression window + + Deletes an alert suppression window. + + :param window_id: Unique window ID. (required) + :type window_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._delete_suppression_window_serialize( + window_id=window_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_suppression_window_without_preload_content( + self, + window_id: Annotated[StrictStr, Field(description="Unique window ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete alert suppression window + + Deletes an alert suppression window. + + :param window_id: Unique window ID. (required) + :type window_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._delete_suppression_window_serialize( + window_id=window_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_suppression_window_serialize( + self, + window_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 window_id is not None: + _path_params['windowId'] = window_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/alert-suppression-windows/{windowId}', + 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_suppression_window_details( + self, + window_id: Annotated[StrictStr, Field(description="Unique window ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` 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, + ) -> CreateSuppressionWindows201Response: + """Retrieve alert suppression window + + Returns detailed information about an alert suppression window configured in your account group. + + :param window_id: Unique window ID. (required) + :type window_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 expand: Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. + :type expand: List[Expand] + :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_suppression_window_details_serialize( + window_id=window_id, + 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': "CreateSuppressionWindows201Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_suppression_window_details_with_http_info( + self, + window_id: Annotated[StrictStr, Field(description="Unique window ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` 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[CreateSuppressionWindows201Response]: + """Retrieve alert suppression window + + Returns detailed information about an alert suppression window configured in your account group. + + :param window_id: Unique window ID. (required) + :type window_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 expand: Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. + :type expand: List[Expand] + :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_suppression_window_details_serialize( + window_id=window_id, + 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': "CreateSuppressionWindows201Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_suppression_window_details_without_preload_content( + self, + window_id: Annotated[StrictStr, Field(description="Unique window ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` 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: + """Retrieve alert suppression window + + Returns detailed information about an alert suppression window configured in your account group. + + :param window_id: Unique window ID. (required) + :type window_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 expand: Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. + :type expand: List[Expand] + :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_suppression_window_details_serialize( + window_id=window_id, + 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': "CreateSuppressionWindows201Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_suppression_window_details_serialize( + self, + window_id, + 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 window_id is not None: + _path_params['windowId'] = window_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 + + + # 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/alert-suppression-windows/{windowId}', + 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_suppression_windows( + 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, + ) -> GetSuppressionWindows200Response: + """List alert suppression windows + + Returns a list of all alert suppression windows configured in your 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_suppression_windows_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': "GetSuppressionWindows200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_suppression_windows_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[GetSuppressionWindows200Response]: + """List alert suppression windows + + Returns a list of all alert suppression windows configured in your 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_suppression_windows_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': "GetSuppressionWindows200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_suppression_windows_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 alert suppression windows + + Returns a list of all alert suppression windows configured in your 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_suppression_windows_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': "GetSuppressionWindows200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_suppression_windows_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/alert-suppression-windows', + 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 update_suppression_window( + self, + window_id: Annotated[StrictStr, Field(description="Unique window ID.")], + alert_suppression_window_request: AlertSuppressionWindowRequest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` 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, + ) -> CreateSuppressionWindows201Response: + """Update alert suppression window + + Updates an alert suppression window in ThousandEyes, using the provided POST data. Only Account Admins can update alert suppression windows. + + :param window_id: Unique window ID. (required) + :type window_id: str + :param alert_suppression_window_request: (required) + :type alert_suppression_window_request: AlertSuppressionWindowRequest + :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 on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. + :type expand: List[Expand] + :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._update_suppression_window_serialize( + window_id=window_id, + alert_suppression_window_request=alert_suppression_window_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': "CreateSuppressionWindows201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_suppression_window_with_http_info( + self, + window_id: Annotated[StrictStr, Field(description="Unique window ID.")], + alert_suppression_window_request: AlertSuppressionWindowRequest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` 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[CreateSuppressionWindows201Response]: + """Update alert suppression window + + Updates an alert suppression window in ThousandEyes, using the provided POST data. Only Account Admins can update alert suppression windows. + + :param window_id: Unique window ID. (required) + :type window_id: str + :param alert_suppression_window_request: (required) + :type alert_suppression_window_request: AlertSuppressionWindowRequest + :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 on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. + :type expand: List[Expand] + :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._update_suppression_window_serialize( + window_id=window_id, + alert_suppression_window_request=alert_suppression_window_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': "CreateSuppressionWindows201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_suppression_window_without_preload_content( + self, + window_id: Annotated[StrictStr, Field(description="Unique window ID.")], + alert_suppression_window_request: AlertSuppressionWindowRequest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` 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: + """Update alert suppression window + + Updates an alert suppression window in ThousandEyes, using the provided POST data. Only Account Admins can update alert suppression windows. + + :param window_id: Unique window ID. (required) + :type window_id: str + :param alert_suppression_window_request: (required) + :type alert_suppression_window_request: AlertSuppressionWindowRequest + :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 on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. + :type expand: List[Expand] + :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._update_suppression_window_serialize( + window_id=window_id, + alert_suppression_window_request=alert_suppression_window_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': "CreateSuppressionWindows201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_suppression_window_serialize( + self, + window_id, + alert_suppression_window_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 window_id is not None: + _path_params['windowId'] = window_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 alert_suppression_window_request is not None: + _body_params = alert_suppression_window_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/hal+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='PUT', + resource_path='/v7/alert-suppression-windows/{windowId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/alerts_api/alerts_api/api/alerts_api.py b/alerts_api/alerts_api/api/alerts_api.py new file mode 100644 index 00000000..232c198f --- /dev/null +++ b/alerts_api/alerts_api/api/alerts_api.py @@ -0,0 +1,730 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 datetime import datetime + +from pydantic import StrictFloat, StrictInt, StrictStr, field_validator + +from typing import Any, Optional, Union + +from alerts_api.models.alert_detail import AlertDetail +from alerts_api.models.get_alerts200_response import GetAlerts200Response + +from alerts_api.api_client import ApiClient +from alerts_api.api_response import ApiResponse +from alerts_api.rest import RESTResponseType + + +class AlertsApi: + """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_alert_details( + self, + alert_id: Annotated[StrictStr, Field(description="Unique alert ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertDetail: + """Retrieve alert details + + Returns detailed information about an alert using its ID. + + :param alert_id: Unique alert ID. (required) + :type alert_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_alert_details_serialize( + alert_id=alert_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': "AlertDetail", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_alert_details_with_http_info( + self, + alert_id: Annotated[StrictStr, Field(description="Unique alert ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertDetail]: + """Retrieve alert details + + Returns detailed information about an alert using its ID. + + :param alert_id: Unique alert ID. (required) + :type alert_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_alert_details_serialize( + alert_id=alert_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': "AlertDetail", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_alert_details_without_preload_content( + self, + alert_id: Annotated[StrictStr, Field(description="Unique alert ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve alert details + + Returns detailed information about an alert using its ID. + + :param alert_id: Unique alert ID. (required) + :type alert_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_alert_details_serialize( + alert_id=alert_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': "AlertDetail", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_alert_details_serialize( + self, + alert_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 alert_id is not None: + _path_params['alertId'] = alert_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/alerts/{alertId}', + 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_alerts( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + state: Annotated[Optional[Any], Field(description="Optional parameter to match a specific alert state. If not specified, it defaults to `trigger`.")] = 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, + ) -> GetAlerts200Response: + """List active alerts + + Returns a list of active alerts. If no alerts are active within the specified time range, an empty response is returned. Note that time filters (`window`, `startDate`, or `endDate`) are only applied to cleared alerts. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param state: Optional parameter to match a specific alert state. If not specified, it defaults to `trigger`. + :type state: State + :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_alerts_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + state=state, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAlerts200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_alerts_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + state: Annotated[Optional[Any], Field(description="Optional parameter to match a specific alert state. If not specified, it defaults to `trigger`.")] = 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[GetAlerts200Response]: + """List active alerts + + Returns a list of active alerts. If no alerts are active within the specified time range, an empty response is returned. Note that time filters (`window`, `startDate`, or `endDate`) are only applied to cleared alerts. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param state: Optional parameter to match a specific alert state. If not specified, it defaults to `trigger`. + :type state: State + :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_alerts_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + state=state, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAlerts200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_alerts_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + state: Annotated[Optional[Any], Field(description="Optional parameter to match a specific alert state. If not specified, it defaults to `trigger`.")] = 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 active alerts + + Returns a list of active alerts. If no alerts are active within the specified time range, an empty response is returned. Note that time filters (`window`, `startDate`, or `endDate`) are only applied to cleared alerts. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param state: Optional parameter to match a specific alert state. If not specified, it defaults to `trigger`. + :type state: State + :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_alerts_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + state=state, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAlerts200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_alerts_serialize( + self, + aid, + window, + start_date, + end_date, + max, + state, + _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)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if max is not None: + + _query_params.append(('max', max)) + + if state is not None: + + _query_params.append(('state', state)) + + # 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/alerts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/alerts_api/alerts_api/api_client.py b/alerts_api/alerts_api/api_client.py new file mode 100644 index 00000000..c3a80ccc --- /dev/null +++ b/alerts_api/alerts_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.configuration import Configuration +from alerts_api.api_response import ApiResponse +import alerts_api.models +from alerts_api import rest +from alerts_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(alerts_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) diff --git a/alerts_api/alerts_api/api_response.py b/alerts_api/alerts_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/alerts_api/alerts_api/api_response.py @@ -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 + } diff --git a/alerts_api/alerts_api/configuration.py b/alerts_api/alerts_api/configuration.py new file mode 100644 index 00000000..3cf2977c --- /dev/null +++ b/alerts_api/alerts_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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("alerts_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 diff --git a/alerts_api/alerts_api/exceptions.py b/alerts_api/alerts_api/exceptions.py new file mode 100644 index 00000000..d38144e7 --- /dev/null +++ b/alerts_api/alerts_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 diff --git a/alerts_api/alerts_api/models/__init__.py b/alerts_api/alerts_api/models/__init__.py new file mode 100644 index 00000000..e569d321 --- /dev/null +++ b/alerts_api/alerts_api/models/__init__.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +# flake8: noqa +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.alert import Alert +from alerts_api.models.alert_detail import AlertDetail +from alerts_api.models.alert_links import AlertLinks +from alerts_api.models.alert_metric_detail import AlertMetricDetail +from alerts_api.models.alert_metric_detail_end import AlertMetricDetailEnd +from alerts_api.models.alert_metric_detail_start import AlertMetricDetailStart +from alerts_api.models.alert_metrics import AlertMetrics +from alerts_api.models.alert_rounds_violation_mode import AlertRoundsViolationMode +from alerts_api.models.alert_rule import AlertRule +from alerts_api.models.alert_suppression_window import AlertSuppressionWindow +from alerts_api.models.alert_suppression_window_request import AlertSuppressionWindowRequest +from alerts_api.models.alert_suppression_window_state import AlertSuppressionWindowState +from alerts_api.models.alert_suppression_windows import AlertSuppressionWindows +from alerts_api.models.alert_suppression_windows_alert_suppression_windows_inner import AlertSuppressionWindowsAlertSuppressionWindowsInner +from alerts_api.models.alert_type import AlertType +from alerts_api.models.alerts import Alerts +from alerts_api.models.app_links import AppLinks +from alerts_api.models.app_links_links import AppLinksLinks +from alerts_api.models.base_alert import BaseAlert +from alerts_api.models.base_test import BaseTest +from alerts_api.models.complete_alert_suppression_window import CompleteAlertSuppressionWindow +from alerts_api.models.create_alert_rule201_response import CreateAlertRule201Response +from alerts_api.models.create_suppression_windows201_response import CreateSuppressionWindows201Response +from alerts_api.models.days_of_week import DaysOfWeek +from alerts_api.models.end_repeat import EndRepeat +from alerts_api.models.end_repeat_type import EndRepeatType +from alerts_api.models.error import Error +from alerts_api.models.expand import Expand +from alerts_api.models.get_alert_rule_details200_response import GetAlertRuleDetails200Response +from alerts_api.models.get_alerts200_response import GetAlerts200Response +from alerts_api.models.get_alerts_rules200_response import GetAlertsRules200Response +from alerts_api.models.get_suppression_windows200_response import GetSuppressionWindows200Response +from alerts_api.models.interval_type import IntervalType +from alerts_api.models.link import Link +from alerts_api.models.notification import Notification +from alerts_api.models.notification_email import NotificationEmail +from alerts_api.models.notification_third_party import NotificationThirdParty +from alerts_api.models.notification_webhook import NotificationWebhook +from alerts_api.models.pagination_links import PaginationLinks +from alerts_api.models.pagination_links_links import PaginationLinksLinks +from alerts_api.models.repeat import Repeat +from alerts_api.models.repeat_type import RepeatType +from alerts_api.models.rule import Rule +from alerts_api.models.rule_detail import RuleDetail +from alerts_api.models.rule_detail_update import RuleDetailUpdate +from alerts_api.models.rule_links import RuleLinks +from alerts_api.models.rule_links_links import RuleLinksLinks +from alerts_api.models.rules import Rules +from alerts_api.models.self_links import SelfLinks +from alerts_api.models.self_links_links import SelfLinksLinks +from alerts_api.models.severity import Severity +from alerts_api.models.state import State +from alerts_api.models.test_direction import TestDirection +from alerts_api.models.test_interval import TestInterval +from alerts_api.models.third_party_integration_type import ThirdPartyIntegrationType +from alerts_api.models.unauthorized_error import UnauthorizedError +from alerts_api.models.unexpanded_test import UnexpandedTest +from alerts_api.models.webhook_integration_type import WebhookIntegrationType diff --git a/alerts_api/alerts_api/models/alert.py b/alerts_api/alerts_api/models/alert.py new file mode 100644 index 00000000..3559c3bc --- /dev/null +++ b/alerts_api/alerts_api/models/alert.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from alerts_api.models.alert_type import AlertType +from alerts_api.models.rule_links_links import RuleLinksLinks +from alerts_api.models.severity import Severity +from alerts_api.models.state import State +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Alert(BaseModel): + """ + Alert + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="A unique ID for each individual alert occurrence.") + alert_type: Optional[AlertType] = Field(default=None, alias="alertType") + start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) for querying alerts.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) for querying alerts.", alias="endDate") + violation_count: Optional[StrictInt] = Field(default=None, description="Number of sources that meet the alert criteria.", alias="violationCount") + duration: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Duration in seconds the alert was active") + links: Optional[RuleLinksLinks] = Field(default=None, alias="_links") + alert_rule_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the rule.", alias="alertRuleId") + alert_state: Optional[State] = Field(default=None, alias="alertState") + alert_severity: Optional[Severity] = Field(default=None, alias="alertSeverity") + __properties: ClassVar[List[str]] = ["id", "alertType", "startDate", "endDate", "violationCount", "duration", "_links", "alertRuleId", "alertState", "alertSeverity"] + + 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 Alert 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "id", + "start_date", + "end_date", + "alert_rule_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 Alert from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "alertType": obj.get("alertType"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "violationCount": obj.get("violationCount"), + "duration": obj.get("duration"), + "_links": RuleLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "alertRuleId": obj.get("alertRuleId"), + "alertState": obj.get("alertState"), + "alertSeverity": obj.get("alertSeverity") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/alert_detail.py b/alerts_api/alerts_api/models/alert_detail.py new file mode 100644 index 00000000..600fdcd8 --- /dev/null +++ b/alerts_api/alerts_api/models/alert_detail.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from alerts_api.models.alert_metric_detail import AlertMetricDetail +from alerts_api.models.alert_type import AlertType +from alerts_api.models.rule_links_links import RuleLinksLinks +from alerts_api.models.severity import Severity +from alerts_api.models.state import State +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AlertDetail(BaseModel): + """ + AlertDetail + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="A unique ID for each individual alert occurrence.") + alert_type: Optional[AlertType] = Field(default=None, alias="alertType") + start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) for querying alerts.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) for querying alerts.", alias="endDate") + violation_count: Optional[StrictInt] = Field(default=None, description="Number of sources that meet the alert criteria.", alias="violationCount") + duration: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Duration in seconds the alert was active") + links: Optional[RuleLinksLinks] = Field(default=None, alias="_links") + state: Optional[State] = None + severity: Optional[Severity] = None + details: Optional[List[AlertMetricDetail]] = None + __properties: ClassVar[List[str]] = ["id", "alertType", "startDate", "endDate", "violationCount", "duration", "_links", "state", "severity", "details"] + + 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 AlertDetail 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={ + "id", + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in details (list) + _items = [] + if self.details: + for _item in self.details: + if _item: + _items.append(_item.to_dict()) + _dict['details'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AlertDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "alertType": obj.get("alertType"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "violationCount": obj.get("violationCount"), + "duration": obj.get("duration"), + "_links": RuleLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "state": obj.get("state"), + "severity": obj.get("severity"), + "details": [AlertMetricDetail.from_dict(_item) for _item in obj.get("details")] if obj.get("details") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/alert_links.py b/alerts_api/alerts_api/models/alert_links.py new file mode 100644 index 00000000..ed1b49bc --- /dev/null +++ b/alerts_api/alerts_api/models/alert_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.rule_links_links import RuleLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AlertLinks(BaseModel): + """ + AlertLinks + """ # noqa: E501 + links: Optional[RuleLinksLinks] = 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 AlertLinks 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 AlertLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": RuleLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/alert_metric_detail.py b/alerts_api/alerts_api/models/alert_metric_detail.py new file mode 100644 index 00000000..2e48c2d2 --- /dev/null +++ b/alerts_api/alerts_api/models/alert_metric_detail.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.alert_metric_detail_end import AlertMetricDetailEnd +from alerts_api.models.alert_metric_detail_start import AlertMetricDetailStart +from alerts_api.models.state import State +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AlertMetricDetail(BaseModel): + """ + AlertMetricDetail + """ # noqa: E501 + end: Optional[AlertMetricDetailEnd] = None + id: Optional[StrictStr] = Field(default=None, description="Unique metric detail id.") + name: Optional[StrictStr] = Field(default=None, description="Geolocation of the alert.") + start: Optional[AlertMetricDetailStart] = None + state: Optional[State] = None + type: Optional[StrictStr] = Field(default=None, description="Type of the alert metric.") + __properties: ClassVar[List[str]] = ["end", "id", "name", "start", "state", "type"] + + 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 AlertMetricDetail 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 end + if self.end: + _dict['end'] = self.end.to_dict() + # override the default output from pydantic by calling `to_dict()` of start + if self.start: + _dict['start'] = self.start.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AlertMetricDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "end": AlertMetricDetailEnd.from_dict(obj.get("end")) if obj.get("end") is not None else None, + "id": obj.get("id"), + "name": obj.get("name"), + "start": AlertMetricDetailStart.from_dict(obj.get("start")) if obj.get("start") is not None else None, + "state": obj.get("state"), + "type": obj.get("type") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/alert_metric_detail_end.py b/alerts_api/alerts_api/models/alert_metric_detail_end.py new file mode 100644 index 00000000..dac7276d --- /dev/null +++ b/alerts_api/alerts_api/models/alert_metric_detail_end.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 AlertMetricDetailEnd(BaseModel): + """ + AlertMetricDetailEnd + """ # noqa: E501 + metrics: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["metrics"] + + 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 AlertMetricDetailEnd 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 AlertMetricDetailEnd from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "metrics": obj.get("metrics") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/alert_metric_detail_start.py b/alerts_api/alerts_api/models/alert_metric_detail_start.py new file mode 100644 index 00000000..22ece30a --- /dev/null +++ b/alerts_api/alerts_api/models/alert_metric_detail_start.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 AlertMetricDetailStart(BaseModel): + """ + AlertMetricDetailStart + """ # noqa: E501 + metrics: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["metrics"] + + 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 AlertMetricDetailStart 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 AlertMetricDetailStart from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "metrics": obj.get("metrics") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/alert_metrics.py b/alerts_api/alerts_api/models/alert_metrics.py new file mode 100644 index 00000000..70f73417 --- /dev/null +++ b/alerts_api/alerts_api/models/alert_metrics.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 AlertMetrics(BaseModel): + """ + AlertMetrics + """ # noqa: E501 + metrics: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["metrics"] + + 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 AlertMetrics 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 AlertMetrics from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "metrics": obj.get("metrics") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/alert_rounds_violation_mode.py b/alerts_api/alerts_api/models/alert_rounds_violation_mode.py new file mode 100644 index 00000000..b829d231 --- /dev/null +++ b/alerts_api/alerts_api/models/alert_rounds_violation_mode.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 AlertRoundsViolationMode(str, Enum): + """ + `exact` requires that the same agent(s) meet the threshold in consecutive rounds; default is `any` + """ + + """ + allowed enum values + """ + EXACT = 'exact' + ANY = 'any' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AlertRoundsViolationMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/alerts_api/alerts_api/models/alert_rule.py b/alerts_api/alerts_api/models/alert_rule.py new file mode 100644 index 00000000..5bce449d --- /dev/null +++ b/alerts_api/alerts_api/models/alert_rule.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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, StrictInt, StrictStr +from pydantic import Field +from alerts_api.models.alert_rounds_violation_mode import AlertRoundsViolationMode +from alerts_api.models.alert_type import AlertType +from alerts_api.models.test_direction import TestDirection +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AlertRule(BaseModel): + """ + AlertRule + """ # noqa: E501 + rule_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the rule", alias="ruleId") + rule_name: Optional[StrictStr] = Field(default=None, description="Name of the alert rule", alias="ruleName") + expression: Optional[StrictStr] = Field(default=None, description="String expression of alert rule") + direction: Optional[TestDirection] = None + is_default: Optional[StrictBool] = Field(default=None, description="Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", alias="isDefault") + alert_type: Optional[AlertType] = Field(default=None, alias="alertType") + minimum_sources: Optional[StrictInt] = Field(default=None, description="The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", alias="minimumSources") + minimum_sources_pct: Optional[StrictInt] = Field(default=None, description="the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", alias="minimumSourcesPct") + rounds_violating_mode: Optional[AlertRoundsViolationMode] = Field(default=None, alias="roundsViolatingMode") + rounds_violating_out_of: Optional[StrictInt] = Field(default=None, description="Specifies the divisor (y value) for the “X of Y times” condition.", alias="roundsViolatingOutOf") + rounds_violating_required: Optional[StrictInt] = Field(default=None, description="Specifies the numerator (x value) for the “X of Y times” condition", alias="roundsViolatingRequired") + __properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "direction", "isDefault", "alertType", "minimumSources", "minimumSourcesPct", "roundsViolatingMode", "roundsViolatingOutOf", "roundsViolatingRequired"] + + 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 AlertRule 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={ + "rule_id", + "rule_name", + "expression", + "is_default", + "minimum_sources", + "minimum_sources_pct", + "rounds_violating_out_of", + "rounds_violating_required", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AlertRule 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"), + "direction": obj.get("direction"), + "isDefault": obj.get("isDefault"), + "alertType": obj.get("alertType"), + "minimumSources": obj.get("minimumSources"), + "minimumSourcesPct": obj.get("minimumSourcesPct"), + "roundsViolatingMode": obj.get("roundsViolatingMode"), + "roundsViolatingOutOf": obj.get("roundsViolatingOutOf"), + "roundsViolatingRequired": obj.get("roundsViolatingRequired") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/alert_suppression_window.py b/alerts_api/alerts_api/models/alert_suppression_window.py new file mode 100644 index 00000000..970f8dc9 --- /dev/null +++ b/alerts_api/alerts_api/models/alert_suppression_window.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.alert_suppression_window_state import AlertSuppressionWindowState +from alerts_api.models.end_repeat import EndRepeat +from alerts_api.models.repeat import Repeat +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AlertSuppressionWindow(BaseModel): + """ + AlertSuppressionWindow + """ # noqa: E501 + alert_suppression_window_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the alert suppression window.", alias="alertSuppressionWindowId") + name: Optional[StrictStr] = Field(default=None, description="Name of the alert suppression window.") + is_enabled: Optional[StrictBool] = Field(default=None, description="Set to `false` for `disabled`, `true` for `enabled`.", alias="isEnabled") + status: Optional[AlertSuppressionWindowState] = None + start_date: Optional[datetime] = Field(default=None, description="The date/time when the alert suppression window starts (ISO date-time format).", alias="startDate") + duration: Optional[StrictInt] = Field(default=None, description="Duration in seconds the suppression window is active.") + repeat: Optional[Repeat] = None + end_repeat: Optional[EndRepeat] = Field(default=None, alias="endRepeat") + __properties: ClassVar[List[str]] = ["alertSuppressionWindowId", "name", "isEnabled", "status", "startDate", "duration", "repeat", "endRepeat"] + + 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 AlertSuppressionWindow 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={ + "alert_suppression_window_id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of repeat + if self.repeat: + _dict['repeat'] = self.repeat.to_dict() + # override the default output from pydantic by calling `to_dict()` of end_repeat + if self.end_repeat: + _dict['endRepeat'] = self.end_repeat.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AlertSuppressionWindow from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alertSuppressionWindowId": obj.get("alertSuppressionWindowId"), + "name": obj.get("name"), + "isEnabled": obj.get("isEnabled"), + "status": obj.get("status"), + "startDate": obj.get("startDate"), + "duration": obj.get("duration"), + "repeat": Repeat.from_dict(obj.get("repeat")) if obj.get("repeat") is not None else None, + "endRepeat": EndRepeat.from_dict(obj.get("endRepeat")) if obj.get("endRepeat") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/alert_suppression_window_request.py b/alerts_api/alerts_api/models/alert_suppression_window_request.py new file mode 100644 index 00000000..46074214 --- /dev/null +++ b/alerts_api/alerts_api/models/alert_suppression_window_request.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.alert_suppression_window_state import AlertSuppressionWindowState +from alerts_api.models.end_repeat import EndRepeat +from alerts_api.models.repeat import Repeat +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AlertSuppressionWindowRequest(BaseModel): + """ + AlertSuppressionWindowRequest + """ # noqa: E501 + alert_suppression_window_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the alert suppression window.", alias="alertSuppressionWindowId") + name: Optional[StrictStr] = Field(default=None, description="Name of the alert suppression window.") + is_enabled: Optional[StrictBool] = Field(default=None, description="Set to `false` for `disabled`, `true` for `enabled`.", alias="isEnabled") + status: Optional[AlertSuppressionWindowState] = None + start_date: Optional[datetime] = Field(default=None, description="The date/time when the alert suppression window starts (ISO date-time format).", alias="startDate") + duration: Optional[StrictInt] = Field(default=None, description="Duration in seconds the suppression window is active.") + repeat: Optional[Repeat] = None + end_repeat: Optional[EndRepeat] = Field(default=None, alias="endRepeat") + tests: Optional[List[StrictStr]] = Field(default=None, description="List of tests to assign to the alert suppression window.") + __properties: ClassVar[List[str]] = ["alertSuppressionWindowId", "name", "isEnabled", "status", "startDate", "duration", "repeat", "endRepeat", "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 AlertSuppressionWindowRequest 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={ + "alert_suppression_window_id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of repeat + if self.repeat: + _dict['repeat'] = self.repeat.to_dict() + # override the default output from pydantic by calling `to_dict()` of end_repeat + if self.end_repeat: + _dict['endRepeat'] = self.end_repeat.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AlertSuppressionWindowRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alertSuppressionWindowId": obj.get("alertSuppressionWindowId"), + "name": obj.get("name"), + "isEnabled": obj.get("isEnabled"), + "status": obj.get("status"), + "startDate": obj.get("startDate"), + "duration": obj.get("duration"), + "repeat": Repeat.from_dict(obj.get("repeat")) if obj.get("repeat") is not None else None, + "endRepeat": EndRepeat.from_dict(obj.get("endRepeat")) if obj.get("endRepeat") is not None else None, + "tests": obj.get("tests") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/alert_suppression_window_state.py b/alerts_api/alerts_api/models/alert_suppression_window_state.py new file mode 100644 index 00000000..927b05d4 --- /dev/null +++ b/alerts_api/alerts_api/models/alert_suppression_window_state.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 AlertSuppressionWindowState(str, Enum): + """ + Indicates the current status of the suppression window. + """ + + """ + allowed enum values + """ + ACTIVE = 'active' + INACTIVE = 'inactive' + ENDED = 'ended' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AlertSuppressionWindowState from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/alerts_api/alerts_api/models/alert_suppression_windows.py b/alerts_api/alerts_api/models/alert_suppression_windows.py new file mode 100644 index 00000000..6403d614 --- /dev/null +++ b/alerts_api/alerts_api/models/alert_suppression_windows.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.alert_suppression_windows_alert_suppression_windows_inner import AlertSuppressionWindowsAlertSuppressionWindowsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AlertSuppressionWindows(BaseModel): + """ + Alert suppression windows. + """ # noqa: E501 + alert_suppression_windows: Optional[List[AlertSuppressionWindowsAlertSuppressionWindowsInner]] = Field(default=None, alias="alertSuppressionWindows") + __properties: ClassVar[List[str]] = ["alertSuppressionWindows"] + + 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 AlertSuppressionWindows 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 alert_suppression_windows (list) + _items = [] + if self.alert_suppression_windows: + for _item in self.alert_suppression_windows: + if _item: + _items.append(_item.to_dict()) + _dict['alertSuppressionWindows'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AlertSuppressionWindows from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alertSuppressionWindows": [AlertSuppressionWindowsAlertSuppressionWindowsInner.from_dict(_item) for _item in obj.get("alertSuppressionWindows")] if obj.get("alertSuppressionWindows") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/alert_suppression_windows_alert_suppression_windows_inner.py b/alerts_api/alerts_api/models/alert_suppression_windows_alert_suppression_windows_inner.py new file mode 100644 index 00000000..2e8bde06 --- /dev/null +++ b/alerts_api/alerts_api/models/alert_suppression_windows_alert_suppression_windows_inner.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.alert_suppression_window_state import AlertSuppressionWindowState +from alerts_api.models.end_repeat import EndRepeat +from alerts_api.models.repeat import Repeat +from alerts_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AlertSuppressionWindowsAlertSuppressionWindowsInner(BaseModel): + """ + AlertSuppressionWindowsAlertSuppressionWindowsInner + """ # noqa: E501 + alert_suppression_window_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the alert suppression window.", alias="alertSuppressionWindowId") + name: Optional[StrictStr] = Field(default=None, description="Name of the alert suppression window.") + is_enabled: Optional[StrictBool] = Field(default=None, description="Set to `false` for `disabled`, `true` for `enabled`.", alias="isEnabled") + status: Optional[AlertSuppressionWindowState] = None + start_date: Optional[datetime] = Field(default=None, description="The date/time when the alert suppression window starts (ISO date-time format).", alias="startDate") + duration: Optional[StrictInt] = Field(default=None, description="Duration in seconds the suppression window is active.") + repeat: Optional[Repeat] = None + end_repeat: Optional[EndRepeat] = Field(default=None, alias="endRepeat") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["alertSuppressionWindowId", "name", "isEnabled", "status", "startDate", "duration", "repeat", "endRepeat", "_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 AlertSuppressionWindowsAlertSuppressionWindowsInner 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={ + "alert_suppression_window_id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of repeat + if self.repeat: + _dict['repeat'] = self.repeat.to_dict() + # override the default output from pydantic by calling `to_dict()` of end_repeat + if self.end_repeat: + _dict['endRepeat'] = self.end_repeat.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 AlertSuppressionWindowsAlertSuppressionWindowsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alertSuppressionWindowId": obj.get("alertSuppressionWindowId"), + "name": obj.get("name"), + "isEnabled": obj.get("isEnabled"), + "status": obj.get("status"), + "startDate": obj.get("startDate"), + "duration": obj.get("duration"), + "repeat": Repeat.from_dict(obj.get("repeat")) if obj.get("repeat") is not None else None, + "endRepeat": EndRepeat.from_dict(obj.get("endRepeat")) if obj.get("endRepeat") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/alert_type.py b/alerts_api/alerts_api/models/alert_type.py new file mode 100644 index 00000000..0d66afec --- /dev/null +++ b/alerts_api/alerts_api/models/alert_type.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 AlertType(str, Enum): + """ + Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.thousandeyes.com/v7/alerts/#/alert-details) documentation for a list of possible values + """ + + """ + allowed enum values + """ + PAGE_MINUS_LOAD = 'page-load' + HTTP_MINUS_SERVER = 'http-server' + END_MINUS_TO_MINUS_END_MINUS_SERVER = 'end-to-end-server' + END_MINUS_TO_MINUS_END_MINUS_AGENT = 'end-to-end-agent' + VOICE = 'voice' + DNS_MINUS_SERVER = 'dns-server' + DNS_MINUS_TRACE = 'dns-trace' + DNSSEC = 'dnssec' + BGP = 'bgp' + PATH_MINUS_TRACE = 'path-trace' + FTP = 'ftp' + SIP_MINUS_SERVER = 'sip-server' + TRANSACTIONS = 'transactions' + WEB_MINUS_TRANSACTIONS = 'web-transactions' + AGENT = 'agent' + NETWORK_MINUS_OUTAGE = 'network-outage' + APPLICATION_MINUS_OUTAGE = 'application-outage' + DEVICE_MINUS_DEVICE = 'device-device' + DEVICE_MINUS_INTERFACE = 'device-interface' + ENDPOINT_MINUS_NETWORK_MINUS_SERVER = 'endpoint-network-server' + ENDPOINT_MINUS_HTTP_MINUS_SERVER = 'endpoint-http-server' + ENDPOINT_MINUS_PATH_MINUS_TRACE = 'endpoint-path-trace' + ENDPOINT_MINUS_BROWSER_MINUS_SESSIONS_MINUS_AGENT = 'endpoint-browser-sessions-agent' + ENDPOINT_MINUS_BROWSER_MINUS_SESSIONS_MINUS_APPLICATION = 'endpoint-browser-sessions-application' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AlertType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/alerts_api/alerts_api/models/alerts.py b/alerts_api/alerts_api/models/alerts.py new file mode 100644 index 00000000..db87b127 --- /dev/null +++ b/alerts_api/alerts_api/models/alerts.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.alert import Alert +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Alerts(BaseModel): + """ + Alerts + """ # noqa: E501 + alerts: Optional[List[Alert]] = None + __properties: ClassVar[List[str]] = ["alerts"] + + 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 Alerts 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 alerts (list) + _items = [] + if self.alerts: + for _item in self.alerts: + if _item: + _items.append(_item.to_dict()) + _dict['alerts'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Alerts from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alerts": [Alert.from_dict(_item) for _item in obj.get("alerts")] if obj.get("alerts") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/app_links.py b/alerts_api/alerts_api/models/app_links.py new file mode 100644 index 00000000..46e0b13e --- /dev/null +++ b/alerts_api/alerts_api/models/app_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.app_links_links import AppLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AppLinks(BaseModel): + """ + AppLinks + """ # noqa: E501 + links: Optional[AppLinksLinks] = 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 AppLinks 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 AppLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": AppLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/app_links_links.py b/alerts_api/alerts_api/models/app_links_links.py new file mode 100644 index 00000000..40ad5bc5 --- /dev/null +++ b/alerts_api/alerts_api/models/app_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AppLinksLinks(BaseModel): + """ + A links object containing the ThousandEyes App link + """ # noqa: E501 + app_link: Optional[Link] = Field(default=None, alias="appLink") + __properties: ClassVar[List[str]] = ["appLink"] + + 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 AppLinksLinks 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 app_link + if self.app_link: + _dict['appLink'] = self.app_link.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AppLinksLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "appLink": Link.from_dict(obj.get("appLink")) if obj.get("appLink") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/base_alert.py b/alerts_api/alerts_api/models/base_alert.py new file mode 100644 index 00000000..03ec2c97 --- /dev/null +++ b/alerts_api/alerts_api/models/base_alert.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from alerts_api.models.alert_type import AlertType +from alerts_api.models.rule_links_links import RuleLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class BaseAlert(BaseModel): + """ + BaseAlert + """ # noqa: E501 + links: Optional[RuleLinksLinks] = Field(default=None, alias="_links") + id: Optional[StrictStr] = Field(default=None, description="A unique ID for each individual alert occurrence.") + alert_type: Optional[AlertType] = Field(default=None, alias="alertType") + start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) for querying alerts.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) for querying alerts.", alias="endDate") + violation_count: Optional[StrictInt] = Field(default=None, description="Number of sources that meet the alert criteria.", alias="violationCount") + duration: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Duration in seconds the alert was active") + __properties: ClassVar[List[str]] = ["_links", "id", "alertType", "startDate", "endDate", "violationCount", "duration"] + + 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 BaseAlert 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={ + "id", + "start_date", + "end_date", + }, + 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 BaseAlert from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": RuleLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "id": obj.get("id"), + "alertType": obj.get("alertType"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "violationCount": obj.get("violationCount"), + "duration": obj.get("duration") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/base_test.py b/alerts_api/alerts_api/models/base_test.py new file mode 100644 index 00000000..06cd7a43 --- /dev/null +++ b/alerts_api/alerts_api/models/base_test.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.alert_rule import AlertRule +from alerts_api.models.test_interval import TestInterval +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class BaseTest(BaseModel): + """ + BaseTest + """ # 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules"] + + 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 BaseTest 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 alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of BaseTest 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/complete_alert_suppression_window.py b/alerts_api/alerts_api/models/complete_alert_suppression_window.py new file mode 100644 index 00000000..d8f43cbd --- /dev/null +++ b/alerts_api/alerts_api/models/complete_alert_suppression_window.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.alert_suppression_window_state import AlertSuppressionWindowState +from alerts_api.models.base_test import BaseTest +from alerts_api.models.end_repeat import EndRepeat +from alerts_api.models.repeat import Repeat +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class CompleteAlertSuppressionWindow(BaseModel): + """ + CompleteAlertSuppressionWindow + """ # noqa: E501 + alert_suppression_window_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the alert suppression window.", alias="alertSuppressionWindowId") + name: Optional[StrictStr] = Field(default=None, description="Name of the alert suppression window.") + is_enabled: Optional[StrictBool] = Field(default=None, description="Set to `false` for `disabled`, `true` for `enabled`.", alias="isEnabled") + status: Optional[AlertSuppressionWindowState] = None + start_date: Optional[datetime] = Field(default=None, description="The date/time when the alert suppression window starts (ISO date-time format).", alias="startDate") + duration: Optional[StrictInt] = Field(default=None, description="Duration in seconds the suppression window is active.") + repeat: Optional[Repeat] = None + end_repeat: Optional[EndRepeat] = Field(default=None, alias="endRepeat") + tests: Optional[List[BaseTest]] = Field(default=None, description="List of tests assigned to the alert suppression window.") + __properties: ClassVar[List[str]] = ["alertSuppressionWindowId", "name", "isEnabled", "status", "startDate", "duration", "repeat", "endRepeat", "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 CompleteAlertSuppressionWindow 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={ + "alert_suppression_window_id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of repeat + if self.repeat: + _dict['repeat'] = self.repeat.to_dict() + # override the default output from pydantic by calling `to_dict()` of end_repeat + if self.end_repeat: + _dict['endRepeat'] = self.end_repeat.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of CompleteAlertSuppressionWindow from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alertSuppressionWindowId": obj.get("alertSuppressionWindowId"), + "name": obj.get("name"), + "isEnabled": obj.get("isEnabled"), + "status": obj.get("status"), + "startDate": obj.get("startDate"), + "duration": obj.get("duration"), + "repeat": Repeat.from_dict(obj.get("repeat")) if obj.get("repeat") is not None else None, + "endRepeat": EndRepeat.from_dict(obj.get("endRepeat")) if obj.get("endRepeat") is not None else None, + "tests": [BaseTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/create_alert_rule201_response.py b/alerts_api/alerts_api/models/create_alert_rule201_response.py new file mode 100644 index 00000000..7124ef0c --- /dev/null +++ b/alerts_api/alerts_api/models/create_alert_rule201_response.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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, StrictInt, StrictStr +from pydantic import Field +from alerts_api.models.alert_rounds_violation_mode import AlertRoundsViolationMode +from alerts_api.models.alert_type import AlertType +from alerts_api.models.notification import Notification +from alerts_api.models.self_links_links import SelfLinksLinks +from alerts_api.models.severity import Severity +from alerts_api.models.test_direction import TestDirection +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class CreateAlertRule201Response(BaseModel): + """ + CreateAlertRule201Response + """ # noqa: E501 + rule_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the rule.", alias="ruleId") + rule_name: StrictStr = Field(description="Name of the alert rule.", alias="ruleName") + expression: StrictStr = Field(description="The expression of the alert rule.") + direction: Optional[TestDirection] = None + notify_on_clear: Optional[StrictBool] = Field(default=None, description="Send notification when alert clears.", alias="notifyOnClear") + is_default: Optional[StrictBool] = Field(default=None, description="If set to `true`, this alert rule becomes the default for its test type and is automatically applied to newly created tests with relevant metrics. Only one default alert rule is allowed per test type.", alias="isDefault") + alert_type: AlertType = Field(alias="alertType") + minimum_sources: Optional[StrictInt] = Field(default=None, description="The minimum number of agents or monitors that must meet the specified criteria to trigger the alert.", alias="minimumSources") + minimum_sources_pct: Optional[StrictInt] = Field(default=None, description="The minimum percentage of all assigned agents or monitors that must meet the specified criteria to trigger the alert.", alias="minimumSourcesPct") + rounds_violating_mode: Optional[AlertRoundsViolationMode] = Field(default=None, alias="roundsViolatingMode") + rounds_violating_out_of: StrictInt = Field(description="Specifies the divisor (y value) in the “X of Y times” condition.", alias="roundsViolatingOutOf") + rounds_violating_required: StrictInt = Field(description="Specifies the numerator (x value) in the “X of Y times” condition.", alias="roundsViolatingRequired") + include_covered_prefixes: Optional[StrictBool] = Field(default=None, description="Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules.", alias="includeCoveredPrefixes") + severity: Optional[Severity] = None + notifications: Optional[Notification] = None + test_ids: Optional[List[StrictStr]] = Field(default=None, description="Array of test IDs to link to alert rule (get `testId` from `/tests` endpoint).", alias="testIds") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "direction", "notifyOnClear", "isDefault", "alertType", "minimumSources", "minimumSourcesPct", "roundsViolatingMode", "roundsViolatingOutOf", "roundsViolatingRequired", "includeCoveredPrefixes", "severity", "notifications", "testIds", "_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 CreateAlertRule201Response 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 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 CreateAlertRule201Response 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"), + "direction": obj.get("direction"), + "notifyOnClear": obj.get("notifyOnClear"), + "isDefault": obj.get("isDefault"), + "alertType": obj.get("alertType"), + "minimumSources": obj.get("minimumSources"), + "minimumSourcesPct": obj.get("minimumSourcesPct"), + "roundsViolatingMode": obj.get("roundsViolatingMode"), + "roundsViolatingOutOf": obj.get("roundsViolatingOutOf"), + "roundsViolatingRequired": obj.get("roundsViolatingRequired"), + "includeCoveredPrefixes": obj.get("includeCoveredPrefixes"), + "severity": obj.get("severity"), + "notifications": Notification.from_dict(obj.get("notifications")) if obj.get("notifications") is not None else None, + "testIds": obj.get("testIds"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/create_suppression_windows201_response.py b/alerts_api/alerts_api/models/create_suppression_windows201_response.py new file mode 100644 index 00000000..f3bed4b9 --- /dev/null +++ b/alerts_api/alerts_api/models/create_suppression_windows201_response.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.alert_suppression_window_state import AlertSuppressionWindowState +from alerts_api.models.base_test import BaseTest +from alerts_api.models.end_repeat import EndRepeat +from alerts_api.models.repeat import Repeat +from alerts_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class CreateSuppressionWindows201Response(BaseModel): + """ + CreateSuppressionWindows201Response + """ # noqa: E501 + alert_suppression_window_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the alert suppression window.", alias="alertSuppressionWindowId") + name: Optional[StrictStr] = Field(default=None, description="Name of the alert suppression window.") + is_enabled: Optional[StrictBool] = Field(default=None, description="Set to `false` for `disabled`, `true` for `enabled`.", alias="isEnabled") + status: Optional[AlertSuppressionWindowState] = None + start_date: Optional[datetime] = Field(default=None, description="The date/time when the alert suppression window starts (ISO date-time format).", alias="startDate") + duration: Optional[StrictInt] = Field(default=None, description="Duration in seconds the suppression window is active.") + repeat: Optional[Repeat] = None + end_repeat: Optional[EndRepeat] = Field(default=None, alias="endRepeat") + tests: Optional[List[BaseTest]] = Field(default=None, description="List of tests assigned to the alert suppression window.") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["alertSuppressionWindowId", "name", "isEnabled", "status", "startDate", "duration", "repeat", "endRepeat", "tests", "_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 CreateSuppressionWindows201Response 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={ + "alert_suppression_window_id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of repeat + if self.repeat: + _dict['repeat'] = self.repeat.to_dict() + # override the default output from pydantic by calling `to_dict()` of end_repeat + if self.end_repeat: + _dict['endRepeat'] = self.end_repeat.to_dict() + # 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of CreateSuppressionWindows201Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alertSuppressionWindowId": obj.get("alertSuppressionWindowId"), + "name": obj.get("name"), + "isEnabled": obj.get("isEnabled"), + "status": obj.get("status"), + "startDate": obj.get("startDate"), + "duration": obj.get("duration"), + "repeat": Repeat.from_dict(obj.get("repeat")) if obj.get("repeat") is not None else None, + "endRepeat": EndRepeat.from_dict(obj.get("endRepeat")) if obj.get("endRepeat") is not None else None, + "tests": [BaseTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/days_of_week.py b/alerts_api/alerts_api/models/days_of_week.py new file mode 100644 index 00000000..9ff17da6 --- /dev/null +++ b/alerts_api/alerts_api/models/days_of_week.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 DaysOfWeek(str, Enum): + """ + Specifies the day to activate the alert suppression window. Applicable only when `intervalType` is set to `week`. + """ + + """ + allowed enum values + """ + SUN = 'sun' + MON = 'mon' + TUE = 'tue' + WED = 'wed' + THU = 'thu' + FRI = 'fri' + SAT = 'sat' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DaysOfWeek from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/alerts_api/alerts_api/models/end_repeat.py b/alerts_api/alerts_api/models/end_repeat.py new file mode 100644 index 00000000..dd37ad99 --- /dev/null +++ b/alerts_api/alerts_api/models/end_repeat.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 date +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictInt +from pydantic import Field +from alerts_api.models.end_repeat_type import EndRepeatType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndRepeat(BaseModel): + """ + End repeat options. + """ # noqa: E501 + type: Optional[EndRepeatType] = None + count: Optional[StrictInt] = Field(default=None, description="End repeat after number of occurrences, only valid with count type option.") + var_date: Optional[date] = Field(default=None, description="End repeat after specific date, only valid with date type option (ISO date format).", alias="date") + __properties: ClassVar[List[str]] = ["type", "count", "date"] + + 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 EndRepeat 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 EndRepeat 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"), + "count": obj.get("count"), + "date": obj.get("date") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/end_repeat_type.py b/alerts_api/alerts_api/models/end_repeat_type.py new file mode 100644 index 00000000..137fa5e3 --- /dev/null +++ b/alerts_api/alerts_api/models/end_repeat_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 EndRepeatType(str, Enum): + """ + End repeat options type. + """ + + """ + allowed enum values + """ + COUNT = 'count' + NEVER = 'never' + DATE = 'date' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndRepeatType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/alerts_api/alerts_api/models/error.py b/alerts_api/alerts_api/models/error.py new file mode 100644 index 00000000..a5ad162f --- /dev/null +++ b/alerts_api/alerts_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 + + diff --git a/alerts_api/alerts_api/models/expand.py b/alerts_api/alerts_api/models/expand.py new file mode 100644 index 00000000..a7aaee94 --- /dev/null +++ b/alerts_api/alerts_api/models/expand.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 Expand(str, Enum): + """ + Expand + """ + + """ + allowed enum values + """ + TEST = 'test' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Expand from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/alerts_api/alerts_api/models/get_alert_rule_details200_response.py b/alerts_api/alerts_api/models/get_alert_rule_details200_response.py new file mode 100644 index 00000000..25ef573d --- /dev/null +++ b/alerts_api/alerts_api/models/get_alert_rule_details200_response.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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, StrictInt, StrictStr +from pydantic import Field +from alerts_api.models.alert_rounds_violation_mode import AlertRoundsViolationMode +from alerts_api.models.alert_type import AlertType +from alerts_api.models.base_test import BaseTest +from alerts_api.models.notification import Notification +from alerts_api.models.self_links_links import SelfLinksLinks +from alerts_api.models.severity import Severity +from alerts_api.models.test_direction import TestDirection +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetAlertRuleDetails200Response(BaseModel): + """ + GetAlertRuleDetails200Response + """ # noqa: E501 + rule_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the rule.", alias="ruleId") + rule_name: StrictStr = Field(description="Name of the alert rule.", alias="ruleName") + expression: StrictStr = Field(description="The expression of the alert rule.") + direction: Optional[TestDirection] = None + notify_on_clear: Optional[StrictBool] = Field(default=None, description="Send notification when alert clears.", alias="notifyOnClear") + is_default: Optional[StrictBool] = Field(default=None, description="If set to `true`, this alert rule becomes the default for its test type and is automatically applied to newly created tests with relevant metrics. Only one default alert rule is allowed per test type.", alias="isDefault") + alert_type: AlertType = Field(alias="alertType") + minimum_sources: Optional[StrictInt] = Field(default=None, description="The minimum number of agents or monitors that must meet the specified criteria to trigger the alert.", alias="minimumSources") + minimum_sources_pct: Optional[StrictInt] = Field(default=None, description="The minimum percentage of all assigned agents or monitors that must meet the specified criteria to trigger the alert.", alias="minimumSourcesPct") + rounds_violating_mode: Optional[AlertRoundsViolationMode] = Field(default=None, alias="roundsViolatingMode") + rounds_violating_out_of: StrictInt = Field(description="Specifies the divisor (y value) in the “X of Y times” condition.", alias="roundsViolatingOutOf") + rounds_violating_required: StrictInt = Field(description="Specifies the numerator (x value) in the “X of Y times” condition.", alias="roundsViolatingRequired") + include_covered_prefixes: Optional[StrictBool] = Field(default=None, description="Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules.", alias="includeCoveredPrefixes") + severity: Optional[Severity] = None + notifications: Optional[Notification] = None + tests: Optional[List[BaseTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "direction", "notifyOnClear", "isDefault", "alertType", "minimumSources", "minimumSourcesPct", "roundsViolatingMode", "roundsViolatingOutOf", "roundsViolatingRequired", "includeCoveredPrefixes", "severity", "notifications", "tests", "_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 GetAlertRuleDetails200Response 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={ + "rule_id", + "tests", + }, + exclude_none=True, + ) + # 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetAlertRuleDetails200Response 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"), + "direction": obj.get("direction"), + "notifyOnClear": obj.get("notifyOnClear"), + "isDefault": obj.get("isDefault"), + "alertType": obj.get("alertType"), + "minimumSources": obj.get("minimumSources"), + "minimumSourcesPct": obj.get("minimumSourcesPct"), + "roundsViolatingMode": obj.get("roundsViolatingMode"), + "roundsViolatingOutOf": obj.get("roundsViolatingOutOf"), + "roundsViolatingRequired": obj.get("roundsViolatingRequired"), + "includeCoveredPrefixes": obj.get("includeCoveredPrefixes"), + "severity": obj.get("severity"), + "notifications": Notification.from_dict(obj.get("notifications")) if obj.get("notifications") is not None else None, + "tests": [BaseTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/get_alerts200_response.py b/alerts_api/alerts_api/models/get_alerts200_response.py new file mode 100644 index 00000000..8d40f84a --- /dev/null +++ b/alerts_api/alerts_api/models/get_alerts200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.alert import Alert +from alerts_api.models.pagination_links_links import PaginationLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetAlerts200Response(BaseModel): + """ + GetAlerts200Response + """ # noqa: E501 + alerts: Optional[List[Alert]] = None + links: Optional[PaginationLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["alerts", "_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 GetAlerts200Response 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 alerts (list) + _items = [] + if self.alerts: + for _item in self.alerts: + if _item: + _items.append(_item.to_dict()) + _dict['alerts'] = _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 GetAlerts200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alerts": [Alert.from_dict(_item) for _item in obj.get("alerts")] if obj.get("alerts") is not None else None, + "_links": PaginationLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/get_alerts_rules200_response.py b/alerts_api/alerts_api/models/get_alerts_rules200_response.py new file mode 100644 index 00000000..941e4344 --- /dev/null +++ b/alerts_api/alerts_api/models/get_alerts_rules200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.rule import Rule +from alerts_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetAlertsRules200Response(BaseModel): + """ + GetAlertsRules200Response + """ # noqa: E501 + alert_rules: Optional[List[Rule]] = Field(default=None, alias="alertRules") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["alertRules", "_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 GetAlertsRules200Response 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 alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _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 GetAlertsRules200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alertRules": [Rule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/get_suppression_windows200_response.py b/alerts_api/alerts_api/models/get_suppression_windows200_response.py new file mode 100644 index 00000000..8eb986a7 --- /dev/null +++ b/alerts_api/alerts_api/models/get_suppression_windows200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.alert_suppression_windows_alert_suppression_windows_inner import AlertSuppressionWindowsAlertSuppressionWindowsInner +from alerts_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetSuppressionWindows200Response(BaseModel): + """ + GetSuppressionWindows200Response + """ # noqa: E501 + alert_suppression_windows: Optional[List[AlertSuppressionWindowsAlertSuppressionWindowsInner]] = Field(default=None, alias="alertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["alertSuppressionWindows", "_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 GetSuppressionWindows200Response 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 alert_suppression_windows (list) + _items = [] + if self.alert_suppression_windows: + for _item in self.alert_suppression_windows: + if _item: + _items.append(_item.to_dict()) + _dict['alertSuppressionWindows'] = _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 GetSuppressionWindows200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alertSuppressionWindows": [AlertSuppressionWindowsAlertSuppressionWindowsInner.from_dict(_item) for _item in obj.get("alertSuppressionWindows")] if obj.get("alertSuppressionWindows") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/interval_type.py b/alerts_api/alerts_api/models/interval_type.py new file mode 100644 index 00000000..60201230 --- /dev/null +++ b/alerts_api/alerts_api/models/interval_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 IntervalType(str, Enum): + """ + Repeat options interval type + """ + + """ + allowed enum values + """ + DAY = 'day' + WEEK = 'week' + MONTH = 'month' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of IntervalType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/alerts_api/alerts_api/models/link.py b/alerts_api/alerts_api/models/link.py new file mode 100644 index 00000000..5542fabc --- /dev/null +++ b/alerts_api/alerts_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 + + diff --git a/alerts_api/alerts_api/models/notification.py b/alerts_api/alerts_api/models/notification.py new file mode 100644 index 00000000..84ccad01 --- /dev/null +++ b/alerts_api/alerts_api/models/notification.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.notification_email import NotificationEmail +from alerts_api.models.notification_third_party import NotificationThirdParty +from alerts_api.models.notification_webhook import NotificationWebhook +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Notification(BaseModel): + """ + Alert notification object. See Alert notification integrations. + """ # noqa: E501 + email: Optional[NotificationEmail] = None + third_party: Optional[List[NotificationThirdParty]] = Field(default=None, description="Third party notifications.", alias="thirdParty") + webhook: Optional[List[NotificationWebhook]] = Field(default=None, description="Webhooks notifications.") + __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": NotificationEmail.from_dict(obj.get("email")) if obj.get("email") is not None else None, + "thirdParty": [NotificationThirdParty.from_dict(_item) for _item in obj.get("thirdParty")] if obj.get("thirdParty") is not None else None, + "webhook": [NotificationWebhook.from_dict(_item) for _item in obj.get("webhook")] if obj.get("webhook") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/notification_email.py b/alerts_api/alerts_api/models/notification_email.py new file mode 100644 index 00000000..77244e5c --- /dev/null +++ b/alerts_api/alerts_api/models/notification_email.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 NotificationEmail(BaseModel): + """ + Email notifications. + """ # noqa: E501 + recipients: Optional[List[StrictStr]] = Field(default=None, description="An array containing the email addresses to receive notifications.") + message: Optional[StrictStr] = Field(default=None, description="Custom text included in alert email notifications sent to recipients.") + __properties: ClassVar[List[str]] = ["recipients", "message"] + + 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 NotificationEmail 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 NotificationEmail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "recipients": obj.get("recipients"), + "message": obj.get("message") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/notification_third_party.py b/alerts_api/alerts_api/models/notification_third_party.py new file mode 100644 index 00000000..7e5ecdf1 --- /dev/null +++ b/alerts_api/alerts_api/models/notification_third_party.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.third_party_integration_type import ThirdPartyIntegrationType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class NotificationThirdParty(BaseModel): + """ + Webhook notification. + """ # noqa: E501 + integration_id: Optional[List[StrictStr]] = Field(default=None, description="Integration ID.", alias="integrationId") + integration_type: Optional[ThirdPartyIntegrationType] = Field(default=None, alias="integrationType") + __properties: ClassVar[List[str]] = ["integrationId", "integrationType"] + + 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 NotificationThirdParty 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 NotificationThirdParty 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"), + "integrationType": obj.get("integrationType") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/notification_webhook.py b/alerts_api/alerts_api/models/notification_webhook.py new file mode 100644 index 00000000..e5c1de61 --- /dev/null +++ b/alerts_api/alerts_api/models/notification_webhook.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.webhook_integration_type import WebhookIntegrationType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class NotificationWebhook(BaseModel): + """ + Webhook notification. + """ # noqa: E501 + integration_id: Optional[List[StrictStr]] = Field(default=None, description="Integration ID.", alias="integrationId") + integration_type: Optional[WebhookIntegrationType] = Field(default=None, alias="integrationType") + __properties: ClassVar[List[str]] = ["integrationId", "integrationType"] + + 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 NotificationWebhook 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 NotificationWebhook 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"), + "integrationType": obj.get("integrationType") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/pagination_links.py b/alerts_api/alerts_api/models/pagination_links.py new file mode 100644 index 00000000..94cf25f5 --- /dev/null +++ b/alerts_api/alerts_api/models/pagination_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.pagination_links_links import PaginationLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationLinks(BaseModel): + """ + A links object containing pagination related link(s). + """ # noqa: E501 + links: Optional[PaginationLinksLinks] = 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 PaginationLinks 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 PaginationLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": PaginationLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/pagination_links_links.py b/alerts_api/alerts_api/models/pagination_links_links.py new file mode 100644 index 00000000..d517d6ee --- /dev/null +++ b/alerts_api/alerts_api/models/pagination_links_links.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationLinksLinks(BaseModel): + """ + PaginationLinksLinks + """ # noqa: E501 + previous: Optional[Link] = None + next: Optional[Link] = None + __properties: ClassVar[List[str]] = ["previous", "next"] + + 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 PaginationLinksLinks 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 previous + if self.previous: + _dict['previous'] = self.previous.to_dict() + # override the default output from pydantic by calling `to_dict()` of next + if self.next: + _dict['next'] = self.next.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PaginationLinksLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "previous": Link.from_dict(obj.get("previous")) if obj.get("previous") is not None else None, + "next": Link.from_dict(obj.get("next")) if obj.get("next") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/repeat.py b/alerts_api/alerts_api/models/repeat.py new file mode 100644 index 00000000..9bbda0ea --- /dev/null +++ b/alerts_api/alerts_api/models/repeat.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 +from pydantic import Field +from alerts_api.models.days_of_week import DaysOfWeek +from alerts_api.models.interval_type import IntervalType +from alerts_api.models.repeat_type import RepeatType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Repeat(BaseModel): + """ + Repeat options. + """ # noqa: E501 + type: Optional[RepeatType] = None + interval_type: Optional[IntervalType] = Field(default=None, alias="intervalType") + interval_length: Optional[StrictInt] = Field(default=None, description="Number of `intervalTypes` to wait before reactivating the alert suppression window.", alias="intervalLength") + days_of_week: Optional[List[DaysOfWeek]] = Field(default=None, alias="daysOfWeek") + __properties: ClassVar[List[str]] = ["type", "intervalType", "intervalLength", "daysOfWeek"] + + 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 Repeat 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 Repeat 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"), + "intervalType": obj.get("intervalType"), + "intervalLength": obj.get("intervalLength"), + "daysOfWeek": obj.get("daysOfWeek") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/repeat_type.py b/alerts_api/alerts_api/models/repeat_type.py new file mode 100644 index 00000000..372e8a88 --- /dev/null +++ b/alerts_api/alerts_api/models/repeat_type.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 RepeatType(str, Enum): + """ + Repeat options type. + """ + + """ + allowed enum values + """ + DAY = 'day' + WEEK = 'week' + MONTH = 'month' + CUSTOM = 'custom' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of RepeatType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/alerts_api/alerts_api/models/rule.py b/alerts_api/alerts_api/models/rule.py new file mode 100644 index 00000000..451cc481 --- /dev/null +++ b/alerts_api/alerts_api/models/rule.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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, StrictInt, StrictStr +from pydantic import Field +from alerts_api.models.alert_rounds_violation_mode import AlertRoundsViolationMode +from alerts_api.models.alert_type import AlertType +from alerts_api.models.severity import Severity +from alerts_api.models.test_direction import TestDirection +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Rule(BaseModel): + """ + Rule + """ # noqa: E501 + rule_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the rule.", alias="ruleId") + rule_name: StrictStr = Field(description="Name of the alert rule.", alias="ruleName") + expression: StrictStr = Field(description="The expression of the alert rule.") + direction: Optional[TestDirection] = None + notify_on_clear: Optional[StrictBool] = Field(default=None, description="Send notification when alert clears.", alias="notifyOnClear") + is_default: Optional[StrictBool] = Field(default=None, description="If set to `true`, this alert rule becomes the default for its test type and is automatically applied to newly created tests with relevant metrics. Only one default alert rule is allowed per test type.", alias="isDefault") + alert_type: AlertType = Field(alias="alertType") + minimum_sources: Optional[StrictInt] = Field(default=None, description="The minimum number of agents or monitors that must meet the specified criteria to trigger the alert.", alias="minimumSources") + minimum_sources_pct: Optional[StrictInt] = Field(default=None, description="The minimum percentage of all assigned agents or monitors that must meet the specified criteria to trigger the alert.", alias="minimumSourcesPct") + rounds_violating_mode: Optional[AlertRoundsViolationMode] = Field(default=None, alias="roundsViolatingMode") + rounds_violating_out_of: StrictInt = Field(description="Specifies the divisor (y value) in the “X of Y times” condition.", alias="roundsViolatingOutOf") + rounds_violating_required: StrictInt = Field(description="Specifies the numerator (x value) in the “X of Y times” condition.", alias="roundsViolatingRequired") + include_covered_prefixes: Optional[StrictBool] = Field(default=None, description="Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules.", alias="includeCoveredPrefixes") + severity: Optional[Severity] = None + __properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "direction", "notifyOnClear", "isDefault", "alertType", "minimumSources", "minimumSourcesPct", "roundsViolatingMode", "roundsViolatingOutOf", "roundsViolatingRequired", "includeCoveredPrefixes", "severity"] + + 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 Rule 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 Rule 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"), + "direction": obj.get("direction"), + "notifyOnClear": obj.get("notifyOnClear"), + "isDefault": obj.get("isDefault"), + "alertType": obj.get("alertType"), + "minimumSources": obj.get("minimumSources"), + "minimumSourcesPct": obj.get("minimumSourcesPct"), + "roundsViolatingMode": obj.get("roundsViolatingMode"), + "roundsViolatingOutOf": obj.get("roundsViolatingOutOf"), + "roundsViolatingRequired": obj.get("roundsViolatingRequired"), + "includeCoveredPrefixes": obj.get("includeCoveredPrefixes"), + "severity": obj.get("severity") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/rule_detail.py b/alerts_api/alerts_api/models/rule_detail.py new file mode 100644 index 00000000..d7a3bfd7 --- /dev/null +++ b/alerts_api/alerts_api/models/rule_detail.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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, StrictInt, StrictStr +from pydantic import Field +from alerts_api.models.alert_rounds_violation_mode import AlertRoundsViolationMode +from alerts_api.models.alert_type import AlertType +from alerts_api.models.base_test import BaseTest +from alerts_api.models.notification import Notification +from alerts_api.models.severity import Severity +from alerts_api.models.test_direction import TestDirection +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RuleDetail(BaseModel): + """ + RuleDetail + """ # noqa: E501 + rule_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the rule.", alias="ruleId") + rule_name: StrictStr = Field(description="Name of the alert rule.", alias="ruleName") + expression: StrictStr = Field(description="The expression of the alert rule.") + direction: Optional[TestDirection] = None + notify_on_clear: Optional[StrictBool] = Field(default=None, description="Send notification when alert clears.", alias="notifyOnClear") + is_default: Optional[StrictBool] = Field(default=None, description="If set to `true`, this alert rule becomes the default for its test type and is automatically applied to newly created tests with relevant metrics. Only one default alert rule is allowed per test type.", alias="isDefault") + alert_type: AlertType = Field(alias="alertType") + minimum_sources: Optional[StrictInt] = Field(default=None, description="The minimum number of agents or monitors that must meet the specified criteria to trigger the alert.", alias="minimumSources") + minimum_sources_pct: Optional[StrictInt] = Field(default=None, description="The minimum percentage of all assigned agents or monitors that must meet the specified criteria to trigger the alert.", alias="minimumSourcesPct") + rounds_violating_mode: Optional[AlertRoundsViolationMode] = Field(default=None, alias="roundsViolatingMode") + rounds_violating_out_of: StrictInt = Field(description="Specifies the divisor (y value) in the “X of Y times” condition.", alias="roundsViolatingOutOf") + rounds_violating_required: StrictInt = Field(description="Specifies the numerator (x value) in the “X of Y times” condition.", alias="roundsViolatingRequired") + include_covered_prefixes: Optional[StrictBool] = Field(default=None, description="Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules.", alias="includeCoveredPrefixes") + severity: Optional[Severity] = None + notifications: Optional[Notification] = None + tests: Optional[List[BaseTest]] = None + __properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "direction", "notifyOnClear", "isDefault", "alertType", "minimumSources", "minimumSourcesPct", "roundsViolatingMode", "roundsViolatingOutOf", "roundsViolatingRequired", "includeCoveredPrefixes", "severity", "notifications", "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 RuleDetail 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={ + "rule_id", + "tests", + }, + exclude_none=True, + ) + # 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 each item in tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RuleDetail 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"), + "direction": obj.get("direction"), + "notifyOnClear": obj.get("notifyOnClear"), + "isDefault": obj.get("isDefault"), + "alertType": obj.get("alertType"), + "minimumSources": obj.get("minimumSources"), + "minimumSourcesPct": obj.get("minimumSourcesPct"), + "roundsViolatingMode": obj.get("roundsViolatingMode"), + "roundsViolatingOutOf": obj.get("roundsViolatingOutOf"), + "roundsViolatingRequired": obj.get("roundsViolatingRequired"), + "includeCoveredPrefixes": obj.get("includeCoveredPrefixes"), + "severity": obj.get("severity"), + "notifications": Notification.from_dict(obj.get("notifications")) if obj.get("notifications") is not None else None, + "tests": [BaseTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/rule_detail_update.py b/alerts_api/alerts_api/models/rule_detail_update.py new file mode 100644 index 00000000..151179d4 --- /dev/null +++ b/alerts_api/alerts_api/models/rule_detail_update.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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, StrictInt, StrictStr +from pydantic import Field +from alerts_api.models.alert_rounds_violation_mode import AlertRoundsViolationMode +from alerts_api.models.alert_type import AlertType +from alerts_api.models.notification import Notification +from alerts_api.models.severity import Severity +from alerts_api.models.test_direction import TestDirection +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RuleDetailUpdate(BaseModel): + """ + RuleDetailUpdate + """ # noqa: E501 + rule_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the rule.", alias="ruleId") + rule_name: StrictStr = Field(description="Name of the alert rule.", alias="ruleName") + expression: StrictStr = Field(description="The expression of the alert rule.") + direction: Optional[TestDirection] = None + notify_on_clear: Optional[StrictBool] = Field(default=None, description="Send notification when alert clears.", alias="notifyOnClear") + is_default: Optional[StrictBool] = Field(default=None, description="If set to `true`, this alert rule becomes the default for its test type and is automatically applied to newly created tests with relevant metrics. Only one default alert rule is allowed per test type.", alias="isDefault") + alert_type: AlertType = Field(alias="alertType") + minimum_sources: Optional[StrictInt] = Field(default=None, description="The minimum number of agents or monitors that must meet the specified criteria to trigger the alert.", alias="minimumSources") + minimum_sources_pct: Optional[StrictInt] = Field(default=None, description="The minimum percentage of all assigned agents or monitors that must meet the specified criteria to trigger the alert.", alias="minimumSourcesPct") + rounds_violating_mode: Optional[AlertRoundsViolationMode] = Field(default=None, alias="roundsViolatingMode") + rounds_violating_out_of: StrictInt = Field(description="Specifies the divisor (y value) in the “X of Y times” condition.", alias="roundsViolatingOutOf") + rounds_violating_required: StrictInt = Field(description="Specifies the numerator (x value) in the “X of Y times” condition.", alias="roundsViolatingRequired") + include_covered_prefixes: Optional[StrictBool] = Field(default=None, description="Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules.", alias="includeCoveredPrefixes") + severity: Optional[Severity] = None + notifications: Optional[Notification] = None + test_ids: Optional[List[StrictStr]] = Field(default=None, description="Array of test IDs to link to alert rule (get `testId` from `/tests` endpoint).", alias="testIds") + __properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "direction", "notifyOnClear", "isDefault", "alertType", "minimumSources", "minimumSourcesPct", "roundsViolatingMode", "roundsViolatingOutOf", "roundsViolatingRequired", "includeCoveredPrefixes", "severity", "notifications", "testIds"] + + 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 RuleDetailUpdate 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 notifications + if self.notifications: + _dict['notifications'] = self.notifications.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RuleDetailUpdate 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"), + "direction": obj.get("direction"), + "notifyOnClear": obj.get("notifyOnClear"), + "isDefault": obj.get("isDefault"), + "alertType": obj.get("alertType"), + "minimumSources": obj.get("minimumSources"), + "minimumSourcesPct": obj.get("minimumSourcesPct"), + "roundsViolatingMode": obj.get("roundsViolatingMode"), + "roundsViolatingOutOf": obj.get("roundsViolatingOutOf"), + "roundsViolatingRequired": obj.get("roundsViolatingRequired"), + "includeCoveredPrefixes": obj.get("includeCoveredPrefixes"), + "severity": obj.get("severity"), + "notifications": Notification.from_dict(obj.get("notifications")) if obj.get("notifications") is not None else None, + "testIds": obj.get("testIds") + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/rule_links.py b/alerts_api/alerts_api/models/rule_links.py new file mode 100644 index 00000000..d3e7db61 --- /dev/null +++ b/alerts_api/alerts_api/models/rule_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.rule_links_links import RuleLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RuleLinks(BaseModel): + """ + RuleLinks + """ # noqa: E501 + links: Optional[RuleLinksLinks] = 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 RuleLinks 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 RuleLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": RuleLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/rule_links_links.py b/alerts_api/alerts_api/models/rule_links_links.py new file mode 100644 index 00000000..08632993 --- /dev/null +++ b/alerts_api/alerts_api/models/rule_links_links.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RuleLinksLinks(BaseModel): + """ + An object containing the alert rule links. + """ # noqa: E501 + rule: Optional[Link] = None + __properties: ClassVar[List[str]] = ["rule"] + + 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 RuleLinksLinks 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 rule + if self.rule: + _dict['rule'] = self.rule.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RuleLinksLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "rule": Link.from_dict(obj.get("rule")) if obj.get("rule") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/rules.py b/alerts_api/alerts_api/models/rules.py new file mode 100644 index 00000000..9e7cf940 --- /dev/null +++ b/alerts_api/alerts_api/models/rules.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_api.models.rule import Rule +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Rules(BaseModel): + """ + Rules + """ # noqa: E501 + alert_rules: Optional[List[Rule]] = Field(default=None, alias="alertRules") + __properties: ClassVar[List[str]] = ["alertRules"] + + 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 Rules 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 alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Rules from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alertRules": [Rule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None + }) + return _obj + + diff --git a/alerts_api/alerts_api/models/self_links.py b/alerts_api/alerts_api/models/self_links.py new file mode 100644 index 00000000..efd1d030 --- /dev/null +++ b/alerts_api/alerts_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_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 + + diff --git a/alerts_api/alerts_api/models/self_links_links.py b/alerts_api/alerts_api/models/self_links_links.py new file mode 100644 index 00000000..d3dc717c --- /dev/null +++ b/alerts_api/alerts_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_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 + + diff --git a/alerts_api/alerts_api/models/severity.py b/alerts_api/alerts_api/models/severity.py new file mode 100644 index 00000000..340bfa91 --- /dev/null +++ b/alerts_api/alerts_api/models/severity.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 Severity(str, Enum): + """ + The severity of the alert. + """ + + """ + allowed enum values + """ + INFO = 'info' + MAJOR = 'major' + MINOR = 'minor' + CRITICAL = 'critical' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Severity from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/alerts_api/alerts_api/models/state.py b/alerts_api/alerts_api/models/state.py new file mode 100644 index 00000000..2b11e985 --- /dev/null +++ b/alerts_api/alerts_api/models/state.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 State(str, Enum): + """ + Current state of the alert. Possible values: clear or trigger. + """ + + """ + allowed enum values + """ + CLEAR = 'clear' + TRIGGER = 'trigger' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of State from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/alerts_api/alerts_api/models/test_direction.py b/alerts_api/alerts_api/models/test_direction.py new file mode 100644 index 00000000..f657b976 --- /dev/null +++ b/alerts_api/alerts_api/models/test_direction.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 TestDirection(str, Enum): + """ + Direction of the test, which affects how results are shown. + """ + + """ + allowed enum values + """ + TO_MINUS_TARGET = 'to-target' + FROM_MINUS_TARGET = 'from-target' + BIDIRECTIONAL = 'bidirectional' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestDirection from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/alerts_api/alerts_api/models/test_interval.py b/alerts_api/alerts_api/models/test_interval.py new file mode 100644 index 00000000..f18ab7c6 --- /dev/null +++ b/alerts_api/alerts_api/models/test_interval.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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)) + + diff --git a/alerts_api/alerts_api/models/third_party_integration_type.py b/alerts_api/alerts_api/models/third_party_integration_type.py new file mode 100644 index 00000000..4f1b2e92 --- /dev/null +++ b/alerts_api/alerts_api/models/third_party_integration_type.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 ThirdPartyIntegrationType(str, Enum): + """ + Integration type. + """ + + """ + allowed enum values + """ + PAGERDUTY = 'pagerduty' + SLACK = 'slack' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ThirdPartyIntegrationType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/alerts_api/alerts_api/models/unauthorized_error.py b/alerts_api/alerts_api/models/unauthorized_error.py new file mode 100644 index 00000000..df99eec3 --- /dev/null +++ b/alerts_api/alerts_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 + + diff --git a/alerts_api/alerts_api/models/unexpanded_test.py b/alerts_api/alerts_api/models/unexpanded_test.py new file mode 100644 index 00000000..fca3e12b --- /dev/null +++ b/alerts_api/alerts_api/models/unexpanded_test.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_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 + + diff --git a/alerts_api/alerts_api/models/webhook_integration_type.py b/alerts_api/alerts_api/models/webhook_integration_type.py new file mode 100644 index 00000000..eaa3159c --- /dev/null +++ b/alerts_api/alerts_api/models/webhook_integration_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 WebhookIntegrationType(str, Enum): + """ + Integration type. + """ + + """ + allowed enum values + """ + WEBHOOK = 'webhook' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WebhookIntegrationType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/alerts_api/alerts_api/py.typed b/alerts_api/alerts_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/alerts_api/alerts_api/rest.py b/alerts_api/alerts_api/rest.py new file mode 100644 index 00000000..a8bf6fda --- /dev/null +++ b/alerts_api/alerts_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 alerts_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) diff --git a/alerts_api/docs/Alert.md b/alerts_api/docs/Alert.md new file mode 100644 index 00000000..5785e383 --- /dev/null +++ b/alerts_api/docs/Alert.md @@ -0,0 +1,37 @@ +# Alert + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique ID for each individual alert occurrence. | [optional] [readonly] +**alert_type** | [**AlertType**](AlertType.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) for querying alerts. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) for querying alerts. | [optional] [readonly] +**violation_count** | **int** | Number of sources that meet the alert criteria. | [optional] +**duration** | **float** | Duration in seconds the alert was active | [optional] +**links** | [**RuleLinksLinks**](RuleLinksLinks.md) | | [optional] +**alert_rule_id** | **str** | Unique ID of the rule. | [optional] [readonly] +**alert_state** | [**State**](State.md) | | [optional] +**alert_severity** | [**Severity**](Severity.md) | | [optional] + +## Example + +```python +from alerts_api.models.alert import Alert + +# TODO update the JSON string below +json = "{}" +# create an instance of Alert from a JSON string +alert_instance = Alert.from_json(json) +# print the JSON string representation of the object +print Alert.to_json() + +# convert the object into a dict +alert_dict = alert_instance.to_dict() +# create an instance of Alert from a dict +alert_form_dict = alert.from_dict(alert_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertDetail.md b/alerts_api/docs/AlertDetail.md new file mode 100644 index 00000000..e29bd0ca --- /dev/null +++ b/alerts_api/docs/AlertDetail.md @@ -0,0 +1,37 @@ +# AlertDetail + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique ID for each individual alert occurrence. | [optional] [readonly] +**alert_type** | [**AlertType**](AlertType.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) for querying alerts. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) for querying alerts. | [optional] [readonly] +**violation_count** | **int** | Number of sources that meet the alert criteria. | [optional] +**duration** | **float** | Duration in seconds the alert was active | [optional] +**links** | [**RuleLinksLinks**](RuleLinksLinks.md) | | [optional] +**state** | [**State**](State.md) | | [optional] +**severity** | [**Severity**](Severity.md) | | [optional] +**details** | [**List[AlertMetricDetail]**](AlertMetricDetail.md) | | [optional] + +## Example + +```python +from alerts_api.models.alert_detail import AlertDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of AlertDetail from a JSON string +alert_detail_instance = AlertDetail.from_json(json) +# print the JSON string representation of the object +print AlertDetail.to_json() + +# convert the object into a dict +alert_detail_dict = alert_detail_instance.to_dict() +# create an instance of AlertDetail from a dict +alert_detail_form_dict = alert_detail.from_dict(alert_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertLinks.md b/alerts_api/docs/AlertLinks.md new file mode 100644 index 00000000..16f65a7f --- /dev/null +++ b/alerts_api/docs/AlertLinks.md @@ -0,0 +1,28 @@ +# AlertLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**RuleLinksLinks**](RuleLinksLinks.md) | | [optional] + +## Example + +```python +from alerts_api.models.alert_links import AlertLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of AlertLinks from a JSON string +alert_links_instance = AlertLinks.from_json(json) +# print the JSON string representation of the object +print AlertLinks.to_json() + +# convert the object into a dict +alert_links_dict = alert_links_instance.to_dict() +# create an instance of AlertLinks from a dict +alert_links_form_dict = alert_links.from_dict(alert_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertMetricDetail.md b/alerts_api/docs/AlertMetricDetail.md new file mode 100644 index 00000000..21fcd7cc --- /dev/null +++ b/alerts_api/docs/AlertMetricDetail.md @@ -0,0 +1,33 @@ +# AlertMetricDetail + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**end** | [**AlertMetricDetailEnd**](AlertMetricDetailEnd.md) | | [optional] +**id** | **str** | Unique metric detail id. | [optional] +**name** | **str** | Geolocation of the alert. | [optional] +**start** | [**AlertMetricDetailStart**](AlertMetricDetailStart.md) | | [optional] +**state** | [**State**](State.md) | | [optional] +**type** | **str** | Type of the alert metric. | [optional] + +## Example + +```python +from alerts_api.models.alert_metric_detail import AlertMetricDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of AlertMetricDetail from a JSON string +alert_metric_detail_instance = AlertMetricDetail.from_json(json) +# print the JSON string representation of the object +print AlertMetricDetail.to_json() + +# convert the object into a dict +alert_metric_detail_dict = alert_metric_detail_instance.to_dict() +# create an instance of AlertMetricDetail from a dict +alert_metric_detail_form_dict = alert_metric_detail.from_dict(alert_metric_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertMetricDetailEnd.md b/alerts_api/docs/AlertMetricDetailEnd.md new file mode 100644 index 00000000..96955b74 --- /dev/null +++ b/alerts_api/docs/AlertMetricDetailEnd.md @@ -0,0 +1,28 @@ +# AlertMetricDetailEnd + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metrics** | **str** | | [optional] + +## Example + +```python +from alerts_api.models.alert_metric_detail_end import AlertMetricDetailEnd + +# TODO update the JSON string below +json = "{}" +# create an instance of AlertMetricDetailEnd from a JSON string +alert_metric_detail_end_instance = AlertMetricDetailEnd.from_json(json) +# print the JSON string representation of the object +print AlertMetricDetailEnd.to_json() + +# convert the object into a dict +alert_metric_detail_end_dict = alert_metric_detail_end_instance.to_dict() +# create an instance of AlertMetricDetailEnd from a dict +alert_metric_detail_end_form_dict = alert_metric_detail_end.from_dict(alert_metric_detail_end_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertMetricDetailStart.md b/alerts_api/docs/AlertMetricDetailStart.md new file mode 100644 index 00000000..e4c1352f --- /dev/null +++ b/alerts_api/docs/AlertMetricDetailStart.md @@ -0,0 +1,28 @@ +# AlertMetricDetailStart + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metrics** | **str** | | [optional] + +## Example + +```python +from alerts_api.models.alert_metric_detail_start import AlertMetricDetailStart + +# TODO update the JSON string below +json = "{}" +# create an instance of AlertMetricDetailStart from a JSON string +alert_metric_detail_start_instance = AlertMetricDetailStart.from_json(json) +# print the JSON string representation of the object +print AlertMetricDetailStart.to_json() + +# convert the object into a dict +alert_metric_detail_start_dict = alert_metric_detail_start_instance.to_dict() +# create an instance of AlertMetricDetailStart from a dict +alert_metric_detail_start_form_dict = alert_metric_detail_start.from_dict(alert_metric_detail_start_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertMetrics.md b/alerts_api/docs/AlertMetrics.md new file mode 100644 index 00000000..0e24a974 --- /dev/null +++ b/alerts_api/docs/AlertMetrics.md @@ -0,0 +1,28 @@ +# AlertMetrics + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metrics** | **str** | | [optional] + +## Example + +```python +from alerts_api.models.alert_metrics import AlertMetrics + +# TODO update the JSON string below +json = "{}" +# create an instance of AlertMetrics from a JSON string +alert_metrics_instance = AlertMetrics.from_json(json) +# print the JSON string representation of the object +print AlertMetrics.to_json() + +# convert the object into a dict +alert_metrics_dict = alert_metrics_instance.to_dict() +# create an instance of AlertMetrics from a dict +alert_metrics_form_dict = alert_metrics.from_dict(alert_metrics_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertRoundsViolationMode.md b/alerts_api/docs/AlertRoundsViolationMode.md new file mode 100644 index 00000000..a4609630 --- /dev/null +++ b/alerts_api/docs/AlertRoundsViolationMode.md @@ -0,0 +1,11 @@ +# AlertRoundsViolationMode + +`exact` requires that the same agent(s) meet the threshold in consecutive rounds; default is `any` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertRule.md b/alerts_api/docs/AlertRule.md new file mode 100644 index 00000000..e053ad51 --- /dev/null +++ b/alerts_api/docs/AlertRule.md @@ -0,0 +1,38 @@ +# AlertRule + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rule_id** | **str** | Unique ID of the rule | [optional] [readonly] +**rule_name** | **str** | Name of the alert rule | [optional] [readonly] +**expression** | **str** | String expression of alert rule | [optional] [readonly] +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**is_default** | **bool** | Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here | [optional] [readonly] +**alert_type** | [**AlertType**](AlertType.md) | | [optional] +**minimum_sources** | **int** | The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert | [optional] [readonly] +**minimum_sources_pct** | **int** | the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert | [optional] [readonly] +**rounds_violating_mode** | [**AlertRoundsViolationMode**](AlertRoundsViolationMode.md) | | [optional] +**rounds_violating_out_of** | **int** | Specifies the divisor (y value) for the “X of Y times” condition. | [optional] [readonly] +**rounds_violating_required** | **int** | Specifies the numerator (x value) for the “X of Y times” condition | [optional] [readonly] + +## Example + +```python +from alerts_api.models.alert_rule import AlertRule + +# TODO update the JSON string below +json = "{}" +# create an instance of AlertRule from a JSON string +alert_rule_instance = AlertRule.from_json(json) +# print the JSON string representation of the object +print AlertRule.to_json() + +# convert the object into a dict +alert_rule_dict = alert_rule_instance.to_dict() +# create an instance of AlertRule from a dict +alert_rule_form_dict = alert_rule.from_dict(alert_rule_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertRulesApi.md b/alerts_api/docs/AlertRulesApi.md new file mode 100644 index 00000000..6f4b9c54 --- /dev/null +++ b/alerts_api/docs/AlertRulesApi.md @@ -0,0 +1,435 @@ +# alerts_api.AlertRulesApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_alert_rule**](AlertRulesApi.md#create_alert_rule) | **POST** /v7/alerts/rules | Create alert rule +[**delete_alert_rule**](AlertRulesApi.md#delete_alert_rule) | **DELETE** /v7/alerts/rules/{ruleId} | Delete alert rule +[**get_alert_rule_details**](AlertRulesApi.md#get_alert_rule_details) | **GET** /v7/alerts/rules/{ruleId} | Retrieve alert rule +[**get_alerts_rules**](AlertRulesApi.md#get_alerts_rules) | **GET** /v7/alerts/rules | List alert rules +[**update_alert_rule**](AlertRulesApi.md#update_alert_rule) | **PUT** /v7/alerts/rules/{ruleId} | Update alert rule + + +# **create_alert_rule** +> CreateAlertRule201Response create_alert_rule(rule_detail_update, aid=aid) + +Create alert rule + +Creates a new alert rule in your account, using the provided POST data. The `Edit alert rules` permission is required to create an alert rule. Note: Assigning an alert rule to a test during creation requires the `Edit tests` permission. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import alerts_api +from alerts_api.models.create_alert_rule201_response import CreateAlertRule201Response +from alerts_api.models.rule_detail_update import RuleDetailUpdate +from alerts_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = alerts_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = alerts_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with alerts_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = alerts_api.AlertRulesApi(api_client) + rule_detail_update = alerts_api.RuleDetailUpdate() # RuleDetailUpdate | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create alert rule + api_response = api_instance.create_alert_rule(rule_detail_update, aid=aid) + print("The response of AlertRulesApi->create_alert_rule:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AlertRulesApi->create_alert_rule: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **rule_detail_update** | [**RuleDetailUpdate**](RuleDetailUpdate.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**CreateAlertRule201Response**](CreateAlertRule201Response.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 | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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 | - | + +[[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) + +# **delete_alert_rule** +> delete_alert_rule(rule_id, aid=aid) + +Delete alert rule + +Deletes an alert rule from your account. Users must have both `Edit alert rules` and `Edit tests` permissions, especially if the rule is linked to any tests. Without these permissions, an error occurs. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import alerts_api +from alerts_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = alerts_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = alerts_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with alerts_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = alerts_api.AlertRulesApi(api_client) + rule_id = '127094' # str | Unique alert rule ID. + 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 alert rule + api_instance.delete_alert_rule(rule_id, aid=aid) + except Exception as e: + print("Exception when calling AlertRulesApi->delete_alert_rule: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **rule_id** | **str**| Unique alert rule ID. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | - | +**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 | - | + +[[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_alert_rule_details** +> GetAlertRuleDetails200Response get_alert_rule_details(rule_id, aid=aid) + +Retrieve alert rule + +Returns detailed information about an alert rule using the `ruleId`. If the `ruleId` doesn’t exist or is inaccessible by your account, an empty response is returned. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import alerts_api +from alerts_api.models.get_alert_rule_details200_response import GetAlertRuleDetails200Response +from alerts_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = alerts_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = alerts_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with alerts_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = alerts_api.AlertRulesApi(api_client) + rule_id = '127094' # str | Unique alert rule ID. + 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 alert rule + api_response = api_instance.get_alert_rule_details(rule_id, aid=aid) + print("The response of AlertRulesApi->get_alert_rule_details:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AlertRulesApi->get_alert_rule_details: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **rule_id** | **str**| Unique alert rule ID. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetAlertRuleDetails200Response**](GetAlertRuleDetails200Response.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 | - | + +[[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_alerts_rules** +> GetAlertsRules200Response get_alerts_rules(aid=aid) + +List alert rules + +Returns a list of alert rules. Default rules for each test type are indicated with a boolean response (true or false); these default alert rules automatically apply to their respective test types. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import alerts_api +from alerts_api.models.get_alerts_rules200_response import GetAlertsRules200Response +from alerts_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = alerts_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = alerts_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with alerts_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = alerts_api.AlertRulesApi(api_client) + 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 alert rules + api_response = api_instance.get_alerts_rules(aid=aid) + print("The response of AlertRulesApi->get_alerts_rules:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AlertRulesApi->get_alerts_rules: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetAlertsRules200Response**](GetAlertsRules200Response.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 | - | + +[[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_alert_rule** +> CreateAlertRule201Response update_alert_rule(rule_id, rule_detail_update, aid=aid) + +Update alert rule + +Modifies an existing alert rule in your account, using the provided POST data. The `Edit alert rules` permission is required to modify an alert rule. Note: Assigning an alert rule to a test during creation requires the `Edit tests` permission. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import alerts_api +from alerts_api.models.create_alert_rule201_response import CreateAlertRule201Response +from alerts_api.models.rule_detail_update import RuleDetailUpdate +from alerts_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = alerts_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = alerts_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with alerts_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = alerts_api.AlertRulesApi(api_client) + rule_id = '127094' # str | Unique alert rule ID. + rule_detail_update = alerts_api.RuleDetailUpdate() # RuleDetailUpdate | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Update alert rule + api_response = api_instance.update_alert_rule(rule_id, rule_detail_update, aid=aid) + print("The response of AlertRulesApi->update_alert_rule:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AlertRulesApi->update_alert_rule: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **rule_id** | **str**| Unique alert rule ID. | + **rule_detail_update** | [**RuleDetailUpdate**](RuleDetailUpdate.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**CreateAlertRule201Response**](CreateAlertRule201Response.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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/alerts_api/docs/AlertSuppressionWindow.md b/alerts_api/docs/AlertSuppressionWindow.md new file mode 100644 index 00000000..aabd44db --- /dev/null +++ b/alerts_api/docs/AlertSuppressionWindow.md @@ -0,0 +1,35 @@ +# AlertSuppressionWindow + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alert_suppression_window_id** | **str** | Unique ID of the alert suppression window. | [optional] [readonly] +**name** | **str** | Name of the alert suppression window. | [optional] +**is_enabled** | **bool** | Set to `false` for `disabled`, `true` for `enabled`. | [optional] +**status** | [**AlertSuppressionWindowState**](AlertSuppressionWindowState.md) | | [optional] +**start_date** | **datetime** | The date/time when the alert suppression window starts (ISO date-time format). | [optional] +**duration** | **int** | Duration in seconds the suppression window is active. | [optional] +**repeat** | [**Repeat**](Repeat.md) | | [optional] +**end_repeat** | [**EndRepeat**](EndRepeat.md) | | [optional] + +## Example + +```python +from alerts_api.models.alert_suppression_window import AlertSuppressionWindow + +# TODO update the JSON string below +json = "{}" +# create an instance of AlertSuppressionWindow from a JSON string +alert_suppression_window_instance = AlertSuppressionWindow.from_json(json) +# print the JSON string representation of the object +print AlertSuppressionWindow.to_json() + +# convert the object into a dict +alert_suppression_window_dict = alert_suppression_window_instance.to_dict() +# create an instance of AlertSuppressionWindow from a dict +alert_suppression_window_form_dict = alert_suppression_window.from_dict(alert_suppression_window_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertSuppressionWindowRequest.md b/alerts_api/docs/AlertSuppressionWindowRequest.md new file mode 100644 index 00000000..6c2860ec --- /dev/null +++ b/alerts_api/docs/AlertSuppressionWindowRequest.md @@ -0,0 +1,36 @@ +# AlertSuppressionWindowRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alert_suppression_window_id** | **str** | Unique ID of the alert suppression window. | [optional] [readonly] +**name** | **str** | Name of the alert suppression window. | [optional] +**is_enabled** | **bool** | Set to `false` for `disabled`, `true` for `enabled`. | [optional] +**status** | [**AlertSuppressionWindowState**](AlertSuppressionWindowState.md) | | [optional] +**start_date** | **datetime** | The date/time when the alert suppression window starts (ISO date-time format). | [optional] +**duration** | **int** | Duration in seconds the suppression window is active. | [optional] +**repeat** | [**Repeat**](Repeat.md) | | [optional] +**end_repeat** | [**EndRepeat**](EndRepeat.md) | | [optional] +**tests** | **List[str]** | List of tests to assign to the alert suppression window. | [optional] + +## Example + +```python +from alerts_api.models.alert_suppression_window_request import AlertSuppressionWindowRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AlertSuppressionWindowRequest from a JSON string +alert_suppression_window_request_instance = AlertSuppressionWindowRequest.from_json(json) +# print the JSON string representation of the object +print AlertSuppressionWindowRequest.to_json() + +# convert the object into a dict +alert_suppression_window_request_dict = alert_suppression_window_request_instance.to_dict() +# create an instance of AlertSuppressionWindowRequest from a dict +alert_suppression_window_request_form_dict = alert_suppression_window_request.from_dict(alert_suppression_window_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) + + diff --git a/alerts_api/docs/AlertSuppressionWindowState.md b/alerts_api/docs/AlertSuppressionWindowState.md new file mode 100644 index 00000000..cae27390 --- /dev/null +++ b/alerts_api/docs/AlertSuppressionWindowState.md @@ -0,0 +1,11 @@ +# AlertSuppressionWindowState + +Indicates the current status of the suppression window. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertSuppressionWindows.md b/alerts_api/docs/AlertSuppressionWindows.md new file mode 100644 index 00000000..9a8f8e75 --- /dev/null +++ b/alerts_api/docs/AlertSuppressionWindows.md @@ -0,0 +1,29 @@ +# AlertSuppressionWindows + +Alert suppression windows. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alert_suppression_windows** | [**List[AlertSuppressionWindowsAlertSuppressionWindowsInner]**](AlertSuppressionWindowsAlertSuppressionWindowsInner.md) | | [optional] + +## Example + +```python +from alerts_api.models.alert_suppression_windows import AlertSuppressionWindows + +# TODO update the JSON string below +json = "{}" +# create an instance of AlertSuppressionWindows from a JSON string +alert_suppression_windows_instance = AlertSuppressionWindows.from_json(json) +# print the JSON string representation of the object +print AlertSuppressionWindows.to_json() + +# convert the object into a dict +alert_suppression_windows_dict = alert_suppression_windows_instance.to_dict() +# create an instance of AlertSuppressionWindows from a dict +alert_suppression_windows_form_dict = alert_suppression_windows.from_dict(alert_suppression_windows_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertSuppressionWindowsAlertSuppressionWindowsInner.md b/alerts_api/docs/AlertSuppressionWindowsAlertSuppressionWindowsInner.md new file mode 100644 index 00000000..23d1edfa --- /dev/null +++ b/alerts_api/docs/AlertSuppressionWindowsAlertSuppressionWindowsInner.md @@ -0,0 +1,36 @@ +# AlertSuppressionWindowsAlertSuppressionWindowsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alert_suppression_window_id** | **str** | Unique ID of the alert suppression window. | [optional] [readonly] +**name** | **str** | Name of the alert suppression window. | [optional] +**is_enabled** | **bool** | Set to `false` for `disabled`, `true` for `enabled`. | [optional] +**status** | [**AlertSuppressionWindowState**](AlertSuppressionWindowState.md) | | [optional] +**start_date** | **datetime** | The date/time when the alert suppression window starts (ISO date-time format). | [optional] +**duration** | **int** | Duration in seconds the suppression window is active. | [optional] +**repeat** | [**Repeat**](Repeat.md) | | [optional] +**end_repeat** | [**EndRepeat**](EndRepeat.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from alerts_api.models.alert_suppression_windows_alert_suppression_windows_inner import AlertSuppressionWindowsAlertSuppressionWindowsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of AlertSuppressionWindowsAlertSuppressionWindowsInner from a JSON string +alert_suppression_windows_alert_suppression_windows_inner_instance = AlertSuppressionWindowsAlertSuppressionWindowsInner.from_json(json) +# print the JSON string representation of the object +print AlertSuppressionWindowsAlertSuppressionWindowsInner.to_json() + +# convert the object into a dict +alert_suppression_windows_alert_suppression_windows_inner_dict = alert_suppression_windows_alert_suppression_windows_inner_instance.to_dict() +# create an instance of AlertSuppressionWindowsAlertSuppressionWindowsInner from a dict +alert_suppression_windows_alert_suppression_windows_inner_form_dict = alert_suppression_windows_alert_suppression_windows_inner.from_dict(alert_suppression_windows_alert_suppression_windows_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertSuppressionWindowsApi.md b/alerts_api/docs/AlertSuppressionWindowsApi.md new file mode 100644 index 00000000..8a537aaf --- /dev/null +++ b/alerts_api/docs/AlertSuppressionWindowsApi.md @@ -0,0 +1,444 @@ +# alerts_api.AlertSuppressionWindowsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_suppression_windows**](AlertSuppressionWindowsApi.md#create_suppression_windows) | **POST** /v7/alert-suppression-windows | Create alert suppression window +[**delete_suppression_window**](AlertSuppressionWindowsApi.md#delete_suppression_window) | **DELETE** /v7/alert-suppression-windows/{windowId} | Delete alert suppression window +[**get_suppression_window_details**](AlertSuppressionWindowsApi.md#get_suppression_window_details) | **GET** /v7/alert-suppression-windows/{windowId} | Retrieve alert suppression window +[**get_suppression_windows**](AlertSuppressionWindowsApi.md#get_suppression_windows) | **GET** /v7/alert-suppression-windows | List alert suppression windows +[**update_suppression_window**](AlertSuppressionWindowsApi.md#update_suppression_window) | **PUT** /v7/alert-suppression-windows/{windowId} | Update alert suppression window + + +# **create_suppression_windows** +> CreateSuppressionWindows201Response create_suppression_windows(alert_suppression_window_request, aid=aid, expand=expand) + +Create alert suppression window + +Creates a new alert suppression window in ThousandEyes, using the provided POST data. Only Account Admins can create alert suppression windows. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import alerts_api +from alerts_api.models.alert_suppression_window_request import AlertSuppressionWindowRequest +from alerts_api.models.create_suppression_windows201_response import CreateSuppressionWindows201Response +from alerts_api.models.expand import Expand +from alerts_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = alerts_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = alerts_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with alerts_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = alerts_api.AlertSuppressionWindowsApi(api_client) + alert_suppression_window_request = alerts_api.AlertSuppressionWindowRequest() # AlertSuppressionWindowRequest | + 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 = [alerts_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. (optional) + + try: + # Create alert suppression window + api_response = api_instance.create_suppression_windows(alert_suppression_window_request, aid=aid, expand=expand) + print("The response of AlertSuppressionWindowsApi->create_suppression_windows:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AlertSuppressionWindowsApi->create_suppression_windows: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **alert_suppression_window_request** | [**AlertSuppressionWindowRequest**](AlertSuppressionWindowRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. | [optional] + +### Return type + +[**CreateSuppressionWindows201Response**](CreateSuppressionWindows201Response.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 | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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 | - | + +[[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) + +# **delete_suppression_window** +> delete_suppression_window(window_id, aid=aid) + +Delete alert suppression window + +Deletes an alert suppression window. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import alerts_api +from alerts_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = alerts_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = alerts_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with alerts_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = alerts_api.AlertSuppressionWindowsApi(api_client) + window_id = '2411' # str | Unique window ID. + 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 alert suppression window + api_instance.delete_suppression_window(window_id, aid=aid) + except Exception as e: + print("Exception when calling AlertSuppressionWindowsApi->delete_suppression_window: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **window_id** | **str**| Unique window ID. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | - | +**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 | - | + +[[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_suppression_window_details** +> CreateSuppressionWindows201Response get_suppression_window_details(window_id, aid=aid, expand=expand) + +Retrieve alert suppression window + +Returns detailed information about an alert suppression window configured in your account group. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import alerts_api +from alerts_api.models.create_suppression_windows201_response import CreateSuppressionWindows201Response +from alerts_api.models.expand import Expand +from alerts_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = alerts_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = alerts_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with alerts_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = alerts_api.AlertSuppressionWindowsApi(api_client) + window_id = '2411' # str | Unique window ID. + 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 = [alerts_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. (optional) + + try: + # Retrieve alert suppression window + api_response = api_instance.get_suppression_window_details(window_id, aid=aid, expand=expand) + print("The response of AlertSuppressionWindowsApi->get_suppression_window_details:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AlertSuppressionWindowsApi->get_suppression_window_details: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **window_id** | **str**| Unique window ID. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. | [optional] + +### Return type + +[**CreateSuppressionWindows201Response**](CreateSuppressionWindows201Response.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 | - | + +[[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_suppression_windows** +> GetSuppressionWindows200Response get_suppression_windows(aid=aid) + +List alert suppression windows + +Returns a list of all alert suppression windows configured in your account group. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import alerts_api +from alerts_api.models.get_suppression_windows200_response import GetSuppressionWindows200Response +from alerts_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = alerts_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = alerts_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with alerts_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = alerts_api.AlertSuppressionWindowsApi(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 alert suppression windows + api_response = api_instance.get_suppression_windows(aid=aid) + print("The response of AlertSuppressionWindowsApi->get_suppression_windows:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AlertSuppressionWindowsApi->get_suppression_windows: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetSuppressionWindows200Response**](GetSuppressionWindows200Response.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 | - | + +[[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_suppression_window** +> CreateSuppressionWindows201Response update_suppression_window(window_id, alert_suppression_window_request, aid=aid, expand=expand) + +Update alert suppression window + +Updates an alert suppression window in ThousandEyes, using the provided POST data. Only Account Admins can update alert suppression windows. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import alerts_api +from alerts_api.models.alert_suppression_window_request import AlertSuppressionWindowRequest +from alerts_api.models.create_suppression_windows201_response import CreateSuppressionWindows201Response +from alerts_api.models.expand import Expand +from alerts_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = alerts_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = alerts_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with alerts_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = alerts_api.AlertSuppressionWindowsApi(api_client) + window_id = '2411' # str | Unique window ID. + alert_suppression_window_request = alerts_api.AlertSuppressionWindowRequest() # AlertSuppressionWindowRequest | + 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 = [alerts_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. (optional) + + try: + # Update alert suppression window + api_response = api_instance.update_suppression_window(window_id, alert_suppression_window_request, aid=aid, expand=expand) + print("The response of AlertSuppressionWindowsApi->update_suppression_window:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AlertSuppressionWindowsApi->update_suppression_window: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **window_id** | **str**| Unique window ID. | + **alert_suppression_window_request** | [**AlertSuppressionWindowRequest**](AlertSuppressionWindowRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. | [optional] + +### Return type + +[**CreateSuppressionWindows201Response**](CreateSuppressionWindows201Response.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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/alerts_api/docs/AlertType.md b/alerts_api/docs/AlertType.md new file mode 100644 index 00000000..541a3038 --- /dev/null +++ b/alerts_api/docs/AlertType.md @@ -0,0 +1,11 @@ +# AlertType + +Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.thousandeyes.com/v7/alerts/#/alert-details) documentation for a list of possible values + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/Alerts.md b/alerts_api/docs/Alerts.md new file mode 100644 index 00000000..f2eda47e --- /dev/null +++ b/alerts_api/docs/Alerts.md @@ -0,0 +1,28 @@ +# Alerts + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alerts** | [**List[Alert]**](Alert.md) | | [optional] + +## Example + +```python +from alerts_api.models.alerts import Alerts + +# TODO update the JSON string below +json = "{}" +# create an instance of Alerts from a JSON string +alerts_instance = Alerts.from_json(json) +# print the JSON string representation of the object +print Alerts.to_json() + +# convert the object into a dict +alerts_dict = alerts_instance.to_dict() +# create an instance of Alerts from a dict +alerts_form_dict = alerts.from_dict(alerts_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AlertsApi.md b/alerts_api/docs/AlertsApi.md new file mode 100644 index 00000000..62d49186 --- /dev/null +++ b/alerts_api/docs/AlertsApi.md @@ -0,0 +1,186 @@ +# alerts_api.AlertsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_alert_details**](AlertsApi.md#get_alert_details) | **GET** /v7/alerts/{alertId} | Retrieve alert details +[**get_alerts**](AlertsApi.md#get_alerts) | **GET** /v7/alerts | List active alerts + + +# **get_alert_details** +> AlertDetail get_alert_details(alert_id, aid=aid) + +Retrieve alert details + +Returns detailed information about an alert using its ID. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import alerts_api +from alerts_api.models.alert_detail import AlertDetail +from alerts_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = alerts_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = alerts_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with alerts_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = alerts_api.AlertsApi(api_client) + alert_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' # str | Unique alert ID. + 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 alert details + api_response = api_instance.get_alert_details(alert_id, aid=aid) + print("The response of AlertsApi->get_alert_details:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AlertsApi->get_alert_details: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **alert_id** | **str**| Unique alert ID. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**AlertDetail**](AlertDetail.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 | - | + +[[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_alerts** +> GetAlerts200Response get_alerts(aid=aid, window=window, start_date=start_date, end_date=end_date, max=max, state=state) + +List active alerts + +Returns a list of active alerts. If no alerts are active within the specified time range, an empty response is returned. Note that time filters (`window`, `startDate`, or `endDate`) are only applied to cleared alerts. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import alerts_api +from alerts_api.models.get_alerts200_response import GetAlerts200Response +from alerts_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = alerts_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = alerts_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with alerts_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = alerts_api.AlertsApi(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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + max = 5 # float | (Optional) Maximum number of objects to return. (optional) + state = alerts_api.State() # State | Optional parameter to match a specific alert state. If not specified, it defaults to `trigger`. (optional) + + try: + # List active alerts + api_response = api_instance.get_alerts(aid=aid, window=window, start_date=start_date, end_date=end_date, max=max, state=state) + print("The response of AlertsApi->get_alerts:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AlertsApi->get_alerts: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **max** | **float**| (Optional) Maximum number of objects to return. | [optional] + **state** | [**State**](.md)| Optional parameter to match a specific alert state. If not specified, it defaults to `trigger`. | [optional] + +### Return type + +[**GetAlerts200Response**](GetAlerts200Response.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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/alerts_api/docs/AppLinks.md b/alerts_api/docs/AppLinks.md new file mode 100644 index 00000000..a05beb3f --- /dev/null +++ b/alerts_api/docs/AppLinks.md @@ -0,0 +1,28 @@ +# AppLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**AppLinksLinks**](AppLinksLinks.md) | | [optional] + +## Example + +```python +from alerts_api.models.app_links import AppLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of AppLinks from a JSON string +app_links_instance = AppLinks.from_json(json) +# print the JSON string representation of the object +print AppLinks.to_json() + +# convert the object into a dict +app_links_dict = app_links_instance.to_dict() +# create an instance of AppLinks from a dict +app_links_form_dict = app_links.from_dict(app_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/AppLinksLinks.md b/alerts_api/docs/AppLinksLinks.md new file mode 100644 index 00000000..8909c5c4 --- /dev/null +++ b/alerts_api/docs/AppLinksLinks.md @@ -0,0 +1,29 @@ +# AppLinksLinks + +A links object containing the ThousandEyes App link + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_link** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from alerts_api.models.app_links_links import AppLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of AppLinksLinks from a JSON string +app_links_links_instance = AppLinksLinks.from_json(json) +# print the JSON string representation of the object +print AppLinksLinks.to_json() + +# convert the object into a dict +app_links_links_dict = app_links_links_instance.to_dict() +# create an instance of AppLinksLinks from a dict +app_links_links_form_dict = app_links_links.from_dict(app_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/BaseAlert.md b/alerts_api/docs/BaseAlert.md new file mode 100644 index 00000000..97c7cdfa --- /dev/null +++ b/alerts_api/docs/BaseAlert.md @@ -0,0 +1,34 @@ +# BaseAlert + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**RuleLinksLinks**](RuleLinksLinks.md) | | [optional] +**id** | **str** | A unique ID for each individual alert occurrence. | [optional] [readonly] +**alert_type** | [**AlertType**](AlertType.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) for querying alerts. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) for querying alerts. | [optional] [readonly] +**violation_count** | **int** | Number of sources that meet the alert criteria. | [optional] +**duration** | **float** | Duration in seconds the alert was active | [optional] + +## Example + +```python +from alerts_api.models.base_alert import BaseAlert + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseAlert from a JSON string +base_alert_instance = BaseAlert.from_json(json) +# print the JSON string representation of the object +print BaseAlert.to_json() + +# convert the object into a dict +base_alert_dict = base_alert_instance.to_dict() +# create an instance of BaseAlert from a dict +base_alert_form_dict = base_alert.from_dict(base_alert_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/BaseTest.md b/alerts_api/docs/BaseTest.md new file mode 100644 index 00000000..8dc93850 --- /dev/null +++ b/alerts_api/docs/BaseTest.md @@ -0,0 +1,31 @@ +# BaseTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] + +## Example + +```python +from alerts_api.models.base_test import BaseTest + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseTest from a JSON string +base_test_instance = BaseTest.from_json(json) +# print the JSON string representation of the object +print BaseTest.to_json() + +# convert the object into a dict +base_test_dict = base_test_instance.to_dict() +# create an instance of BaseTest from a dict +base_test_form_dict = base_test.from_dict(base_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/CompleteAlertSuppressionWindow.md b/alerts_api/docs/CompleteAlertSuppressionWindow.md new file mode 100644 index 00000000..bb4059c8 --- /dev/null +++ b/alerts_api/docs/CompleteAlertSuppressionWindow.md @@ -0,0 +1,36 @@ +# CompleteAlertSuppressionWindow + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alert_suppression_window_id** | **str** | Unique ID of the alert suppression window. | [optional] [readonly] +**name** | **str** | Name of the alert suppression window. | [optional] +**is_enabled** | **bool** | Set to `false` for `disabled`, `true` for `enabled`. | [optional] +**status** | [**AlertSuppressionWindowState**](AlertSuppressionWindowState.md) | | [optional] +**start_date** | **datetime** | The date/time when the alert suppression window starts (ISO date-time format). | [optional] +**duration** | **int** | Duration in seconds the suppression window is active. | [optional] +**repeat** | [**Repeat**](Repeat.md) | | [optional] +**end_repeat** | [**EndRepeat**](EndRepeat.md) | | [optional] +**tests** | [**List[BaseTest]**](BaseTest.md) | List of tests assigned to the alert suppression window. | [optional] + +## Example + +```python +from alerts_api.models.complete_alert_suppression_window import CompleteAlertSuppressionWindow + +# TODO update the JSON string below +json = "{}" +# create an instance of CompleteAlertSuppressionWindow from a JSON string +complete_alert_suppression_window_instance = CompleteAlertSuppressionWindow.from_json(json) +# print the JSON string representation of the object +print CompleteAlertSuppressionWindow.to_json() + +# convert the object into a dict +complete_alert_suppression_window_dict = complete_alert_suppression_window_instance.to_dict() +# create an instance of CompleteAlertSuppressionWindow from a dict +complete_alert_suppression_window_form_dict = complete_alert_suppression_window.from_dict(complete_alert_suppression_window_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/CreateAlertRule201Response.md b/alerts_api/docs/CreateAlertRule201Response.md new file mode 100644 index 00000000..69a2b494 --- /dev/null +++ b/alerts_api/docs/CreateAlertRule201Response.md @@ -0,0 +1,44 @@ +# CreateAlertRule201Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rule_id** | **str** | Unique ID of the rule. | [optional] [readonly] +**rule_name** | **str** | Name of the alert rule. | +**expression** | **str** | The expression of the alert rule. | +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**notify_on_clear** | **bool** | Send notification when alert clears. | [optional] +**is_default** | **bool** | If set to `true`, this alert rule becomes the default for its test type and is automatically applied to newly created tests with relevant metrics. Only one default alert rule is allowed per test type. | [optional] +**alert_type** | [**AlertType**](AlertType.md) | | +**minimum_sources** | **int** | The minimum number of agents or monitors that must meet the specified criteria to trigger the alert. | [optional] +**minimum_sources_pct** | **int** | The minimum percentage of all assigned agents or monitors that must meet the specified criteria to trigger the alert. | [optional] +**rounds_violating_mode** | [**AlertRoundsViolationMode**](AlertRoundsViolationMode.md) | | [optional] +**rounds_violating_out_of** | **int** | Specifies the divisor (y value) in the “X of Y times” condition. | +**rounds_violating_required** | **int** | Specifies the numerator (x value) in the “X of Y times” condition. | +**include_covered_prefixes** | **bool** | Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules. | [optional] +**severity** | [**Severity**](Severity.md) | | [optional] +**notifications** | [**Notification**](Notification.md) | | [optional] +**test_ids** | **List[str]** | Array of test IDs to link to alert rule (get `testId` from `/tests` endpoint). | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from alerts_api.models.create_alert_rule201_response import CreateAlertRule201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateAlertRule201Response from a JSON string +create_alert_rule201_response_instance = CreateAlertRule201Response.from_json(json) +# print the JSON string representation of the object +print CreateAlertRule201Response.to_json() + +# convert the object into a dict +create_alert_rule201_response_dict = create_alert_rule201_response_instance.to_dict() +# create an instance of CreateAlertRule201Response from a dict +create_alert_rule201_response_form_dict = create_alert_rule201_response.from_dict(create_alert_rule201_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/CreateSuppressionWindows201Response.md b/alerts_api/docs/CreateSuppressionWindows201Response.md new file mode 100644 index 00000000..245b113f --- /dev/null +++ b/alerts_api/docs/CreateSuppressionWindows201Response.md @@ -0,0 +1,37 @@ +# CreateSuppressionWindows201Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alert_suppression_window_id** | **str** | Unique ID of the alert suppression window. | [optional] [readonly] +**name** | **str** | Name of the alert suppression window. | [optional] +**is_enabled** | **bool** | Set to `false` for `disabled`, `true` for `enabled`. | [optional] +**status** | [**AlertSuppressionWindowState**](AlertSuppressionWindowState.md) | | [optional] +**start_date** | **datetime** | The date/time when the alert suppression window starts (ISO date-time format). | [optional] +**duration** | **int** | Duration in seconds the suppression window is active. | [optional] +**repeat** | [**Repeat**](Repeat.md) | | [optional] +**end_repeat** | [**EndRepeat**](EndRepeat.md) | | [optional] +**tests** | [**List[BaseTest]**](BaseTest.md) | List of tests assigned to the alert suppression window. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from alerts_api.models.create_suppression_windows201_response import CreateSuppressionWindows201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSuppressionWindows201Response from a JSON string +create_suppression_windows201_response_instance = CreateSuppressionWindows201Response.from_json(json) +# print the JSON string representation of the object +print CreateSuppressionWindows201Response.to_json() + +# convert the object into a dict +create_suppression_windows201_response_dict = create_suppression_windows201_response_instance.to_dict() +# create an instance of CreateSuppressionWindows201Response from a dict +create_suppression_windows201_response_form_dict = create_suppression_windows201_response.from_dict(create_suppression_windows201_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/DaysOfWeek.md b/alerts_api/docs/DaysOfWeek.md new file mode 100644 index 00000000..7fd0e207 --- /dev/null +++ b/alerts_api/docs/DaysOfWeek.md @@ -0,0 +1,11 @@ +# DaysOfWeek + +Specifies the day to activate the alert suppression window. Applicable only when `intervalType` is set to `week`. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/EndRepeat.md b/alerts_api/docs/EndRepeat.md new file mode 100644 index 00000000..1736a62a --- /dev/null +++ b/alerts_api/docs/EndRepeat.md @@ -0,0 +1,31 @@ +# EndRepeat + +End repeat options. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**EndRepeatType**](EndRepeatType.md) | | [optional] +**count** | **int** | End repeat after number of occurrences, only valid with count type option. | [optional] +**var_date** | **date** | End repeat after specific date, only valid with date type option (ISO date format). | [optional] + +## Example + +```python +from alerts_api.models.end_repeat import EndRepeat + +# TODO update the JSON string below +json = "{}" +# create an instance of EndRepeat from a JSON string +end_repeat_instance = EndRepeat.from_json(json) +# print the JSON string representation of the object +print EndRepeat.to_json() + +# convert the object into a dict +end_repeat_dict = end_repeat_instance.to_dict() +# create an instance of EndRepeat from a dict +end_repeat_form_dict = end_repeat.from_dict(end_repeat_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/EndRepeatType.md b/alerts_api/docs/EndRepeatType.md new file mode 100644 index 00000000..ea650a6f --- /dev/null +++ b/alerts_api/docs/EndRepeatType.md @@ -0,0 +1,11 @@ +# EndRepeatType + +End repeat options type. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/Error.md b/alerts_api/docs/Error.md new file mode 100644 index 00000000..80301177 --- /dev/null +++ b/alerts_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from alerts_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/Expand.md b/alerts_api/docs/Expand.md new file mode 100644 index 00000000..5d5b5ca2 --- /dev/null +++ b/alerts_api/docs/Expand.md @@ -0,0 +1,10 @@ +# Expand + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/GetAlertRuleDetails200Response.md b/alerts_api/docs/GetAlertRuleDetails200Response.md new file mode 100644 index 00000000..980ad997 --- /dev/null +++ b/alerts_api/docs/GetAlertRuleDetails200Response.md @@ -0,0 +1,44 @@ +# GetAlertRuleDetails200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rule_id** | **str** | Unique ID of the rule. | [optional] [readonly] +**rule_name** | **str** | Name of the alert rule. | +**expression** | **str** | The expression of the alert rule. | +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**notify_on_clear** | **bool** | Send notification when alert clears. | [optional] +**is_default** | **bool** | If set to `true`, this alert rule becomes the default for its test type and is automatically applied to newly created tests with relevant metrics. Only one default alert rule is allowed per test type. | [optional] +**alert_type** | [**AlertType**](AlertType.md) | | +**minimum_sources** | **int** | The minimum number of agents or monitors that must meet the specified criteria to trigger the alert. | [optional] +**minimum_sources_pct** | **int** | The minimum percentage of all assigned agents or monitors that must meet the specified criteria to trigger the alert. | [optional] +**rounds_violating_mode** | [**AlertRoundsViolationMode**](AlertRoundsViolationMode.md) | | [optional] +**rounds_violating_out_of** | **int** | Specifies the divisor (y value) in the “X of Y times” condition. | +**rounds_violating_required** | **int** | Specifies the numerator (x value) in the “X of Y times” condition. | +**include_covered_prefixes** | **bool** | Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules. | [optional] +**severity** | [**Severity**](Severity.md) | | [optional] +**notifications** | [**Notification**](Notification.md) | | [optional] +**tests** | [**List[BaseTest]**](BaseTest.md) | | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from alerts_api.models.get_alert_rule_details200_response import GetAlertRuleDetails200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAlertRuleDetails200Response from a JSON string +get_alert_rule_details200_response_instance = GetAlertRuleDetails200Response.from_json(json) +# print the JSON string representation of the object +print GetAlertRuleDetails200Response.to_json() + +# convert the object into a dict +get_alert_rule_details200_response_dict = get_alert_rule_details200_response_instance.to_dict() +# create an instance of GetAlertRuleDetails200Response from a dict +get_alert_rule_details200_response_form_dict = get_alert_rule_details200_response.from_dict(get_alert_rule_details200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/GetAlerts200Response.md b/alerts_api/docs/GetAlerts200Response.md new file mode 100644 index 00000000..d1996a9d --- /dev/null +++ b/alerts_api/docs/GetAlerts200Response.md @@ -0,0 +1,29 @@ +# GetAlerts200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alerts** | [**List[Alert]**](Alert.md) | | [optional] +**links** | [**PaginationLinksLinks**](PaginationLinksLinks.md) | | [optional] + +## Example + +```python +from alerts_api.models.get_alerts200_response import GetAlerts200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAlerts200Response from a JSON string +get_alerts200_response_instance = GetAlerts200Response.from_json(json) +# print the JSON string representation of the object +print GetAlerts200Response.to_json() + +# convert the object into a dict +get_alerts200_response_dict = get_alerts200_response_instance.to_dict() +# create an instance of GetAlerts200Response from a dict +get_alerts200_response_form_dict = get_alerts200_response.from_dict(get_alerts200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/GetAlertsRules200Response.md b/alerts_api/docs/GetAlertsRules200Response.md new file mode 100644 index 00000000..be5d26e0 --- /dev/null +++ b/alerts_api/docs/GetAlertsRules200Response.md @@ -0,0 +1,29 @@ +# GetAlertsRules200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alert_rules** | [**List[Rule]**](Rule.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from alerts_api.models.get_alerts_rules200_response import GetAlertsRules200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAlertsRules200Response from a JSON string +get_alerts_rules200_response_instance = GetAlertsRules200Response.from_json(json) +# print the JSON string representation of the object +print GetAlertsRules200Response.to_json() + +# convert the object into a dict +get_alerts_rules200_response_dict = get_alerts_rules200_response_instance.to_dict() +# create an instance of GetAlertsRules200Response from a dict +get_alerts_rules200_response_form_dict = get_alerts_rules200_response.from_dict(get_alerts_rules200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/GetSuppressionWindows200Response.md b/alerts_api/docs/GetSuppressionWindows200Response.md new file mode 100644 index 00000000..90d8553b --- /dev/null +++ b/alerts_api/docs/GetSuppressionWindows200Response.md @@ -0,0 +1,29 @@ +# GetSuppressionWindows200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alert_suppression_windows** | [**List[AlertSuppressionWindowsAlertSuppressionWindowsInner]**](AlertSuppressionWindowsAlertSuppressionWindowsInner.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from alerts_api.models.get_suppression_windows200_response import GetSuppressionWindows200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetSuppressionWindows200Response from a JSON string +get_suppression_windows200_response_instance = GetSuppressionWindows200Response.from_json(json) +# print the JSON string representation of the object +print GetSuppressionWindows200Response.to_json() + +# convert the object into a dict +get_suppression_windows200_response_dict = get_suppression_windows200_response_instance.to_dict() +# create an instance of GetSuppressionWindows200Response from a dict +get_suppression_windows200_response_form_dict = get_suppression_windows200_response.from_dict(get_suppression_windows200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/IntervalType.md b/alerts_api/docs/IntervalType.md new file mode 100644 index 00000000..4ab6e755 --- /dev/null +++ b/alerts_api/docs/IntervalType.md @@ -0,0 +1,11 @@ +# IntervalType + +Repeat options interval type + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/Link.md b/alerts_api/docs/Link.md new file mode 100644 index 00000000..4289c348 --- /dev/null +++ b/alerts_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from alerts_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/Notification.md b/alerts_api/docs/Notification.md new file mode 100644 index 00000000..bebecaf4 --- /dev/null +++ b/alerts_api/docs/Notification.md @@ -0,0 +1,31 @@ +# Notification + +Alert notification object. See Alert notification integrations. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | [**NotificationEmail**](NotificationEmail.md) | | [optional] +**third_party** | [**List[NotificationThirdParty]**](NotificationThirdParty.md) | Third party notifications. | [optional] +**webhook** | [**List[NotificationWebhook]**](NotificationWebhook.md) | Webhooks notifications. | [optional] + +## Example + +```python +from alerts_api.models.notification import Notification + +# TODO update the JSON string below +json = "{}" +# create an instance of Notification from a JSON string +notification_instance = Notification.from_json(json) +# print the JSON string representation of the object +print Notification.to_json() + +# convert the object into a dict +notification_dict = notification_instance.to_dict() +# create an instance of Notification from a dict +notification_form_dict = notification.from_dict(notification_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/NotificationEmail.md b/alerts_api/docs/NotificationEmail.md new file mode 100644 index 00000000..0bf611e2 --- /dev/null +++ b/alerts_api/docs/NotificationEmail.md @@ -0,0 +1,30 @@ +# NotificationEmail + +Email notifications. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**recipients** | **List[str]** | An array containing the email addresses to receive notifications. | [optional] +**message** | **str** | Custom text included in alert email notifications sent to recipients. | [optional] + +## Example + +```python +from alerts_api.models.notification_email import NotificationEmail + +# TODO update the JSON string below +json = "{}" +# create an instance of NotificationEmail from a JSON string +notification_email_instance = NotificationEmail.from_json(json) +# print the JSON string representation of the object +print NotificationEmail.to_json() + +# convert the object into a dict +notification_email_dict = notification_email_instance.to_dict() +# create an instance of NotificationEmail from a dict +notification_email_form_dict = notification_email.from_dict(notification_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) + + diff --git a/alerts_api/docs/NotificationThirdParty.md b/alerts_api/docs/NotificationThirdParty.md new file mode 100644 index 00000000..236092a7 --- /dev/null +++ b/alerts_api/docs/NotificationThirdParty.md @@ -0,0 +1,30 @@ +# NotificationThirdParty + +Webhook notification. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integration_id** | **List[str]** | Integration ID. | [optional] +**integration_type** | [**ThirdPartyIntegrationType**](ThirdPartyIntegrationType.md) | | [optional] + +## Example + +```python +from alerts_api.models.notification_third_party import NotificationThirdParty + +# TODO update the JSON string below +json = "{}" +# create an instance of NotificationThirdParty from a JSON string +notification_third_party_instance = NotificationThirdParty.from_json(json) +# print the JSON string representation of the object +print NotificationThirdParty.to_json() + +# convert the object into a dict +notification_third_party_dict = notification_third_party_instance.to_dict() +# create an instance of NotificationThirdParty from a dict +notification_third_party_form_dict = notification_third_party.from_dict(notification_third_party_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/NotificationWebhook.md b/alerts_api/docs/NotificationWebhook.md new file mode 100644 index 00000000..a2bacd5d --- /dev/null +++ b/alerts_api/docs/NotificationWebhook.md @@ -0,0 +1,30 @@ +# NotificationWebhook + +Webhook notification. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integration_id** | **List[str]** | Integration ID. | [optional] +**integration_type** | [**WebhookIntegrationType**](WebhookIntegrationType.md) | | [optional] + +## Example + +```python +from alerts_api.models.notification_webhook import NotificationWebhook + +# TODO update the JSON string below +json = "{}" +# create an instance of NotificationWebhook from a JSON string +notification_webhook_instance = NotificationWebhook.from_json(json) +# print the JSON string representation of the object +print NotificationWebhook.to_json() + +# convert the object into a dict +notification_webhook_dict = notification_webhook_instance.to_dict() +# create an instance of NotificationWebhook from a dict +notification_webhook_form_dict = notification_webhook.from_dict(notification_webhook_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/PaginationLinks.md b/alerts_api/docs/PaginationLinks.md new file mode 100644 index 00000000..8c1095b5 --- /dev/null +++ b/alerts_api/docs/PaginationLinks.md @@ -0,0 +1,29 @@ +# PaginationLinks + +A links object containing pagination related link(s). + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**PaginationLinksLinks**](PaginationLinksLinks.md) | | [optional] + +## Example + +```python +from alerts_api.models.pagination_links import PaginationLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationLinks from a JSON string +pagination_links_instance = PaginationLinks.from_json(json) +# print the JSON string representation of the object +print PaginationLinks.to_json() + +# convert the object into a dict +pagination_links_dict = pagination_links_instance.to_dict() +# create an instance of PaginationLinks from a dict +pagination_links_form_dict = pagination_links.from_dict(pagination_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/PaginationLinksLinks.md b/alerts_api/docs/PaginationLinksLinks.md new file mode 100644 index 00000000..46be6625 --- /dev/null +++ b/alerts_api/docs/PaginationLinksLinks.md @@ -0,0 +1,29 @@ +# PaginationLinksLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**previous** | [**Link**](Link.md) | | [optional] +**next** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from alerts_api.models.pagination_links_links import PaginationLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationLinksLinks from a JSON string +pagination_links_links_instance = PaginationLinksLinks.from_json(json) +# print the JSON string representation of the object +print PaginationLinksLinks.to_json() + +# convert the object into a dict +pagination_links_links_dict = pagination_links_links_instance.to_dict() +# create an instance of PaginationLinksLinks from a dict +pagination_links_links_form_dict = pagination_links_links.from_dict(pagination_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/Repeat.md b/alerts_api/docs/Repeat.md new file mode 100644 index 00000000..442a2a67 --- /dev/null +++ b/alerts_api/docs/Repeat.md @@ -0,0 +1,32 @@ +# Repeat + +Repeat options. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**RepeatType**](RepeatType.md) | | [optional] +**interval_type** | [**IntervalType**](IntervalType.md) | | [optional] +**interval_length** | **int** | Number of `intervalTypes` to wait before reactivating the alert suppression window. | [optional] +**days_of_week** | [**List[DaysOfWeek]**](DaysOfWeek.md) | | [optional] + +## Example + +```python +from alerts_api.models.repeat import Repeat + +# TODO update the JSON string below +json = "{}" +# create an instance of Repeat from a JSON string +repeat_instance = Repeat.from_json(json) +# print the JSON string representation of the object +print Repeat.to_json() + +# convert the object into a dict +repeat_dict = repeat_instance.to_dict() +# create an instance of Repeat from a dict +repeat_form_dict = repeat.from_dict(repeat_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/RepeatType.md b/alerts_api/docs/RepeatType.md new file mode 100644 index 00000000..4ac64d65 --- /dev/null +++ b/alerts_api/docs/RepeatType.md @@ -0,0 +1,11 @@ +# RepeatType + +Repeat options type. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/Rule.md b/alerts_api/docs/Rule.md new file mode 100644 index 00000000..df0c9606 --- /dev/null +++ b/alerts_api/docs/Rule.md @@ -0,0 +1,41 @@ +# Rule + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rule_id** | **str** | Unique ID of the rule. | [optional] [readonly] +**rule_name** | **str** | Name of the alert rule. | +**expression** | **str** | The expression of the alert rule. | +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**notify_on_clear** | **bool** | Send notification when alert clears. | [optional] +**is_default** | **bool** | If set to `true`, this alert rule becomes the default for its test type and is automatically applied to newly created tests with relevant metrics. Only one default alert rule is allowed per test type. | [optional] +**alert_type** | [**AlertType**](AlertType.md) | | +**minimum_sources** | **int** | The minimum number of agents or monitors that must meet the specified criteria to trigger the alert. | [optional] +**minimum_sources_pct** | **int** | The minimum percentage of all assigned agents or monitors that must meet the specified criteria to trigger the alert. | [optional] +**rounds_violating_mode** | [**AlertRoundsViolationMode**](AlertRoundsViolationMode.md) | | [optional] +**rounds_violating_out_of** | **int** | Specifies the divisor (y value) in the “X of Y times” condition. | +**rounds_violating_required** | **int** | Specifies the numerator (x value) in the “X of Y times” condition. | +**include_covered_prefixes** | **bool** | Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules. | [optional] +**severity** | [**Severity**](Severity.md) | | [optional] + +## Example + +```python +from alerts_api.models.rule import Rule + +# TODO update the JSON string below +json = "{}" +# create an instance of Rule from a JSON string +rule_instance = Rule.from_json(json) +# print the JSON string representation of the object +print Rule.to_json() + +# convert the object into a dict +rule_dict = rule_instance.to_dict() +# create an instance of Rule from a dict +rule_form_dict = rule.from_dict(rule_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/RuleDetail.md b/alerts_api/docs/RuleDetail.md new file mode 100644 index 00000000..a92fa324 --- /dev/null +++ b/alerts_api/docs/RuleDetail.md @@ -0,0 +1,43 @@ +# RuleDetail + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rule_id** | **str** | Unique ID of the rule. | [optional] [readonly] +**rule_name** | **str** | Name of the alert rule. | +**expression** | **str** | The expression of the alert rule. | +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**notify_on_clear** | **bool** | Send notification when alert clears. | [optional] +**is_default** | **bool** | If set to `true`, this alert rule becomes the default for its test type and is automatically applied to newly created tests with relevant metrics. Only one default alert rule is allowed per test type. | [optional] +**alert_type** | [**AlertType**](AlertType.md) | | +**minimum_sources** | **int** | The minimum number of agents or monitors that must meet the specified criteria to trigger the alert. | [optional] +**minimum_sources_pct** | **int** | The minimum percentage of all assigned agents or monitors that must meet the specified criteria to trigger the alert. | [optional] +**rounds_violating_mode** | [**AlertRoundsViolationMode**](AlertRoundsViolationMode.md) | | [optional] +**rounds_violating_out_of** | **int** | Specifies the divisor (y value) in the “X of Y times” condition. | +**rounds_violating_required** | **int** | Specifies the numerator (x value) in the “X of Y times” condition. | +**include_covered_prefixes** | **bool** | Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules. | [optional] +**severity** | [**Severity**](Severity.md) | | [optional] +**notifications** | [**Notification**](Notification.md) | | [optional] +**tests** | [**List[BaseTest]**](BaseTest.md) | | [optional] [readonly] + +## Example + +```python +from alerts_api.models.rule_detail import RuleDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of RuleDetail from a JSON string +rule_detail_instance = RuleDetail.from_json(json) +# print the JSON string representation of the object +print RuleDetail.to_json() + +# convert the object into a dict +rule_detail_dict = rule_detail_instance.to_dict() +# create an instance of RuleDetail from a dict +rule_detail_form_dict = rule_detail.from_dict(rule_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/RuleDetailUpdate.md b/alerts_api/docs/RuleDetailUpdate.md new file mode 100644 index 00000000..0b19b42d --- /dev/null +++ b/alerts_api/docs/RuleDetailUpdate.md @@ -0,0 +1,43 @@ +# RuleDetailUpdate + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rule_id** | **str** | Unique ID of the rule. | [optional] [readonly] +**rule_name** | **str** | Name of the alert rule. | +**expression** | **str** | The expression of the alert rule. | +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**notify_on_clear** | **bool** | Send notification when alert clears. | [optional] +**is_default** | **bool** | If set to `true`, this alert rule becomes the default for its test type and is automatically applied to newly created tests with relevant metrics. Only one default alert rule is allowed per test type. | [optional] +**alert_type** | [**AlertType**](AlertType.md) | | +**minimum_sources** | **int** | The minimum number of agents or monitors that must meet the specified criteria to trigger the alert. | [optional] +**minimum_sources_pct** | **int** | The minimum percentage of all assigned agents or monitors that must meet the specified criteria to trigger the alert. | [optional] +**rounds_violating_mode** | [**AlertRoundsViolationMode**](AlertRoundsViolationMode.md) | | [optional] +**rounds_violating_out_of** | **int** | Specifies the divisor (y value) in the “X of Y times” condition. | +**rounds_violating_required** | **int** | Specifies the numerator (x value) in the “X of Y times” condition. | +**include_covered_prefixes** | **bool** | Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules. | [optional] +**severity** | [**Severity**](Severity.md) | | [optional] +**notifications** | [**Notification**](Notification.md) | | [optional] +**test_ids** | **List[str]** | Array of test IDs to link to alert rule (get `testId` from `/tests` endpoint). | [optional] + +## Example + +```python +from alerts_api.models.rule_detail_update import RuleDetailUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of RuleDetailUpdate from a JSON string +rule_detail_update_instance = RuleDetailUpdate.from_json(json) +# print the JSON string representation of the object +print RuleDetailUpdate.to_json() + +# convert the object into a dict +rule_detail_update_dict = rule_detail_update_instance.to_dict() +# create an instance of RuleDetailUpdate from a dict +rule_detail_update_form_dict = rule_detail_update.from_dict(rule_detail_update_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/RuleLinks.md b/alerts_api/docs/RuleLinks.md new file mode 100644 index 00000000..a26ab9d7 --- /dev/null +++ b/alerts_api/docs/RuleLinks.md @@ -0,0 +1,28 @@ +# RuleLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**RuleLinksLinks**](RuleLinksLinks.md) | | [optional] + +## Example + +```python +from alerts_api.models.rule_links import RuleLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of RuleLinks from a JSON string +rule_links_instance = RuleLinks.from_json(json) +# print the JSON string representation of the object +print RuleLinks.to_json() + +# convert the object into a dict +rule_links_dict = rule_links_instance.to_dict() +# create an instance of RuleLinks from a dict +rule_links_form_dict = rule_links.from_dict(rule_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/RuleLinksLinks.md b/alerts_api/docs/RuleLinksLinks.md new file mode 100644 index 00000000..9e3723d6 --- /dev/null +++ b/alerts_api/docs/RuleLinksLinks.md @@ -0,0 +1,29 @@ +# RuleLinksLinks + +An object containing the alert rule links. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rule** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from alerts_api.models.rule_links_links import RuleLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of RuleLinksLinks from a JSON string +rule_links_links_instance = RuleLinksLinks.from_json(json) +# print the JSON string representation of the object +print RuleLinksLinks.to_json() + +# convert the object into a dict +rule_links_links_dict = rule_links_links_instance.to_dict() +# create an instance of RuleLinksLinks from a dict +rule_links_links_form_dict = rule_links_links.from_dict(rule_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/Rules.md b/alerts_api/docs/Rules.md new file mode 100644 index 00000000..b958300d --- /dev/null +++ b/alerts_api/docs/Rules.md @@ -0,0 +1,28 @@ +# Rules + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alert_rules** | [**List[Rule]**](Rule.md) | | [optional] + +## Example + +```python +from alerts_api.models.rules import Rules + +# TODO update the JSON string below +json = "{}" +# create an instance of Rules from a JSON string +rules_instance = Rules.from_json(json) +# print the JSON string representation of the object +print Rules.to_json() + +# convert the object into a dict +rules_dict = rules_instance.to_dict() +# create an instance of Rules from a dict +rules_form_dict = rules.from_dict(rules_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/SelfLinks.md b/alerts_api/docs/SelfLinks.md new file mode 100644 index 00000000..11975293 --- /dev/null +++ b/alerts_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from alerts_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/SelfLinksLinks.md b/alerts_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..13033bbf --- /dev/null +++ b/alerts_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from alerts_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/Severity.md b/alerts_api/docs/Severity.md new file mode 100644 index 00000000..4d7d130f --- /dev/null +++ b/alerts_api/docs/Severity.md @@ -0,0 +1,11 @@ +# Severity + +The severity of the alert. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/State.md b/alerts_api/docs/State.md new file mode 100644 index 00000000..ae4cac45 --- /dev/null +++ b/alerts_api/docs/State.md @@ -0,0 +1,11 @@ +# State + +Current state of the alert. Possible values: clear or trigger. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/TestDirection.md b/alerts_api/docs/TestDirection.md new file mode 100644 index 00000000..59dab3fb --- /dev/null +++ b/alerts_api/docs/TestDirection.md @@ -0,0 +1,11 @@ +# TestDirection + +Direction of the test, which affects how results are shown. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/TestInterval.md b/alerts_api/docs/TestInterval.md new file mode 100644 index 00000000..e0e57d69 --- /dev/null +++ b/alerts_api/docs/TestInterval.md @@ -0,0 +1,11 @@ +# TestInterval + +Interval between test runs in seconds. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/ThirdPartyIntegrationType.md b/alerts_api/docs/ThirdPartyIntegrationType.md new file mode 100644 index 00000000..cf3b8357 --- /dev/null +++ b/alerts_api/docs/ThirdPartyIntegrationType.md @@ -0,0 +1,11 @@ +# ThirdPartyIntegrationType + +Integration type. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/UnauthorizedError.md b/alerts_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..cd116fef --- /dev/null +++ b/alerts_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from alerts_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/UnexpandedTest.md b/alerts_api/docs/UnexpandedTest.md new file mode 100644 index 00000000..c5228c8f --- /dev/null +++ b/alerts_api/docs/UnexpandedTest.md @@ -0,0 +1,30 @@ +# UnexpandedTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] + +## Example + +```python +from alerts_api.models.unexpanded_test import UnexpandedTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedTest from a JSON string +unexpanded_test_instance = UnexpandedTest.from_json(json) +# print the JSON string representation of the object +print UnexpandedTest.to_json() + +# convert the object into a dict +unexpanded_test_dict = unexpanded_test_instance.to_dict() +# create an instance of UnexpandedTest from a dict +unexpanded_test_form_dict = unexpanded_test.from_dict(unexpanded_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/docs/WebhookIntegrationType.md b/alerts_api/docs/WebhookIntegrationType.md new file mode 100644 index 00000000..7aa89505 --- /dev/null +++ b/alerts_api/docs/WebhookIntegrationType.md @@ -0,0 +1,11 @@ +# WebhookIntegrationType + +Integration type. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/alerts_api/git_push.sh b/alerts_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/alerts_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/alerts_api/pyproject.toml b/alerts_api/pyproject.toml new file mode 100644 index 00000000..556da7f7 --- /dev/null +++ b/alerts_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "alerts_api" +version = "1.0.0" +description = "Alerts API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Alerts API"] +include = ["alerts_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/alerts_api/requirements.txt b/alerts_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/alerts_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/alerts_api/setup.cfg b/alerts_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/alerts_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/alerts_api/setup.py b/alerts_api/setup.py new file mode 100644 index 00000000..3580872e --- /dev/null +++ b/alerts_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "alerts-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Alerts API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Alerts API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + ## Overview Manage all alerts, alert rules and alert suppression windows. + """, # noqa: E501 + package_data={"alerts_api": ["py.typed"]}, +) diff --git a/alerts_api/test-requirements.txt b/alerts_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/alerts_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/alerts_api/test/__init__.py b/alerts_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/alerts_api/test/test_alert.py b/alerts_api/test/test_alert.py new file mode 100644 index 00000000..35e95ab6 --- /dev/null +++ b/alerts_api/test/test_alert.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert import Alert + +class TestAlert(unittest.TestCase): + """Alert unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Alert: + """Test Alert + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Alert` + """ + model = Alert() + if include_optional: + return Alert( + id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569', + alert_type = 'http-server', + start_date = '2020-04-23T13:43:16Z', + end_date = '2020-04-23T13:43:16Z', + violation_count = 2, + duration = 60, + links = alerts_api.models.rule_links__links.RuleLinks__links( + rule = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + alert_rule_id = '127094', + alert_state = 'active', + alert_severity = 'major' + ) + else: + return Alert( + ) + """ + + def testAlert(self): + """Test Alert""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_detail.py b/alerts_api/test/test_alert_detail.py new file mode 100644 index 00000000..e626892d --- /dev/null +++ b/alerts_api/test/test_alert_detail.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_detail import AlertDetail + +class TestAlertDetail(unittest.TestCase): + """AlertDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertDetail: + """Test AlertDetail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertDetail` + """ + model = AlertDetail() + if include_optional: + return AlertDetail( + id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569', + alert_type = 'http-server', + start_date = '2020-04-23T13:43:16Z', + end_date = '2020-04-23T13:43:16Z', + violation_count = 2, + duration = 60, + links = alerts_api.models.rule_links__links.RuleLinks__links( + rule = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + state = 'active', + severity = 'major', + details = [ + alerts_api.models.alert_metric_detail.AlertMetricDetail( + end = null, + id = '3379', + name = 'Bucharest, Romania', + start = null, + state = 'active', + type = 'cea_agent', ) + ] + ) + else: + return AlertDetail( + ) + """ + + def testAlertDetail(self): + """Test AlertDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_links.py b/alerts_api/test/test_alert_links.py new file mode 100644 index 00000000..dba8c0d5 --- /dev/null +++ b/alerts_api/test/test_alert_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_links import AlertLinks + +class TestAlertLinks(unittest.TestCase): + """AlertLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertLinks: + """Test AlertLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertLinks` + """ + model = AlertLinks() + if include_optional: + return AlertLinks( + links = alerts_api.models.rule_links__links.RuleLinks__links( + rule = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return AlertLinks( + ) + """ + + def testAlertLinks(self): + """Test AlertLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_metric_detail.py b/alerts_api/test/test_alert_metric_detail.py new file mode 100644 index 00000000..4bfc6ecd --- /dev/null +++ b/alerts_api/test/test_alert_metric_detail.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_metric_detail import AlertMetricDetail + +class TestAlertMetricDetail(unittest.TestCase): + """AlertMetricDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertMetricDetail: + """Test AlertMetricDetail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertMetricDetail` + """ + model = AlertMetricDetail() + if include_optional: + return AlertMetricDetail( + end = None, + id = '3379', + name = 'Bucharest, Romania', + start = None, + state = 'active', + type = 'cea_agent' + ) + else: + return AlertMetricDetail( + ) + """ + + def testAlertMetricDetail(self): + """Test AlertMetricDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_metric_detail_end.py b/alerts_api/test/test_alert_metric_detail_end.py new file mode 100644 index 00000000..6d60e0c5 --- /dev/null +++ b/alerts_api/test/test_alert_metric_detail_end.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_metric_detail_end import AlertMetricDetailEnd + +class TestAlertMetricDetailEnd(unittest.TestCase): + """AlertMetricDetailEnd unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertMetricDetailEnd: + """Test AlertMetricDetailEnd + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertMetricDetailEnd` + """ + model = AlertMetricDetailEnd() + if include_optional: + return AlertMetricDetailEnd( + metrics = '' + ) + else: + return AlertMetricDetailEnd( + ) + """ + + def testAlertMetricDetailEnd(self): + """Test AlertMetricDetailEnd""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_metric_detail_start.py b/alerts_api/test/test_alert_metric_detail_start.py new file mode 100644 index 00000000..0f68c554 --- /dev/null +++ b/alerts_api/test/test_alert_metric_detail_start.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_metric_detail_start import AlertMetricDetailStart + +class TestAlertMetricDetailStart(unittest.TestCase): + """AlertMetricDetailStart unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertMetricDetailStart: + """Test AlertMetricDetailStart + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertMetricDetailStart` + """ + model = AlertMetricDetailStart() + if include_optional: + return AlertMetricDetailStart( + metrics = '' + ) + else: + return AlertMetricDetailStart( + ) + """ + + def testAlertMetricDetailStart(self): + """Test AlertMetricDetailStart""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_metrics.py b/alerts_api/test/test_alert_metrics.py new file mode 100644 index 00000000..97a2ad7a --- /dev/null +++ b/alerts_api/test/test_alert_metrics.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_metrics import AlertMetrics + +class TestAlertMetrics(unittest.TestCase): + """AlertMetrics unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertMetrics: + """Test AlertMetrics + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertMetrics` + """ + model = AlertMetrics() + if include_optional: + return AlertMetrics( + metrics = '' + ) + else: + return AlertMetrics( + ) + """ + + def testAlertMetrics(self): + """Test AlertMetrics""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_rounds_violation_mode.py b/alerts_api/test/test_alert_rounds_violation_mode.py new file mode 100644 index 00000000..49e94f57 --- /dev/null +++ b/alerts_api/test/test_alert_rounds_violation_mode.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_rounds_violation_mode import AlertRoundsViolationMode + +class TestAlertRoundsViolationMode(unittest.TestCase): + """AlertRoundsViolationMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAlertRoundsViolationMode(self): + """Test AlertRoundsViolationMode""" + # inst = AlertRoundsViolationMode() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_rule.py b/alerts_api/test/test_alert_rule.py new file mode 100644 index 00000000..392c0362 --- /dev/null +++ b/alerts_api/test/test_alert_rule.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_rule import AlertRule + +class TestAlertRule(unittest.TestCase): + """AlertRule unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertRule: + """Test AlertRule + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertRule` + """ + model = AlertRule() + if include_optional: + return AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2 + ) + else: + return AlertRule( + ) + """ + + def testAlertRule(self): + """Test AlertRule""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_rules_api.py b/alerts_api/test/test_alert_rules_api.py new file mode 100644 index 00000000..b5f37df1 --- /dev/null +++ b/alerts_api/test/test_alert_rules_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest + +from alerts_api.api.alert_rules_api import AlertRulesApi + + +class TestAlertRulesApi(unittest.TestCase): + """AlertRulesApi unit test stubs""" + + def setUp(self) -> None: + self.api = AlertRulesApi() + + def tearDown(self) -> None: + pass + + def test_create_alert_rule(self) -> None: + """Test case for create_alert_rule + + Create alert rule + """ + pass + + def test_delete_alert_rule(self) -> None: + """Test case for delete_alert_rule + + Delete alert rule + """ + pass + + def test_get_alert_rule_details(self) -> None: + """Test case for get_alert_rule_details + + Retrieve alert rule + """ + pass + + def test_get_alerts_rules(self) -> None: + """Test case for get_alerts_rules + + List alert rules + """ + pass + + def test_update_alert_rule(self) -> None: + """Test case for update_alert_rule + + Update alert rule + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_suppression_window.py b/alerts_api/test/test_alert_suppression_window.py new file mode 100644 index 00000000..ee512662 --- /dev/null +++ b/alerts_api/test/test_alert_suppression_window.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_suppression_window import AlertSuppressionWindow + +class TestAlertSuppressionWindow(unittest.TestCase): + """AlertSuppressionWindow unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertSuppressionWindow: + """Test AlertSuppressionWindow + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertSuppressionWindow` + """ + model = AlertSuppressionWindow() + if include_optional: + return AlertSuppressionWindow( + alert_suppression_window_id = '2411', + name = 'Monthly maintenance', + is_enabled = False, + status = 'ended', + start_date = '2017-07-01T05:00Z', + duration = 0, + repeat = alerts_api.models.repeat.Repeat( + type = 'week', + interval_type = 'day', + interval_length = 2, + days_of_week = [ + 'sun' + ], ), + end_repeat = alerts_api.models.end_repeat.EndRepeat( + type = 'never', + count = 3, + date = 'Sat Jul 01 01:00:00 BST 2017', ) + ) + else: + return AlertSuppressionWindow( + ) + """ + + def testAlertSuppressionWindow(self): + """Test AlertSuppressionWindow""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_suppression_window_request.py b/alerts_api/test/test_alert_suppression_window_request.py new file mode 100644 index 00000000..c948bf7a --- /dev/null +++ b/alerts_api/test/test_alert_suppression_window_request.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_suppression_window_request import AlertSuppressionWindowRequest + +class TestAlertSuppressionWindowRequest(unittest.TestCase): + """AlertSuppressionWindowRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertSuppressionWindowRequest: + """Test AlertSuppressionWindowRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertSuppressionWindowRequest` + """ + model = AlertSuppressionWindowRequest() + if include_optional: + return AlertSuppressionWindowRequest( + alert_suppression_window_id = '2411', + name = 'Monthly maintenance', + is_enabled = False, + status = 'ended', + start_date = '2017-07-01T05:00Z', + duration = 0, + repeat = alerts_api.models.repeat.Repeat( + type = 'week', + interval_type = 'day', + interval_length = 2, + days_of_week = [ + 'sun' + ], ), + end_repeat = alerts_api.models.end_repeat.EndRepeat( + type = 'never', + count = 3, + date = 'Sat Jul 01 01:00:00 BST 2017', ), + tests = [ + '71687' + ] + ) + else: + return AlertSuppressionWindowRequest( + ) + """ + + def testAlertSuppressionWindowRequest(self): + """Test AlertSuppressionWindowRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_suppression_window_state.py b/alerts_api/test/test_alert_suppression_window_state.py new file mode 100644 index 00000000..11a59c2d --- /dev/null +++ b/alerts_api/test/test_alert_suppression_window_state.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_suppression_window_state import AlertSuppressionWindowState + +class TestAlertSuppressionWindowState(unittest.TestCase): + """AlertSuppressionWindowState unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAlertSuppressionWindowState(self): + """Test AlertSuppressionWindowState""" + # inst = AlertSuppressionWindowState() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_suppression_windows.py b/alerts_api/test/test_alert_suppression_windows.py new file mode 100644 index 00000000..c758a871 --- /dev/null +++ b/alerts_api/test/test_alert_suppression_windows.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_suppression_windows import AlertSuppressionWindows + +class TestAlertSuppressionWindows(unittest.TestCase): + """AlertSuppressionWindows unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertSuppressionWindows: + """Test AlertSuppressionWindows + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertSuppressionWindows` + """ + model = AlertSuppressionWindows() + if include_optional: + return AlertSuppressionWindows( + alert_suppression_windows = [ + null + ] + ) + else: + return AlertSuppressionWindows( + ) + """ + + def testAlertSuppressionWindows(self): + """Test AlertSuppressionWindows""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_suppression_windows_alert_suppression_windows_inner.py b/alerts_api/test/test_alert_suppression_windows_alert_suppression_windows_inner.py new file mode 100644 index 00000000..9c2ef470 --- /dev/null +++ b/alerts_api/test/test_alert_suppression_windows_alert_suppression_windows_inner.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_suppression_windows_alert_suppression_windows_inner import AlertSuppressionWindowsAlertSuppressionWindowsInner + +class TestAlertSuppressionWindowsAlertSuppressionWindowsInner(unittest.TestCase): + """AlertSuppressionWindowsAlertSuppressionWindowsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertSuppressionWindowsAlertSuppressionWindowsInner: + """Test AlertSuppressionWindowsAlertSuppressionWindowsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertSuppressionWindowsAlertSuppressionWindowsInner` + """ + model = AlertSuppressionWindowsAlertSuppressionWindowsInner() + if include_optional: + return AlertSuppressionWindowsAlertSuppressionWindowsInner( + alert_suppression_window_id = '2411', + name = 'Monthly maintenance', + is_enabled = False, + status = 'ended', + start_date = '2017-07-01T05:00Z', + duration = 0, + repeat = alerts_api.models.repeat.Repeat( + type = 'week', + interval_type = 'day', + interval_length = 2, + days_of_week = [ + 'sun' + ], ), + end_repeat = alerts_api.models.end_repeat.EndRepeat( + type = 'never', + count = 3, + date = 'Sat Jul 01 01:00:00 BST 2017', ), + links = alerts_api.models.self_links__links.SelfLinks__links( + self = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return AlertSuppressionWindowsAlertSuppressionWindowsInner( + ) + """ + + def testAlertSuppressionWindowsAlertSuppressionWindowsInner(self): + """Test AlertSuppressionWindowsAlertSuppressionWindowsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_suppression_windows_api.py b/alerts_api/test/test_alert_suppression_windows_api.py new file mode 100644 index 00000000..a640a5ad --- /dev/null +++ b/alerts_api/test/test_alert_suppression_windows_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest + +from alerts_api.api.alert_suppression_windows_api import AlertSuppressionWindowsApi + + +class TestAlertSuppressionWindowsApi(unittest.TestCase): + """AlertSuppressionWindowsApi unit test stubs""" + + def setUp(self) -> None: + self.api = AlertSuppressionWindowsApi() + + def tearDown(self) -> None: + pass + + def test_create_suppression_windows(self) -> None: + """Test case for create_suppression_windows + + Create alert suppression window + """ + pass + + def test_delete_suppression_window(self) -> None: + """Test case for delete_suppression_window + + Delete alert suppression window + """ + pass + + def test_get_suppression_window_details(self) -> None: + """Test case for get_suppression_window_details + + Retrieve alert suppression window + """ + pass + + def test_get_suppression_windows(self) -> None: + """Test case for get_suppression_windows + + List alert suppression windows + """ + pass + + def test_update_suppression_window(self) -> None: + """Test case for update_suppression_window + + Update alert suppression window + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alert_type.py b/alerts_api/test/test_alert_type.py new file mode 100644 index 00000000..8682be9a --- /dev/null +++ b/alerts_api/test/test_alert_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alert_type import AlertType + +class TestAlertType(unittest.TestCase): + """AlertType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAlertType(self): + """Test AlertType""" + # inst = AlertType() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alerts.py b/alerts_api/test/test_alerts.py new file mode 100644 index 00000000..246e1a0a --- /dev/null +++ b/alerts_api/test/test_alerts.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.alerts import Alerts + +class TestAlerts(unittest.TestCase): + """Alerts unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Alerts: + """Test Alerts + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Alerts` + """ + model = Alerts() + if include_optional: + return Alerts( + alerts = [ + null + ] + ) + else: + return Alerts( + ) + """ + + def testAlerts(self): + """Test Alerts""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_alerts_api.py b/alerts_api/test/test_alerts_api.py new file mode 100644 index 00000000..d5781f92 --- /dev/null +++ b/alerts_api/test/test_alerts_api.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest + +from alerts_api.api.alerts_api import AlertsApi + + +class TestAlertsApi(unittest.TestCase): + """AlertsApi unit test stubs""" + + def setUp(self) -> None: + self.api = AlertsApi() + + def tearDown(self) -> None: + pass + + def test_get_alert_details(self) -> None: + """Test case for get_alert_details + + Retrieve alert details + """ + pass + + def test_get_alerts(self) -> None: + """Test case for get_alerts + + List active alerts + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_app_links.py b/alerts_api/test/test_app_links.py new file mode 100644 index 00000000..b7422184 --- /dev/null +++ b/alerts_api/test/test_app_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.app_links import AppLinks + +class TestAppLinks(unittest.TestCase): + """AppLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AppLinks: + """Test AppLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AppLinks` + """ + model = AppLinks() + if include_optional: + return AppLinks( + links = alerts_api.models.app_links__links.AppLinks__links( + app_link = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return AppLinks( + ) + """ + + def testAppLinks(self): + """Test AppLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_app_links_links.py b/alerts_api/test/test_app_links_links.py new file mode 100644 index 00000000..c9f067ad --- /dev/null +++ b/alerts_api/test/test_app_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.app_links_links import AppLinksLinks + +class TestAppLinksLinks(unittest.TestCase): + """AppLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AppLinksLinks: + """Test AppLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AppLinksLinks` + """ + model = AppLinksLinks() + if include_optional: + return AppLinksLinks( + app_link = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return AppLinksLinks( + ) + """ + + def testAppLinksLinks(self): + """Test AppLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_base_alert.py b/alerts_api/test/test_base_alert.py new file mode 100644 index 00000000..bc1f3025 --- /dev/null +++ b/alerts_api/test/test_base_alert.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.base_alert import BaseAlert + +class TestBaseAlert(unittest.TestCase): + """BaseAlert unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseAlert: + """Test BaseAlert + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BaseAlert` + """ + model = BaseAlert() + if include_optional: + return BaseAlert( + links = alerts_api.models.rule_links__links.RuleLinks__links( + rule = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569', + alert_type = 'http-server', + start_date = '2020-04-23T13:43:16Z', + end_date = '2020-04-23T13:43:16Z', + violation_count = 2, + duration = 60 + ) + else: + return BaseAlert( + ) + """ + + def testBaseAlert(self): + """Test BaseAlert""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_base_test.py b/alerts_api/test/test_base_test.py new file mode 100644 index 00000000..93d889b9 --- /dev/null +++ b/alerts_api/test/test_base_test.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.base_test import BaseTest + +class TestBaseTest(unittest.TestCase): + """BaseTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseTest: + """Test BaseTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BaseTest` + """ + model = BaseTest() + if include_optional: + return BaseTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + alerts_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ] + ) + else: + return BaseTest( + ) + """ + + def testBaseTest(self): + """Test BaseTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_complete_alert_suppression_window.py b/alerts_api/test/test_complete_alert_suppression_window.py new file mode 100644 index 00000000..679a826d --- /dev/null +++ b/alerts_api/test/test_complete_alert_suppression_window.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.complete_alert_suppression_window import CompleteAlertSuppressionWindow + +class TestCompleteAlertSuppressionWindow(unittest.TestCase): + """CompleteAlertSuppressionWindow unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CompleteAlertSuppressionWindow: + """Test CompleteAlertSuppressionWindow + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CompleteAlertSuppressionWindow` + """ + model = CompleteAlertSuppressionWindow() + if include_optional: + return CompleteAlertSuppressionWindow( + alert_suppression_window_id = '2411', + name = 'Monthly maintenance', + is_enabled = False, + status = 'ended', + start_date = '2017-07-01T05:00Z', + duration = 0, + repeat = alerts_api.models.repeat.Repeat( + type = 'week', + interval_type = 'day', + interval_length = 2, + days_of_week = [ + 'sun' + ], ), + end_repeat = alerts_api.models.end_repeat.EndRepeat( + type = 'never', + count = 3, + date = 'Sat Jul 01 01:00:00 BST 2017', ), + tests = [ + null + ] + ) + else: + return CompleteAlertSuppressionWindow( + ) + """ + + def testCompleteAlertSuppressionWindow(self): + """Test CompleteAlertSuppressionWindow""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_create_alert_rule201_response.py b/alerts_api/test/test_create_alert_rule201_response.py new file mode 100644 index 00000000..bda530e0 --- /dev/null +++ b/alerts_api/test/test_create_alert_rule201_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.create_alert_rule201_response import CreateAlertRule201Response + +class TestCreateAlertRule201Response(unittest.TestCase): + """CreateAlertRule201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateAlertRule201Response: + """Test CreateAlertRule201Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateAlertRule201Response` + """ + model = CreateAlertRule201Response() + if include_optional: + return CreateAlertRule201Response( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + notify_on_clear = True, + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, + include_covered_prefixes = True, + severity = 'major', + notifications = alerts_api.models.notification.Notification( + email = alerts_api.models.notification_email.NotificationEmail( + recipients = noreply@thousandeyes.com, + message = 'Notification message', ), + third_party = [ + alerts_api.models.notification_third_party.NotificationThirdParty( + integration_id = sl-101, + integration_type = 'slack', ) + ], + webhook = [ + alerts_api.models.notification_webhook.NotificationWebhook( + integration_id = wb-201, ) + ], ), + test_ids = [ + '["281474976710706","271659"]' + ], + links = alerts_api.models.self_links__links.SelfLinks__links( + self = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return CreateAlertRule201Response( + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + alert_type = 'http-server', + rounds_violating_out_of = 5, + rounds_violating_required = 2, + ) + """ + + def testCreateAlertRule201Response(self): + """Test CreateAlertRule201Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_create_suppression_windows201_response.py b/alerts_api/test/test_create_suppression_windows201_response.py new file mode 100644 index 00000000..79e7bd91 --- /dev/null +++ b/alerts_api/test/test_create_suppression_windows201_response.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.create_suppression_windows201_response import CreateSuppressionWindows201Response + +class TestCreateSuppressionWindows201Response(unittest.TestCase): + """CreateSuppressionWindows201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateSuppressionWindows201Response: + """Test CreateSuppressionWindows201Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateSuppressionWindows201Response` + """ + model = CreateSuppressionWindows201Response() + if include_optional: + return CreateSuppressionWindows201Response( + alert_suppression_window_id = '2411', + name = 'Monthly maintenance', + is_enabled = False, + status = 'ended', + start_date = '2017-07-01T05:00Z', + duration = 0, + repeat = alerts_api.models.repeat.Repeat( + type = 'week', + interval_type = 'day', + interval_length = 2, + days_of_week = [ + 'sun' + ], ), + end_repeat = alerts_api.models.end_repeat.EndRepeat( + type = 'never', + count = 3, + date = 'Sat Jul 01 01:00:00 BST 2017', ), + tests = [ + null + ], + links = alerts_api.models.self_links__links.SelfLinks__links( + self = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return CreateSuppressionWindows201Response( + ) + """ + + def testCreateSuppressionWindows201Response(self): + """Test CreateSuppressionWindows201Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_days_of_week.py b/alerts_api/test/test_days_of_week.py new file mode 100644 index 00000000..90482543 --- /dev/null +++ b/alerts_api/test/test_days_of_week.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.days_of_week import DaysOfWeek + +class TestDaysOfWeek(unittest.TestCase): + """DaysOfWeek unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDaysOfWeek(self): + """Test DaysOfWeek""" + # inst = DaysOfWeek() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_end_repeat.py b/alerts_api/test/test_end_repeat.py new file mode 100644 index 00000000..8cb017c7 --- /dev/null +++ b/alerts_api/test/test_end_repeat.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.end_repeat import EndRepeat + +class TestEndRepeat(unittest.TestCase): + """EndRepeat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndRepeat: + """Test EndRepeat + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndRepeat` + """ + model = EndRepeat() + if include_optional: + return EndRepeat( + type = 'never', + count = 3, + var_date = 'Sat Jul 01 01:00:00 BST 2017' + ) + else: + return EndRepeat( + ) + """ + + def testEndRepeat(self): + """Test EndRepeat""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_end_repeat_type.py b/alerts_api/test/test_end_repeat_type.py new file mode 100644 index 00000000..be74ffac --- /dev/null +++ b/alerts_api/test/test_end_repeat_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.end_repeat_type import EndRepeatType + +class TestEndRepeatType(unittest.TestCase): + """EndRepeatType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndRepeatType(self): + """Test EndRepeatType""" + # inst = EndRepeatType() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_error.py b/alerts_api/test/test_error.py new file mode 100644 index 00000000..cbad9c88 --- /dev/null +++ b/alerts_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_expand.py b/alerts_api/test/test_expand.py new file mode 100644 index 00000000..b8903018 --- /dev/null +++ b/alerts_api/test/test_expand.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.expand import Expand + +class TestExpand(unittest.TestCase): + """Expand unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testExpand(self): + """Test Expand""" + # inst = Expand() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_get_alert_rule_details200_response.py b/alerts_api/test/test_get_alert_rule_details200_response.py new file mode 100644 index 00000000..8795cb95 --- /dev/null +++ b/alerts_api/test/test_get_alert_rule_details200_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.get_alert_rule_details200_response import GetAlertRuleDetails200Response + +class TestGetAlertRuleDetails200Response(unittest.TestCase): + """GetAlertRuleDetails200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAlertRuleDetails200Response: + """Test GetAlertRuleDetails200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAlertRuleDetails200Response` + """ + model = GetAlertRuleDetails200Response() + if include_optional: + return GetAlertRuleDetails200Response( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + notify_on_clear = True, + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, + include_covered_prefixes = True, + severity = 'major', + notifications = alerts_api.models.notification.Notification( + email = alerts_api.models.notification_email.NotificationEmail( + recipients = noreply@thousandeyes.com, + message = 'Notification message', ), + third_party = [ + alerts_api.models.notification_third_party.NotificationThirdParty( + integration_id = sl-101, + integration_type = 'slack', ) + ], + webhook = [ + alerts_api.models.notification_webhook.NotificationWebhook( + integration_id = wb-201, ) + ], ), + tests = [ + null + ], + links = alerts_api.models.self_links__links.SelfLinks__links( + self = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetAlertRuleDetails200Response( + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + alert_type = 'http-server', + rounds_violating_out_of = 5, + rounds_violating_required = 2, + ) + """ + + def testGetAlertRuleDetails200Response(self): + """Test GetAlertRuleDetails200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_get_alerts200_response.py b/alerts_api/test/test_get_alerts200_response.py new file mode 100644 index 00000000..f82d1c31 --- /dev/null +++ b/alerts_api/test/test_get_alerts200_response.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.get_alerts200_response import GetAlerts200Response + +class TestGetAlerts200Response(unittest.TestCase): + """GetAlerts200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAlerts200Response: + """Test GetAlerts200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAlerts200Response` + """ + model = GetAlerts200Response() + if include_optional: + return GetAlerts200Response( + alerts = [ + null + ], + links = alerts_api.models.pagination_links__links.PaginationLinks__links( + previous = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + next = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetAlerts200Response( + ) + """ + + def testGetAlerts200Response(self): + """Test GetAlerts200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_get_alerts_rules200_response.py b/alerts_api/test/test_get_alerts_rules200_response.py new file mode 100644 index 00000000..95e124af --- /dev/null +++ b/alerts_api/test/test_get_alerts_rules200_response.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.get_alerts_rules200_response import GetAlertsRules200Response + +class TestGetAlertsRules200Response(unittest.TestCase): + """GetAlertsRules200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAlertsRules200Response: + """Test GetAlertsRules200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAlertsRules200Response` + """ + model = GetAlertsRules200Response() + if include_optional: + return GetAlertsRules200Response( + alert_rules = [ + alerts_api.models.rule.Rule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + notify_on_clear = True, + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, + include_covered_prefixes = True, + severity = 'major', ) + ], + links = alerts_api.models.self_links__links.SelfLinks__links( + self = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetAlertsRules200Response( + ) + """ + + def testGetAlertsRules200Response(self): + """Test GetAlertsRules200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_get_suppression_windows200_response.py b/alerts_api/test/test_get_suppression_windows200_response.py new file mode 100644 index 00000000..605b2a5d --- /dev/null +++ b/alerts_api/test/test_get_suppression_windows200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.get_suppression_windows200_response import GetSuppressionWindows200Response + +class TestGetSuppressionWindows200Response(unittest.TestCase): + """GetSuppressionWindows200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetSuppressionWindows200Response: + """Test GetSuppressionWindows200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetSuppressionWindows200Response` + """ + model = GetSuppressionWindows200Response() + if include_optional: + return GetSuppressionWindows200Response( + alert_suppression_windows = [ + null + ], + links = alerts_api.models.self_links__links.SelfLinks__links( + self = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetSuppressionWindows200Response( + ) + """ + + def testGetSuppressionWindows200Response(self): + """Test GetSuppressionWindows200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_interval_type.py b/alerts_api/test/test_interval_type.py new file mode 100644 index 00000000..bf505633 --- /dev/null +++ b/alerts_api/test/test_interval_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.interval_type import IntervalType + +class TestIntervalType(unittest.TestCase): + """IntervalType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testIntervalType(self): + """Test IntervalType""" + # inst = IntervalType() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_link.py b/alerts_api/test/test_link.py new file mode 100644 index 00000000..0dc07585 --- /dev/null +++ b/alerts_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_notification.py b/alerts_api/test/test_notification.py new file mode 100644 index 00000000..53d81eaa --- /dev/null +++ b/alerts_api/test/test_notification.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.notification import Notification + +class TestNotification(unittest.TestCase): + """Notification unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Notification: + """Test Notification + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Notification` + """ + model = Notification() + if include_optional: + return Notification( + email = alerts_api.models.notification_email.NotificationEmail( + recipients = noreply@thousandeyes.com, + message = 'Notification message', ), + third_party = [ + alerts_api.models.notification_third_party.NotificationThirdParty( + integration_id = sl-101, + integration_type = 'slack', ) + ], + webhook = [ + alerts_api.models.notification_webhook.NotificationWebhook( + integration_id = wb-201, + integration_type = 'webhook', ) + ] + ) + else: + return Notification( + ) + """ + + def testNotification(self): + """Test Notification""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_notification_email.py b/alerts_api/test/test_notification_email.py new file mode 100644 index 00000000..32f10977 --- /dev/null +++ b/alerts_api/test/test_notification_email.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.notification_email import NotificationEmail + +class TestNotificationEmail(unittest.TestCase): + """NotificationEmail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NotificationEmail: + """Test NotificationEmail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NotificationEmail` + """ + model = NotificationEmail() + if include_optional: + return NotificationEmail( + recipients = noreply@thousandeyes.com, + message = 'Notification message' + ) + else: + return NotificationEmail( + ) + """ + + def testNotificationEmail(self): + """Test NotificationEmail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_notification_third_party.py b/alerts_api/test/test_notification_third_party.py new file mode 100644 index 00000000..2d629c97 --- /dev/null +++ b/alerts_api/test/test_notification_third_party.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.notification_third_party import NotificationThirdParty + +class TestNotificationThirdParty(unittest.TestCase): + """NotificationThirdParty unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NotificationThirdParty: + """Test NotificationThirdParty + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NotificationThirdParty` + """ + model = NotificationThirdParty() + if include_optional: + return NotificationThirdParty( + integration_id = sl-101, + integration_type = 'slack' + ) + else: + return NotificationThirdParty( + ) + """ + + def testNotificationThirdParty(self): + """Test NotificationThirdParty""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_notification_webhook.py b/alerts_api/test/test_notification_webhook.py new file mode 100644 index 00000000..252d853a --- /dev/null +++ b/alerts_api/test/test_notification_webhook.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.notification_webhook import NotificationWebhook + +class TestNotificationWebhook(unittest.TestCase): + """NotificationWebhook unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NotificationWebhook: + """Test NotificationWebhook + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NotificationWebhook` + """ + model = NotificationWebhook() + if include_optional: + return NotificationWebhook( + integration_id = wb-201, + integration_type = 'webhook' + ) + else: + return NotificationWebhook( + ) + """ + + def testNotificationWebhook(self): + """Test NotificationWebhook""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_pagination_links.py b/alerts_api/test/test_pagination_links.py new file mode 100644 index 00000000..89dabe31 --- /dev/null +++ b/alerts_api/test/test_pagination_links.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.pagination_links import PaginationLinks + +class TestPaginationLinks(unittest.TestCase): + """PaginationLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationLinks: + """Test PaginationLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationLinks` + """ + model = PaginationLinks() + if include_optional: + return PaginationLinks( + links = alerts_api.models.pagination_links__links.PaginationLinks__links( + previous = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + next = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return PaginationLinks( + ) + """ + + def testPaginationLinks(self): + """Test PaginationLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_pagination_links_links.py b/alerts_api/test/test_pagination_links_links.py new file mode 100644 index 00000000..eaa45c71 --- /dev/null +++ b/alerts_api/test/test_pagination_links_links.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.pagination_links_links import PaginationLinksLinks + +class TestPaginationLinksLinks(unittest.TestCase): + """PaginationLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationLinksLinks: + """Test PaginationLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationLinksLinks` + """ + model = PaginationLinksLinks() + if include_optional: + return PaginationLinksLinks( + previous = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + next = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return PaginationLinksLinks( + ) + """ + + def testPaginationLinksLinks(self): + """Test PaginationLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_repeat.py b/alerts_api/test/test_repeat.py new file mode 100644 index 00000000..338136ae --- /dev/null +++ b/alerts_api/test/test_repeat.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.repeat import Repeat + +class TestRepeat(unittest.TestCase): + """Repeat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Repeat: + """Test Repeat + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Repeat` + """ + model = Repeat() + if include_optional: + return Repeat( + type = 'week', + interval_type = 'day', + interval_length = 2, + days_of_week = [ + 'sun' + ] + ) + else: + return Repeat( + ) + """ + + def testRepeat(self): + """Test Repeat""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_repeat_type.py b/alerts_api/test/test_repeat_type.py new file mode 100644 index 00000000..1fd3e2df --- /dev/null +++ b/alerts_api/test/test_repeat_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.repeat_type import RepeatType + +class TestRepeatType(unittest.TestCase): + """RepeatType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testRepeatType(self): + """Test RepeatType""" + # inst = RepeatType() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_rule.py b/alerts_api/test/test_rule.py new file mode 100644 index 00000000..d77700a1 --- /dev/null +++ b/alerts_api/test/test_rule.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.rule import Rule + +class TestRule(unittest.TestCase): + """Rule unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Rule: + """Test Rule + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Rule` + """ + model = Rule() + if include_optional: + return Rule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + notify_on_clear = True, + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, + include_covered_prefixes = True, + severity = 'major' + ) + else: + return Rule( + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + alert_type = 'http-server', + rounds_violating_out_of = 5, + rounds_violating_required = 2, + ) + """ + + def testRule(self): + """Test Rule""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_rule_detail.py b/alerts_api/test/test_rule_detail.py new file mode 100644 index 00000000..25eeae8f --- /dev/null +++ b/alerts_api/test/test_rule_detail.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.rule_detail import RuleDetail + +class TestRuleDetail(unittest.TestCase): + """RuleDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RuleDetail: + """Test RuleDetail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RuleDetail` + """ + model = RuleDetail() + if include_optional: + return RuleDetail( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + notify_on_clear = True, + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, + include_covered_prefixes = True, + severity = 'major', + notifications = alerts_api.models.notification.Notification( + email = alerts_api.models.notification_email.NotificationEmail( + recipients = noreply@thousandeyes.com, + message = 'Notification message', ), + third_party = [ + alerts_api.models.notification_third_party.NotificationThirdParty( + integration_id = sl-101, + integration_type = 'slack', ) + ], + webhook = [ + alerts_api.models.notification_webhook.NotificationWebhook( + integration_id = wb-201, ) + ], ), + tests = [ + null + ] + ) + else: + return RuleDetail( + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + alert_type = 'http-server', + rounds_violating_out_of = 5, + rounds_violating_required = 2, + ) + """ + + def testRuleDetail(self): + """Test RuleDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_rule_detail_update.py b/alerts_api/test/test_rule_detail_update.py new file mode 100644 index 00000000..10b7164c --- /dev/null +++ b/alerts_api/test/test_rule_detail_update.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.rule_detail_update import RuleDetailUpdate + +class TestRuleDetailUpdate(unittest.TestCase): + """RuleDetailUpdate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RuleDetailUpdate: + """Test RuleDetailUpdate + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RuleDetailUpdate` + """ + model = RuleDetailUpdate() + if include_optional: + return RuleDetailUpdate( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + notify_on_clear = True, + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, + include_covered_prefixes = True, + severity = 'major', + notifications = alerts_api.models.notification.Notification( + email = alerts_api.models.notification_email.NotificationEmail( + recipients = noreply@thousandeyes.com, + message = 'Notification message', ), + third_party = [ + alerts_api.models.notification_third_party.NotificationThirdParty( + integration_id = sl-101, + integration_type = 'slack', ) + ], + webhook = [ + alerts_api.models.notification_webhook.NotificationWebhook( + integration_id = wb-201, ) + ], ), + test_ids = [ + '["281474976710706","271659"]' + ] + ) + else: + return RuleDetailUpdate( + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + alert_type = 'http-server', + rounds_violating_out_of = 5, + rounds_violating_required = 2, + ) + """ + + def testRuleDetailUpdate(self): + """Test RuleDetailUpdate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_rule_links.py b/alerts_api/test/test_rule_links.py new file mode 100644 index 00000000..73d3d244 --- /dev/null +++ b/alerts_api/test/test_rule_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.rule_links import RuleLinks + +class TestRuleLinks(unittest.TestCase): + """RuleLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RuleLinks: + """Test RuleLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RuleLinks` + """ + model = RuleLinks() + if include_optional: + return RuleLinks( + links = alerts_api.models.rule_links__links.RuleLinks__links( + rule = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return RuleLinks( + ) + """ + + def testRuleLinks(self): + """Test RuleLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_rule_links_links.py b/alerts_api/test/test_rule_links_links.py new file mode 100644 index 00000000..8e6fcde0 --- /dev/null +++ b/alerts_api/test/test_rule_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.rule_links_links import RuleLinksLinks + +class TestRuleLinksLinks(unittest.TestCase): + """RuleLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RuleLinksLinks: + """Test RuleLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RuleLinksLinks` + """ + model = RuleLinksLinks() + if include_optional: + return RuleLinksLinks( + rule = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return RuleLinksLinks( + ) + """ + + def testRuleLinksLinks(self): + """Test RuleLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_rules.py b/alerts_api/test/test_rules.py new file mode 100644 index 00000000..b7e466f4 --- /dev/null +++ b/alerts_api/test/test_rules.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.rules import Rules + +class TestRules(unittest.TestCase): + """Rules unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Rules: + """Test Rules + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Rules` + """ + model = Rules() + if include_optional: + return Rules( + alert_rules = [ + alerts_api.models.rule.Rule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + notify_on_clear = True, + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, + include_covered_prefixes = True, + severity = 'major', ) + ] + ) + else: + return Rules( + ) + """ + + def testRules(self): + """Test Rules""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_self_links.py b/alerts_api/test/test_self_links.py new file mode 100644 index 00000000..24c41b84 --- /dev/null +++ b/alerts_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = alerts_api.models.self_links__links.SelfLinks__links( + self = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_self_links_links.py b/alerts_api/test/test_self_links_links.py new file mode 100644 index 00000000..afce3685 --- /dev/null +++ b/alerts_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = alerts_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_severity.py b/alerts_api/test/test_severity.py new file mode 100644 index 00000000..e389949e --- /dev/null +++ b/alerts_api/test/test_severity.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.severity import Severity + +class TestSeverity(unittest.TestCase): + """Severity unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSeverity(self): + """Test Severity""" + # inst = Severity() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_state.py b/alerts_api/test/test_state.py new file mode 100644 index 00000000..bf993235 --- /dev/null +++ b/alerts_api/test/test_state.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.state import State + +class TestState(unittest.TestCase): + """State unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testState(self): + """Test State""" + # inst = State() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_test_direction.py b/alerts_api/test/test_test_direction.py new file mode 100644 index 00000000..20f91dcc --- /dev/null +++ b/alerts_api/test/test_test_direction.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.test_direction import TestDirection + +class TestTestDirection(unittest.TestCase): + """TestDirection unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestDirection(self): + """Test TestDirection""" + # inst = TestDirection() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_test_interval.py b/alerts_api/test/test_test_interval.py new file mode 100644 index 00000000..9537a33d --- /dev/null +++ b/alerts_api/test/test_test_interval.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.test_interval import TestInterval + +class TestTestInterval(unittest.TestCase): + """TestInterval unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestInterval(self): + """Test TestInterval""" + # inst = TestInterval() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_third_party_integration_type.py b/alerts_api/test/test_third_party_integration_type.py new file mode 100644 index 00000000..1e38edff --- /dev/null +++ b/alerts_api/test/test_third_party_integration_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.third_party_integration_type import ThirdPartyIntegrationType + +class TestThirdPartyIntegrationType(unittest.TestCase): + """ThirdPartyIntegrationType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testThirdPartyIntegrationType(self): + """Test ThirdPartyIntegrationType""" + # inst = ThirdPartyIntegrationType() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_unauthorized_error.py b/alerts_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..bcdcf3d1 --- /dev/null +++ b/alerts_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_unexpanded_test.py b/alerts_api/test/test_unexpanded_test.py new file mode 100644 index 00000000..049a60a1 --- /dev/null +++ b/alerts_api/test/test_unexpanded_test.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.unexpanded_test import UnexpandedTest + +class TestUnexpandedTest(unittest.TestCase): + """UnexpandedTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedTest: + """Test UnexpandedTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedTest` + """ + model = UnexpandedTest() + if include_optional: + return UnexpandedTest( + interval = 120, + alerts_enabled = True, + enabled = True + ) + else: + return UnexpandedTest( + ) + """ + + def testUnexpandedTest(self): + """Test UnexpandedTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/test/test_webhook_integration_type.py b/alerts_api/test/test_webhook_integration_type.py new file mode 100644 index 00000000..dbf6416a --- /dev/null +++ b/alerts_api/test/test_webhook_integration_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Alerts API + + ## Overview Manage all alerts, alert rules and alert suppression windows. + + 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 unittest +import datetime + +from alerts_api.models.webhook_integration_type import WebhookIntegrationType + +class TestWebhookIntegrationType(unittest.TestCase): + """WebhookIntegrationType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testWebhookIntegrationType(self): + """Test WebhookIntegrationType""" + # inst = WebhookIntegrationType() + +if __name__ == '__main__': + unittest.main() diff --git a/alerts_api/tox.ini b/alerts_api/tox.ini new file mode 100644 index 00000000..1236a7af --- /dev/null +++ b/alerts_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=alerts_api diff --git a/credentials_api/.github/workflows/python.yml b/credentials_api/.github/workflows/python.yml new file mode 100644 index 00000000..53cfdd56 --- /dev/null +++ b/credentials_api/.github/workflows/python.yml @@ -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: credentials_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 diff --git a/credentials_api/.gitignore b/credentials_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/credentials_api/.gitignore @@ -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 diff --git a/credentials_api/.gitlab-ci.yml b/credentials_api/.gitlab-ci.yml new file mode 100644 index 00000000..bd25a400 --- /dev/null +++ b/credentials_api/.gitlab-ci.yml @@ -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=credentials_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 diff --git a/credentials_api/.openapi-generator-ignore b/credentials_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/credentials_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/credentials_api/.openapi-generator/FILES b/credentials_api/.openapi-generator/FILES new file mode 100644 index 00000000..481a8f47 --- /dev/null +++ b/credentials_api/.openapi-generator/FILES @@ -0,0 +1,56 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +credentials_api/__init__.py +credentials_api/api/__init__.py +credentials_api/api/credentials_api.py +credentials_api/api_client.py +credentials_api/api_response.py +credentials_api/configuration.py +credentials_api/exceptions.py +credentials_api/models/__init__.py +credentials_api/models/credential.py +credentials_api/models/credential_request.py +credentials_api/models/credential_without_value.py +credentials_api/models/credentials.py +credentials_api/models/error.py +credentials_api/models/get_transaction_tests_credentials_list200_response.py +credentials_api/models/link.py +credentials_api/models/self_links.py +credentials_api/models/self_links_links.py +credentials_api/models/unauthorized_error.py +credentials_api/py.typed +credentials_api/rest.py +docs/Credential.md +docs/CredentialRequest.md +docs/CredentialWithoutValue.md +docs/Credentials.md +docs/CredentialsApi.md +docs/Error.md +docs/GetTransactionTestsCredentialsList200Response.md +docs/Link.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/UnauthorizedError.md +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_credential.py +test/test_credential_request.py +test/test_credential_without_value.py +test/test_credentials.py +test/test_credentials_api.py +test/test_error.py +test/test_get_transaction_tests_credentials_list200_response.py +test/test_link.py +test/test_self_links.py +test/test_self_links_links.py +test/test_unauthorized_error.py +tox.ini diff --git a/credentials_api/.openapi-generator/VERSION b/credentials_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/credentials_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/credentials_api/.travis.yml b/credentials_api/.travis.yml new file mode 100644 index 00000000..8c436768 --- /dev/null +++ b/credentials_api/.travis.yml @@ -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=credentials_api diff --git a/credentials_api/README.md b/credentials_api/README.md new file mode 100644 index 00000000..6c1cf25f --- /dev/null +++ b/credentials_api/README.md @@ -0,0 +1,141 @@ +# credentials-api +### Overview +Manage credentials for transaction tests using the Credentials API. + +The following permissions are required to access Credentials API endpoints: +* `Settings Tests Read` for read operations. +* `Settings Tests Update` for write operations. +* `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. +* `Settings Tests Create Transaction (Tx) Tests` to create credentials. + +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 credentials_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 credentials_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 credentials_api +from credentials_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 = credentials_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 = credentials_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with credentials_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = credentials_api.CredentialsApi(api_client) + credential_request = credentials_api.CredentialRequest() # CredentialRequest | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create credential + api_response = api_instance.create_transaction_tests_credential(credential_request, aid=aid) + print("The response of CredentialsApi->create_transaction_tests_credential:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling CredentialsApi->create_transaction_tests_credential: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CredentialsApi* | [**create_transaction_tests_credential**](docs/CredentialsApi.md#create_transaction_tests_credential) | **POST** /v7/credentials | Create credential +*CredentialsApi* | [**delete_transaction_tests_credential**](docs/CredentialsApi.md#delete_transaction_tests_credential) | **DELETE** /v7/credentials/{id} | Delete credential +*CredentialsApi* | [**get_transaction_tests_credential_details**](docs/CredentialsApi.md#get_transaction_tests_credential_details) | **GET** /v7/credentials/{id} | Retrieve credential +*CredentialsApi* | [**get_transaction_tests_credentials_list**](docs/CredentialsApi.md#get_transaction_tests_credentials_list) | **GET** /v7/credentials | List credentials +*CredentialsApi* | [**update_transaction_tests_credential**](docs/CredentialsApi.md#update_transaction_tests_credential) | **PUT** /v7/credentials/{id} | Update credential + + +## Documentation For Models + + - [Credential](docs/Credential.md) + - [CredentialRequest](docs/CredentialRequest.md) + - [CredentialWithoutValue](docs/CredentialWithoutValue.md) + - [Credentials](docs/Credentials.md) + - [Error](docs/Error.md) + - [GetTransactionTestsCredentialsList200Response](docs/GetTransactionTestsCredentialsList200Response.md) + - [Link](docs/Link.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/credentials_api/credentials_api/__init__.py b/credentials_api/credentials_api/__init__.py new file mode 100644 index 00000000..691d37cb --- /dev/null +++ b/credentials_api/credentials_api/__init__.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 credentials_api.api.credentials_api import CredentialsApi + +# import ApiClient +from credentials_api.api_response import ApiResponse +from credentials_api.api_client import ApiClient +from credentials_api.configuration import Configuration +from credentials_api.exceptions import OpenApiException +from credentials_api.exceptions import ApiTypeError +from credentials_api.exceptions import ApiValueError +from credentials_api.exceptions import ApiKeyError +from credentials_api.exceptions import ApiAttributeError +from credentials_api.exceptions import ApiException + +# import models into sdk package +from credentials_api.models.credential import Credential +from credentials_api.models.credential_request import CredentialRequest +from credentials_api.models.credential_without_value import CredentialWithoutValue +from credentials_api.models.credentials import Credentials +from credentials_api.models.error import Error +from credentials_api.models.get_transaction_tests_credentials_list200_response import GetTransactionTestsCredentialsList200Response +from credentials_api.models.link import Link +from credentials_api.models.self_links import SelfLinks +from credentials_api.models.self_links_links import SelfLinksLinks +from credentials_api.models.unauthorized_error import UnauthorizedError diff --git a/credentials_api/credentials_api/api/__init__.py b/credentials_api/credentials_api/api/__init__.py new file mode 100644 index 00000000..eed6e36f --- /dev/null +++ b/credentials_api/credentials_api/api/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa + +# import apis into api package +from credentials_api.api.credentials_api import CredentialsApi + diff --git a/credentials_api/credentials_api/api/credentials_api.py b/credentials_api/credentials_api/api/credentials_api.py new file mode 100644 index 00000000..53defd4e --- /dev/null +++ b/credentials_api/credentials_api/api/credentials_api.py @@ -0,0 +1,1544 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 credentials_api.models.credential import Credential +from credentials_api.models.credential_request import CredentialRequest +from credentials_api.models.credential_without_value import CredentialWithoutValue +from credentials_api.models.get_transaction_tests_credentials_list200_response import GetTransactionTestsCredentialsList200Response + +from credentials_api.api_client import ApiClient +from credentials_api.api_response import ApiResponse +from credentials_api.rest import RESTResponseType + + +class CredentialsApi: + """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 create_transaction_tests_credential( + self, + credential_request: CredentialRequest, + 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, + ) -> CredentialWithoutValue: + """Create credential + + Creates a new credential for ThousandEyes transaction tests, based on properties provided in the request data. To create a new credential, you must have permission to update tests. + + :param credential_request: (required) + :type credential_request: CredentialRequest + :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._create_transaction_tests_credential_serialize( + credential_request=credential_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CredentialWithoutValue", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_transaction_tests_credential_with_http_info( + self, + credential_request: CredentialRequest, + 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[CredentialWithoutValue]: + """Create credential + + Creates a new credential for ThousandEyes transaction tests, based on properties provided in the request data. To create a new credential, you must have permission to update tests. + + :param credential_request: (required) + :type credential_request: CredentialRequest + :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._create_transaction_tests_credential_serialize( + credential_request=credential_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CredentialWithoutValue", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_transaction_tests_credential_without_preload_content( + self, + credential_request: CredentialRequest, + 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: + """Create credential + + Creates a new credential for ThousandEyes transaction tests, based on properties provided in the request data. To create a new credential, you must have permission to update tests. + + :param credential_request: (required) + :type credential_request: CredentialRequest + :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._create_transaction_tests_credential_serialize( + credential_request=credential_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CredentialWithoutValue", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_transaction_tests_credential_serialize( + self, + credential_request, + 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 + if credential_request is not None: + _body_params = credential_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/credentials', + 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 delete_transaction_tests_credential( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired credential.")], + 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, + ) -> None: + """Delete credential + + Deletes a ThousandEyes transaction test credential, using the request parameters. To delete a credential, you must have permission to update tests and access to the credential based on its default or provided account ID. + + :param id: The ID of the desired credential. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_transaction_tests_credential_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_transaction_tests_credential_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired credential.")], + 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[None]: + """Delete credential + + Deletes a ThousandEyes transaction test credential, using the request parameters. To delete a credential, you must have permission to update tests and access to the credential based on its default or provided account ID. + + :param id: The ID of the desired credential. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_transaction_tests_credential_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_transaction_tests_credential_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired credential.")], + 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: + """Delete credential + + Deletes a ThousandEyes transaction test credential, using the request parameters. To delete a credential, you must have permission to update tests and access to the credential based on its default or provided account ID. + + :param id: The ID of the desired credential. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_transaction_tests_credential_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_transaction_tests_credential_serialize( + self, + 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 id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/credentials/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_transaction_tests_credential_details( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired credential.")], + 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, + ) -> Credential: + """Retrieve credential + + Retrieves detailed information about a ThousandEyes transaction test credential. To access this information, you must have access to the credential based on its default or provided account ID. + + :param id: The ID of the desired credential. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_transaction_tests_credential_details_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Credential", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_transaction_tests_credential_details_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired credential.")], + 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[Credential]: + """Retrieve credential + + Retrieves detailed information about a ThousandEyes transaction test credential. To access this information, you must have access to the credential based on its default or provided account ID. + + :param id: The ID of the desired credential. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_transaction_tests_credential_details_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Credential", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_transaction_tests_credential_details_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired credential.")], + 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 credential + + Retrieves detailed information about a ThousandEyes transaction test credential. To access this information, you must have access to the credential based on its default or provided account ID. + + :param id: The ID of the desired credential. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_transaction_tests_credential_details_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Credential", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_transaction_tests_credential_details_serialize( + self, + 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 id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/credentials/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_transaction_tests_credentials_list( + 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, + ) -> GetTransactionTestsCredentialsList200Response: + """List credentials + + Retrieves a list of credentials configured in ThousandEyes. Users have access to the list of credentials based on the default settings or the specified account ID. + + :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_transaction_tests_credentials_list_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': "GetTransactionTestsCredentialsList200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_transaction_tests_credentials_list_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[GetTransactionTestsCredentialsList200Response]: + """List credentials + + Retrieves a list of credentials configured in ThousandEyes. Users have access to the list of credentials based on the default settings or the specified account ID. + + :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_transaction_tests_credentials_list_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': "GetTransactionTestsCredentialsList200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_transaction_tests_credentials_list_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 credentials + + Retrieves a list of credentials configured in ThousandEyes. Users have access to the list of credentials based on the default settings or the specified account ID. + + :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_transaction_tests_credentials_list_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': "GetTransactionTestsCredentialsList200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_transaction_tests_credentials_list_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/credentials', + 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 update_transaction_tests_credential( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired credential.")], + credential_request: CredentialRequest, + 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, + ) -> CredentialWithoutValue: + """Update credential + + Updates the credential for ThousandEyes transaction tests, based on properties provided in the request data. To update a credential, you must have permission to update tests and access to the credential based on its default or provided account ID. + + :param id: The ID of the desired credential. (required) + :type id: str + :param credential_request: (required) + :type credential_request: CredentialRequest + :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._update_transaction_tests_credential_serialize( + id=id, + credential_request=credential_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CredentialWithoutValue", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_transaction_tests_credential_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired credential.")], + credential_request: CredentialRequest, + 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[CredentialWithoutValue]: + """Update credential + + Updates the credential for ThousandEyes transaction tests, based on properties provided in the request data. To update a credential, you must have permission to update tests and access to the credential based on its default or provided account ID. + + :param id: The ID of the desired credential. (required) + :type id: str + :param credential_request: (required) + :type credential_request: CredentialRequest + :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._update_transaction_tests_credential_serialize( + id=id, + credential_request=credential_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CredentialWithoutValue", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_transaction_tests_credential_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired credential.")], + credential_request: CredentialRequest, + 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: + """Update credential + + Updates the credential for ThousandEyes transaction tests, based on properties provided in the request data. To update a credential, you must have permission to update tests and access to the credential based on its default or provided account ID. + + :param id: The ID of the desired credential. (required) + :type id: str + :param credential_request: (required) + :type credential_request: CredentialRequest + :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._update_transaction_tests_credential_serialize( + id=id, + credential_request=credential_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CredentialWithoutValue", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_transaction_tests_credential_serialize( + self, + id, + credential_request, + 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 id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if credential_request is not None: + _body_params = credential_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='PUT', + resource_path='/v7/credentials/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/credentials_api/credentials_api/api_client.py b/credentials_api/credentials_api/api_client.py new file mode 100644 index 00000000..2be4f30e --- /dev/null +++ b/credentials_api/credentials_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 credentials_api.configuration import Configuration +from credentials_api.api_response import ApiResponse +import credentials_api.models +from credentials_api import rest +from credentials_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(credentials_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) diff --git a/credentials_api/credentials_api/api_response.py b/credentials_api/credentials_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/credentials_api/credentials_api/api_response.py @@ -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 + } diff --git a/credentials_api/credentials_api/configuration.py b/credentials_api/credentials_api/configuration.py new file mode 100644 index 00000000..75b610fb --- /dev/null +++ b/credentials_api/credentials_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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("credentials_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 diff --git a/credentials_api/credentials_api/exceptions.py b/credentials_api/credentials_api/exceptions.py new file mode 100644 index 00000000..1bf1c32f --- /dev/null +++ b/credentials_api/credentials_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 diff --git a/credentials_api/credentials_api/models/__init__.py b/credentials_api/credentials_api/models/__init__.py new file mode 100644 index 00000000..f0b98acd --- /dev/null +++ b/credentials_api/credentials_api/models/__init__.py @@ -0,0 +1,26 @@ +# coding: utf-8 + +# flake8: noqa +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 credentials_api.models.credential import Credential +from credentials_api.models.credential_request import CredentialRequest +from credentials_api.models.credential_without_value import CredentialWithoutValue +from credentials_api.models.credentials import Credentials +from credentials_api.models.error import Error +from credentials_api.models.get_transaction_tests_credentials_list200_response import GetTransactionTestsCredentialsList200Response +from credentials_api.models.link import Link +from credentials_api.models.self_links import SelfLinks +from credentials_api.models.self_links_links import SelfLinksLinks +from credentials_api.models.unauthorized_error import UnauthorizedError diff --git a/credentials_api/credentials_api/models/credential.py b/credentials_api/credentials_api/models/credential.py new file mode 100644 index 00000000..44cde164 --- /dev/null +++ b/credentials_api/credentials_api/models/credential.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 credentials_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Credential(BaseModel): + """ + Credential + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique ID of the credential.") + name: Optional[StrictStr] = Field(default=None, description="The name of the credential.") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + value: Optional[StrictStr] = Field(default=None, description="The value of the credential that will be encrypted.") + __properties: ClassVar[List[str]] = ["id", "name", "_links", "value"] + + 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 Credential 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 Credential from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "value": obj.get("value") + }) + return _obj + + diff --git a/credentials_api/credentials_api/models/credential_request.py b/credentials_api/credentials_api/models/credential_request.py new file mode 100644 index 00000000..04fe525d --- /dev/null +++ b/credentials_api/credentials_api/models/credential_request.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 CredentialRequest(BaseModel): + """ + CredentialRequest + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the credential.") + value: Optional[StrictStr] = Field(default=None, description="The value of the credential that will be encrypted.") + __properties: ClassVar[List[str]] = ["name", "value"] + + 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 CredentialRequest 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 CredentialRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value") + }) + return _obj + + diff --git a/credentials_api/credentials_api/models/credential_without_value.py b/credentials_api/credentials_api/models/credential_without_value.py new file mode 100644 index 00000000..10b70d53 --- /dev/null +++ b/credentials_api/credentials_api/models/credential_without_value.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 credentials_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class CredentialWithoutValue(BaseModel): + """ + CredentialWithoutValue + """ # noqa: E501 + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + id: Optional[StrictStr] = Field(default=None, description="Unique ID of the credential.") + name: Optional[StrictStr] = Field(default=None, description="The name of the credential.") + __properties: ClassVar[List[str]] = ["_links", "id", "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 CredentialWithoutValue 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 CredentialWithoutValue 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, + "id": obj.get("id"), + "name": obj.get("name") + }) + return _obj + + diff --git a/credentials_api/credentials_api/models/credentials.py b/credentials_api/credentials_api/models/credentials.py new file mode 100644 index 00000000..17452104 --- /dev/null +++ b/credentials_api/credentials_api/models/credentials.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 credentials_api.models.credential import Credential +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Credentials(BaseModel): + """ + Credentials + """ # noqa: E501 + credentials: Optional[List[Credential]] = None + __properties: ClassVar[List[str]] = ["credentials"] + + 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 Credentials 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 credentials (list) + _items = [] + if self.credentials: + for _item in self.credentials: + if _item: + _items.append(_item.to_dict()) + _dict['credentials'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Credentials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "credentials": [Credential.from_dict(_item) for _item in obj.get("credentials")] if obj.get("credentials") is not None else None + }) + return _obj + + diff --git a/credentials_api/credentials_api/models/error.py b/credentials_api/credentials_api/models/error.py new file mode 100644 index 00000000..d59f242d --- /dev/null +++ b/credentials_api/credentials_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 + + diff --git a/credentials_api/credentials_api/models/get_transaction_tests_credentials_list200_response.py b/credentials_api/credentials_api/models/get_transaction_tests_credentials_list200_response.py new file mode 100644 index 00000000..c8c063a2 --- /dev/null +++ b/credentials_api/credentials_api/models/get_transaction_tests_credentials_list200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 credentials_api.models.credential import Credential +from credentials_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTransactionTestsCredentialsList200Response(BaseModel): + """ + GetTransactionTestsCredentialsList200Response + """ # noqa: E501 + credentials: Optional[List[Credential]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["credentials", "_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 GetTransactionTestsCredentialsList200Response 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 credentials (list) + _items = [] + if self.credentials: + for _item in self.credentials: + if _item: + _items.append(_item.to_dict()) + _dict['credentials'] = _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 GetTransactionTestsCredentialsList200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "credentials": [Credential.from_dict(_item) for _item in obj.get("credentials")] if obj.get("credentials") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/credentials_api/credentials_api/models/link.py b/credentials_api/credentials_api/models/link.py new file mode 100644 index 00000000..c1ff307b --- /dev/null +++ b/credentials_api/credentials_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 + + diff --git a/credentials_api/credentials_api/models/self_links.py b/credentials_api/credentials_api/models/self_links.py new file mode 100644 index 00000000..87cb4b22 --- /dev/null +++ b/credentials_api/credentials_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 credentials_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 + + diff --git a/credentials_api/credentials_api/models/self_links_links.py b/credentials_api/credentials_api/models/self_links_links.py new file mode 100644 index 00000000..c6fd6766 --- /dev/null +++ b/credentials_api/credentials_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 credentials_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 + + diff --git a/credentials_api/credentials_api/models/unauthorized_error.py b/credentials_api/credentials_api/models/unauthorized_error.py new file mode 100644 index 00000000..adee6320 --- /dev/null +++ b/credentials_api/credentials_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 + + diff --git a/credentials_api/credentials_api/py.typed b/credentials_api/credentials_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/credentials_api/credentials_api/rest.py b/credentials_api/credentials_api/rest.py new file mode 100644 index 00000000..426cde9e --- /dev/null +++ b/credentials_api/credentials_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 credentials_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) diff --git a/credentials_api/docs/Credential.md b/credentials_api/docs/Credential.md new file mode 100644 index 00000000..2a385016 --- /dev/null +++ b/credentials_api/docs/Credential.md @@ -0,0 +1,31 @@ +# Credential + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique ID of the credential. | [optional] +**name** | **str** | The name of the credential. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**value** | **str** | The value of the credential that will be encrypted. | [optional] + +## Example + +```python +from credentials_api.models.credential import Credential + +# TODO update the JSON string below +json = "{}" +# create an instance of Credential from a JSON string +credential_instance = Credential.from_json(json) +# print the JSON string representation of the object +print Credential.to_json() + +# convert the object into a dict +credential_dict = credential_instance.to_dict() +# create an instance of Credential from a dict +credential_form_dict = credential.from_dict(credential_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/credentials_api/docs/CredentialRequest.md b/credentials_api/docs/CredentialRequest.md new file mode 100644 index 00000000..6415be21 --- /dev/null +++ b/credentials_api/docs/CredentialRequest.md @@ -0,0 +1,29 @@ +# CredentialRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the credential. | [optional] +**value** | **str** | The value of the credential that will be encrypted. | [optional] + +## Example + +```python +from credentials_api.models.credential_request import CredentialRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CredentialRequest from a JSON string +credential_request_instance = CredentialRequest.from_json(json) +# print the JSON string representation of the object +print CredentialRequest.to_json() + +# convert the object into a dict +credential_request_dict = credential_request_instance.to_dict() +# create an instance of CredentialRequest from a dict +credential_request_form_dict = credential_request.from_dict(credential_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) + + diff --git a/credentials_api/docs/CredentialWithoutValue.md b/credentials_api/docs/CredentialWithoutValue.md new file mode 100644 index 00000000..896c33f6 --- /dev/null +++ b/credentials_api/docs/CredentialWithoutValue.md @@ -0,0 +1,30 @@ +# CredentialWithoutValue + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**id** | **str** | Unique ID of the credential. | [optional] +**name** | **str** | The name of the credential. | [optional] + +## Example + +```python +from credentials_api.models.credential_without_value import CredentialWithoutValue + +# TODO update the JSON string below +json = "{}" +# create an instance of CredentialWithoutValue from a JSON string +credential_without_value_instance = CredentialWithoutValue.from_json(json) +# print the JSON string representation of the object +print CredentialWithoutValue.to_json() + +# convert the object into a dict +credential_without_value_dict = credential_without_value_instance.to_dict() +# create an instance of CredentialWithoutValue from a dict +credential_without_value_form_dict = credential_without_value.from_dict(credential_without_value_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/credentials_api/docs/Credentials.md b/credentials_api/docs/Credentials.md new file mode 100644 index 00000000..141fffd0 --- /dev/null +++ b/credentials_api/docs/Credentials.md @@ -0,0 +1,28 @@ +# Credentials + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**credentials** | [**List[Credential]**](Credential.md) | | [optional] + +## Example + +```python +from credentials_api.models.credentials import Credentials + +# TODO update the JSON string below +json = "{}" +# create an instance of Credentials from a JSON string +credentials_instance = Credentials.from_json(json) +# print the JSON string representation of the object +print Credentials.to_json() + +# convert the object into a dict +credentials_dict = credentials_instance.to_dict() +# create an instance of Credentials from a dict +credentials_form_dict = credentials.from_dict(credentials_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/credentials_api/docs/CredentialsApi.md b/credentials_api/docs/CredentialsApi.md new file mode 100644 index 00000000..f5ca92ce --- /dev/null +++ b/credentials_api/docs/CredentialsApi.md @@ -0,0 +1,435 @@ +# credentials_api.CredentialsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_transaction_tests_credential**](CredentialsApi.md#create_transaction_tests_credential) | **POST** /v7/credentials | Create credential +[**delete_transaction_tests_credential**](CredentialsApi.md#delete_transaction_tests_credential) | **DELETE** /v7/credentials/{id} | Delete credential +[**get_transaction_tests_credential_details**](CredentialsApi.md#get_transaction_tests_credential_details) | **GET** /v7/credentials/{id} | Retrieve credential +[**get_transaction_tests_credentials_list**](CredentialsApi.md#get_transaction_tests_credentials_list) | **GET** /v7/credentials | List credentials +[**update_transaction_tests_credential**](CredentialsApi.md#update_transaction_tests_credential) | **PUT** /v7/credentials/{id} | Update credential + + +# **create_transaction_tests_credential** +> CredentialWithoutValue create_transaction_tests_credential(credential_request, aid=aid) + +Create credential + +Creates a new credential for ThousandEyes transaction tests, based on properties provided in the request data. To create a new credential, you must have permission to update tests. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import credentials_api +from credentials_api.models.credential_request import CredentialRequest +from credentials_api.models.credential_without_value import CredentialWithoutValue +from credentials_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 = credentials_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 = credentials_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with credentials_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = credentials_api.CredentialsApi(api_client) + credential_request = credentials_api.CredentialRequest() # CredentialRequest | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create credential + api_response = api_instance.create_transaction_tests_credential(credential_request, aid=aid) + print("The response of CredentialsApi->create_transaction_tests_credential:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CredentialsApi->create_transaction_tests_credential: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **credential_request** | [**CredentialRequest**](CredentialRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**CredentialWithoutValue**](CredentialWithoutValue.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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 | - | + +[[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) + +# **delete_transaction_tests_credential** +> delete_transaction_tests_credential(id, aid=aid) + +Delete credential + +Deletes a ThousandEyes transaction test credential, using the request parameters. To delete a credential, you must have permission to update tests and access to the credential based on its default or provided account ID. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import credentials_api +from credentials_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 = credentials_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 = credentials_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with credentials_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = credentials_api.CredentialsApi(api_client) + id = '3247' # str | The ID of the desired credential. + 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 credential + api_instance.delete_transaction_tests_credential(id, aid=aid) + except Exception as e: + print("Exception when calling CredentialsApi->delete_transaction_tests_credential: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The ID of the desired credential. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | - | + +[[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_transaction_tests_credential_details** +> Credential get_transaction_tests_credential_details(id, aid=aid) + +Retrieve credential + +Retrieves detailed information about a ThousandEyes transaction test credential. To access this information, you must have access to the credential based on its default or provided account ID. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import credentials_api +from credentials_api.models.credential import Credential +from credentials_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 = credentials_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 = credentials_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with credentials_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = credentials_api.CredentialsApi(api_client) + id = '3247' # str | The ID of the desired credential. + 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 credential + api_response = api_instance.get_transaction_tests_credential_details(id, aid=aid) + print("The response of CredentialsApi->get_transaction_tests_credential_details:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CredentialsApi->get_transaction_tests_credential_details: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The ID of the desired credential. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**Credential**](Credential.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 | - | +**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 | - | + +[[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_transaction_tests_credentials_list** +> GetTransactionTestsCredentialsList200Response get_transaction_tests_credentials_list(aid=aid) + +List credentials + +Retrieves a list of credentials configured in ThousandEyes. Users have access to the list of credentials based on the default settings or the specified account ID. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import credentials_api +from credentials_api.models.get_transaction_tests_credentials_list200_response import GetTransactionTestsCredentialsList200Response +from credentials_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 = credentials_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 = credentials_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with credentials_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = credentials_api.CredentialsApi(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 credentials + api_response = api_instance.get_transaction_tests_credentials_list(aid=aid) + print("The response of CredentialsApi->get_transaction_tests_credentials_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CredentialsApi->get_transaction_tests_credentials_list: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetTransactionTestsCredentialsList200Response**](GetTransactionTestsCredentialsList200Response.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 | - | + +[[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_transaction_tests_credential** +> CredentialWithoutValue update_transaction_tests_credential(id, credential_request, aid=aid) + +Update credential + +Updates the credential for ThousandEyes transaction tests, based on properties provided in the request data. To update a credential, you must have permission to update tests and access to the credential based on its default or provided account ID. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import credentials_api +from credentials_api.models.credential_request import CredentialRequest +from credentials_api.models.credential_without_value import CredentialWithoutValue +from credentials_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 = credentials_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 = credentials_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with credentials_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = credentials_api.CredentialsApi(api_client) + id = '3247' # str | The ID of the desired credential. + credential_request = credentials_api.CredentialRequest() # CredentialRequest | + 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: + # Update credential + api_response = api_instance.update_transaction_tests_credential(id, credential_request, aid=aid) + print("The response of CredentialsApi->update_transaction_tests_credential:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CredentialsApi->update_transaction_tests_credential: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The ID of the desired credential. | + **credential_request** | [**CredentialRequest**](CredentialRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**CredentialWithoutValue**](CredentialWithoutValue.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/credentials_api/docs/Error.md b/credentials_api/docs/Error.md new file mode 100644 index 00000000..b0e999a9 --- /dev/null +++ b/credentials_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from credentials_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/credentials_api/docs/GetTransactionTestsCredentialsList200Response.md b/credentials_api/docs/GetTransactionTestsCredentialsList200Response.md new file mode 100644 index 00000000..4d6d5aa3 --- /dev/null +++ b/credentials_api/docs/GetTransactionTestsCredentialsList200Response.md @@ -0,0 +1,29 @@ +# GetTransactionTestsCredentialsList200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**credentials** | [**List[Credential]**](Credential.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from credentials_api.models.get_transaction_tests_credentials_list200_response import GetTransactionTestsCredentialsList200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTransactionTestsCredentialsList200Response from a JSON string +get_transaction_tests_credentials_list200_response_instance = GetTransactionTestsCredentialsList200Response.from_json(json) +# print the JSON string representation of the object +print GetTransactionTestsCredentialsList200Response.to_json() + +# convert the object into a dict +get_transaction_tests_credentials_list200_response_dict = get_transaction_tests_credentials_list200_response_instance.to_dict() +# create an instance of GetTransactionTestsCredentialsList200Response from a dict +get_transaction_tests_credentials_list200_response_form_dict = get_transaction_tests_credentials_list200_response.from_dict(get_transaction_tests_credentials_list200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/credentials_api/docs/Link.md b/credentials_api/docs/Link.md new file mode 100644 index 00000000..2a8956ed --- /dev/null +++ b/credentials_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from credentials_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/credentials_api/docs/SelfLinks.md b/credentials_api/docs/SelfLinks.md new file mode 100644 index 00000000..4cc3b87f --- /dev/null +++ b/credentials_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from credentials_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/credentials_api/docs/SelfLinksLinks.md b/credentials_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..acfeb095 --- /dev/null +++ b/credentials_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from credentials_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/credentials_api/docs/UnauthorizedError.md b/credentials_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..dc39ee5b --- /dev/null +++ b/credentials_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from credentials_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/credentials_api/git_push.sh b/credentials_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/credentials_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/credentials_api/pyproject.toml b/credentials_api/pyproject.toml new file mode 100644 index 00000000..e39467de --- /dev/null +++ b/credentials_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "credentials_api" +version = "1.0.0" +description = "Credentials API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Credentials API"] +include = ["credentials_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/credentials_api/requirements.txt b/credentials_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/credentials_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/credentials_api/setup.cfg b/credentials_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/credentials_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/credentials_api/setup.py b/credentials_api/setup.py new file mode 100644 index 00000000..9f2eac3a --- /dev/null +++ b/credentials_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "credentials-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Credentials API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Credentials API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + """, # noqa: E501 + package_data={"credentials_api": ["py.typed"]}, +) diff --git a/credentials_api/test-requirements.txt b/credentials_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/credentials_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/credentials_api/test/__init__.py b/credentials_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/credentials_api/test/test_credential.py b/credentials_api/test/test_credential.py new file mode 100644 index 00000000..3aaaad25 --- /dev/null +++ b/credentials_api/test/test_credential.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 unittest +import datetime + +from credentials_api.models.credential import Credential + +class TestCredential(unittest.TestCase): + """Credential unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Credential: + """Test Credential + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Credential` + """ + model = Credential() + if include_optional: + return Credential( + id = '3247', + name = 'Example Credential', + links = credentials_api.models.self_links__links.SelfLinks__links( + self = credentials_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + value = 'rwhR12uDm1Im47p5IVXgzz4ORgC7m48ajzzeWVUt' + ) + else: + return Credential( + ) + """ + + def testCredential(self): + """Test Credential""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/credentials_api/test/test_credential_request.py b/credentials_api/test/test_credential_request.py new file mode 100644 index 00000000..72a09335 --- /dev/null +++ b/credentials_api/test/test_credential_request.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 unittest +import datetime + +from credentials_api.models.credential_request import CredentialRequest + +class TestCredentialRequest(unittest.TestCase): + """CredentialRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CredentialRequest: + """Test CredentialRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CredentialRequest` + """ + model = CredentialRequest() + if include_optional: + return CredentialRequest( + name = 'Example Credential 1', + value = 'Example Credential 1 Password' + ) + else: + return CredentialRequest( + ) + """ + + def testCredentialRequest(self): + """Test CredentialRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/credentials_api/test/test_credential_without_value.py b/credentials_api/test/test_credential_without_value.py new file mode 100644 index 00000000..f83ecbd2 --- /dev/null +++ b/credentials_api/test/test_credential_without_value.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 unittest +import datetime + +from credentials_api.models.credential_without_value import CredentialWithoutValue + +class TestCredentialWithoutValue(unittest.TestCase): + """CredentialWithoutValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CredentialWithoutValue: + """Test CredentialWithoutValue + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CredentialWithoutValue` + """ + model = CredentialWithoutValue() + if include_optional: + return CredentialWithoutValue( + links = credentials_api.models.self_links__links.SelfLinks__links( + self = credentials_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + id = '3247', + name = 'Example Credential' + ) + else: + return CredentialWithoutValue( + ) + """ + + def testCredentialWithoutValue(self): + """Test CredentialWithoutValue""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/credentials_api/test/test_credentials.py b/credentials_api/test/test_credentials.py new file mode 100644 index 00000000..140d109f --- /dev/null +++ b/credentials_api/test/test_credentials.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 unittest +import datetime + +from credentials_api.models.credentials import Credentials + +class TestCredentials(unittest.TestCase): + """Credentials unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Credentials: + """Test Credentials + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Credentials` + """ + model = Credentials() + if include_optional: + return Credentials( + credentials = [ + null + ] + ) + else: + return Credentials( + ) + """ + + def testCredentials(self): + """Test Credentials""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/credentials_api/test/test_credentials_api.py b/credentials_api/test/test_credentials_api.py new file mode 100644 index 00000000..0beaacee --- /dev/null +++ b/credentials_api/test/test_credentials_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 unittest + +from credentials_api.api.credentials_api import CredentialsApi + + +class TestCredentialsApi(unittest.TestCase): + """CredentialsApi unit test stubs""" + + def setUp(self) -> None: + self.api = CredentialsApi() + + def tearDown(self) -> None: + pass + + def test_create_transaction_tests_credential(self) -> None: + """Test case for create_transaction_tests_credential + + Create credential + """ + pass + + def test_delete_transaction_tests_credential(self) -> None: + """Test case for delete_transaction_tests_credential + + Delete credential + """ + pass + + def test_get_transaction_tests_credential_details(self) -> None: + """Test case for get_transaction_tests_credential_details + + Retrieve credential + """ + pass + + def test_get_transaction_tests_credentials_list(self) -> None: + """Test case for get_transaction_tests_credentials_list + + List credentials + """ + pass + + def test_update_transaction_tests_credential(self) -> None: + """Test case for update_transaction_tests_credential + + Update credential + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/credentials_api/test/test_error.py b/credentials_api/test/test_error.py new file mode 100644 index 00000000..84a96848 --- /dev/null +++ b/credentials_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 unittest +import datetime + +from credentials_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/credentials_api/test/test_get_transaction_tests_credentials_list200_response.py b/credentials_api/test/test_get_transaction_tests_credentials_list200_response.py new file mode 100644 index 00000000..23b815e6 --- /dev/null +++ b/credentials_api/test/test_get_transaction_tests_credentials_list200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 unittest +import datetime + +from credentials_api.models.get_transaction_tests_credentials_list200_response import GetTransactionTestsCredentialsList200Response + +class TestGetTransactionTestsCredentialsList200Response(unittest.TestCase): + """GetTransactionTestsCredentialsList200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTransactionTestsCredentialsList200Response: + """Test GetTransactionTestsCredentialsList200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTransactionTestsCredentialsList200Response` + """ + model = GetTransactionTestsCredentialsList200Response() + if include_optional: + return GetTransactionTestsCredentialsList200Response( + credentials = [ + null + ], + links = credentials_api.models.self_links__links.SelfLinks__links( + self = credentials_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTransactionTestsCredentialsList200Response( + ) + """ + + def testGetTransactionTestsCredentialsList200Response(self): + """Test GetTransactionTestsCredentialsList200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/credentials_api/test/test_link.py b/credentials_api/test/test_link.py new file mode 100644 index 00000000..9617703a --- /dev/null +++ b/credentials_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 unittest +import datetime + +from credentials_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/credentials_api/test/test_self_links.py b/credentials_api/test/test_self_links.py new file mode 100644 index 00000000..f0dcf715 --- /dev/null +++ b/credentials_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 unittest +import datetime + +from credentials_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = credentials_api.models.self_links__links.SelfLinks__links( + self = credentials_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/credentials_api/test/test_self_links_links.py b/credentials_api/test/test_self_links_links.py new file mode 100644 index 00000000..0b61abfc --- /dev/null +++ b/credentials_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 unittest +import datetime + +from credentials_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = credentials_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/credentials_api/test/test_unauthorized_error.py b/credentials_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..576caf0b --- /dev/null +++ b/credentials_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Credentials API + + ### Overview Manage credentials for transaction tests using the Credentials API. The following permissions are required to access Credentials API endpoints: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. * `View sensitive data in web transaction scripts` to view the encrypted value property of credentials. * `Settings Tests Create Transaction (Tx) Tests` to create credentials. + + 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 unittest +import datetime + +from credentials_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/credentials_api/tox.ini b/credentials_api/tox.ini new file mode 100644 index 00000000..56be22c5 --- /dev/null +++ b/credentials_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=credentials_api diff --git a/dashboards_api/.github/workflows/python.yml b/dashboards_api/.github/workflows/python.yml new file mode 100644 index 00000000..fe2abfbc --- /dev/null +++ b/dashboards_api/.github/workflows/python.yml @@ -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: dashboards_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 diff --git a/dashboards_api/.gitignore b/dashboards_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/dashboards_api/.gitignore @@ -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 diff --git a/dashboards_api/.gitlab-ci.yml b/dashboards_api/.gitlab-ci.yml new file mode 100644 index 00000000..f1e9dcb7 --- /dev/null +++ b/dashboards_api/.gitlab-ci.yml @@ -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=dashboards_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 diff --git a/dashboards_api/.openapi-generator-ignore b/dashboards_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/dashboards_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/dashboards_api/.openapi-generator/FILES b/dashboards_api/.openapi-generator/FILES new file mode 100644 index 00000000..25df37ae --- /dev/null +++ b/dashboards_api/.openapi-generator/FILES @@ -0,0 +1,326 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +dashboards_api/__init__.py +dashboards_api/api/__init__.py +dashboards_api/api/dashboard_snapshots_api.py +dashboards_api/api/dashboards_api.py +dashboards_api/api_client.py +dashboards_api/api_response.py +dashboards_api/configuration.py +dashboards_api/exceptions.py +dashboards_api/models/__init__.py +dashboards_api/models/agent_status_datasource.py +dashboards_api/models/agent_widget_show.py +dashboards_api/models/agent_widget_type.py +dashboards_api/models/alert_list_datasource.py +dashboards_api/models/api_agent_location.py +dashboards_api/models/api_agent_status_agent.py +dashboards_api/models/api_agent_status_ip_info.py +dashboards_api/models/api_agent_status_summary.py +dashboards_api/models/api_agent_status_widget.py +dashboards_api/models/api_aggregate_property.py +dashboards_api/models/api_alert_list_alert.py +dashboards_api/models/api_alert_list_alert_type.py +dashboards_api/models/api_alert_list_widget.py +dashboards_api/models/api_alert_list_widget_all_of_active_within.py +dashboards_api/models/api_box_and_whiskers_widget.py +dashboards_api/models/api_color_grid_widget.py +dashboards_api/models/api_dashboard.py +dashboards_api/models/api_dashboard_asw.py +dashboards_api/models/api_dashboard_snapshot.py +dashboards_api/models/api_dashboard_snapshot_all_of_dashboard.py +dashboards_api/models/api_data_point_group.py +dashboards_api/models/api_default_timespan.py +dashboards_api/models/api_duration.py +dashboards_api/models/api_geo_map_widget.py +dashboards_api/models/api_graphlet_point.py +dashboards_api/models/api_grouped_barchart_widget.py +dashboards_api/models/api_multi_metric_column.py +dashboards_api/models/api_multi_metric_column_data.py +dashboards_api/models/api_multi_metric_table_widget.py +dashboards_api/models/api_multi_search_filter_api_test_table_filter_key.py +dashboards_api/models/api_numbers_card.py +dashboards_api/models/api_numbers_card_all_of_fixed_timespan.py +dashboards_api/models/api_numbers_card_data.py +dashboards_api/models/api_numbers_card_widget.py +dashboards_api/models/api_pie_chart_widget.py +dashboards_api/models/api_report_data_component_label_map.py +dashboards_api/models/api_report_data_component_label_map_entry.py +dashboards_api/models/api_report_snapshot_time_span.py +dashboards_api/models/api_stacked_area_chart_widget.py +dashboards_api/models/api_stacked_barchart_widget.py +dashboards_api/models/api_table_widget.py +dashboards_api/models/api_test_table_data.py +dashboards_api/models/api_test_table_graphlets_data.py +dashboards_api/models/api_test_table_widget.py +dashboards_api/models/api_timeseries_widget.py +dashboards_api/models/api_widget.py +dashboards_api/models/api_widget_data_point.py +dashboards_api/models/api_widget_data_response.py +dashboards_api/models/api_widget_filter_api_test_table_filter_key.py +dashboards_api/models/api_widget_fixed_y_scale_prefix.py +dashboards_api/models/api_widget_measure.py +dashboards_api/models/api_widgets_data_v2.py +dashboards_api/models/asw_repeat.py +dashboards_api/models/asw_repeat_unit.py +dashboards_api/models/box_and_whiskers_datasource.py +dashboards_api/models/color_grid_datasource.py +dashboards_api/models/dashboard_links.py +dashboards_api/models/dashboard_links_links.py +dashboards_api/models/dashboard_metric.py +dashboards_api/models/dashboard_metric_direction.py +dashboards_api/models/dashboard_order.py +dashboards_api/models/dashboard_snapshot_links.py +dashboards_api/models/dashboard_snapshot_links_links.py +dashboards_api/models/dashboard_snapshots200_response.py +dashboards_api/models/dashboard_snapshots_page.py +dashboards_api/models/duration_unit.py +dashboards_api/models/enterprise_agent_state.py +dashboards_api/models/error.py +dashboards_api/models/generate_dashboard_snapshot_request.py +dashboards_api/models/geo_map_datasource.py +dashboards_api/models/get_dashboard_data200_response.py +dashboards_api/models/grouped_bar_chart_datasource.py +dashboards_api/models/link.py +dashboards_api/models/metric_group.py +dashboards_api/models/multi_metrics_table_datasource.py +dashboards_api/models/numbers_card_datasource.py +dashboards_api/models/pagination_links.py +dashboards_api/models/pagination_links_links.py +dashboards_api/models/pie_chart_datasource.py +dashboards_api/models/query_window.py +dashboards_api/models/scalable_widget.py +dashboards_api/models/self_links.py +dashboards_api/models/self_links_links.py +dashboards_api/models/snapshot_data_by_widget200_response.py +dashboards_api/models/stacked_area_chart_datasource.py +dashboards_api/models/stacked_bar_chart_datasource.py +dashboards_api/models/table_datasource.py +dashboards_api/models/test_table_datasource.py +dashboards_api/models/test_table_filter_key.py +dashboards_api/models/test_table_filter_type.py +dashboards_api/models/timeseries_datasource.py +dashboards_api/models/unauthorized_error.py +dashboards_api/models/update_snapshot_expiration_date_api_request.py +dashboards_api/models/visual_mode.py +dashboards_api/models/widget.py +dashboards_api/models/widget_measure_type.py +dashboards_api/models/widget_sort_direction.py +dashboards_api/models/widget_sort_property.py +dashboards_api/models/widget_type.py +dashboards_api/py.typed +dashboards_api/rest.py +docs/AgentStatusDatasource.md +docs/AgentWidgetShow.md +docs/AgentWidgetType.md +docs/AlertListDatasource.md +docs/ApiAgentLocation.md +docs/ApiAgentStatusAgent.md +docs/ApiAgentStatusIpInfo.md +docs/ApiAgentStatusSummary.md +docs/ApiAgentStatusWidget.md +docs/ApiAggregateProperty.md +docs/ApiAlertListAlert.md +docs/ApiAlertListAlertType.md +docs/ApiAlertListWidget.md +docs/ApiAlertListWidgetAllOfActiveWithin.md +docs/ApiBoxAndWhiskersWidget.md +docs/ApiColorGridWidget.md +docs/ApiDashboard.md +docs/ApiDashboardAsw.md +docs/ApiDashboardSnapshot.md +docs/ApiDashboardSnapshotAllOfDashboard.md +docs/ApiDataPointGroup.md +docs/ApiDefaultTimespan.md +docs/ApiDuration.md +docs/ApiGeoMapWidget.md +docs/ApiGraphletPoint.md +docs/ApiGroupedBarchartWidget.md +docs/ApiMultiMetricColumn.md +docs/ApiMultiMetricColumnData.md +docs/ApiMultiMetricTableWidget.md +docs/ApiMultiSearchFilterApiTestTableFilterKey.md +docs/ApiNumbersCard.md +docs/ApiNumbersCardAllOfFixedTimespan.md +docs/ApiNumbersCardData.md +docs/ApiNumbersCardWidget.md +docs/ApiPieChartWidget.md +docs/ApiReportDataComponentLabelMap.md +docs/ApiReportDataComponentLabelMapEntry.md +docs/ApiReportSnapshotTimeSpan.md +docs/ApiStackedAreaChartWidget.md +docs/ApiStackedBarchartWidget.md +docs/ApiTableWidget.md +docs/ApiTestTableData.md +docs/ApiTestTableGraphletsData.md +docs/ApiTestTableWidget.md +docs/ApiTimeseriesWidget.md +docs/ApiWidget.md +docs/ApiWidgetDataPoint.md +docs/ApiWidgetDataResponse.md +docs/ApiWidgetFilterApiTestTableFilterKey.md +docs/ApiWidgetFixedYScalePrefix.md +docs/ApiWidgetMeasure.md +docs/ApiWidgetsDataV2.md +docs/AswRepeat.md +docs/AswRepeatUnit.md +docs/BoxAndWhiskersDatasource.md +docs/ColorGridDatasource.md +docs/DashboardLinks.md +docs/DashboardLinksLinks.md +docs/DashboardMetric.md +docs/DashboardMetricDirection.md +docs/DashboardOrder.md +docs/DashboardSnapshotLinks.md +docs/DashboardSnapshotLinksLinks.md +docs/DashboardSnapshots200Response.md +docs/DashboardSnapshotsApi.md +docs/DashboardSnapshotsPage.md +docs/DashboardsApi.md +docs/DurationUnit.md +docs/EnterpriseAgentState.md +docs/Error.md +docs/GenerateDashboardSnapshotRequest.md +docs/GeoMapDatasource.md +docs/GetDashboardData200Response.md +docs/GroupedBarChartDatasource.md +docs/Link.md +docs/MetricGroup.md +docs/MultiMetricsTableDatasource.md +docs/NumbersCardDatasource.md +docs/PaginationLinks.md +docs/PaginationLinksLinks.md +docs/PieChartDatasource.md +docs/QueryWindow.md +docs/ScalableWidget.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/SnapshotDataByWidget200Response.md +docs/StackedAreaChartDatasource.md +docs/StackedBarChartDatasource.md +docs/TableDatasource.md +docs/TestTableDatasource.md +docs/TestTableFilterKey.md +docs/TestTableFilterType.md +docs/TimeseriesDatasource.md +docs/UnauthorizedError.md +docs/UpdateSnapshotExpirationDateApiRequest.md +docs/VisualMode.md +docs/Widget.md +docs/WidgetMeasureType.md +docs/WidgetSortDirection.md +docs/WidgetSortProperty.md +docs/WidgetType.md +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_agent_status_datasource.py +test/test_agent_widget_show.py +test/test_agent_widget_type.py +test/test_alert_list_datasource.py +test/test_api_agent_location.py +test/test_api_agent_status_agent.py +test/test_api_agent_status_ip_info.py +test/test_api_agent_status_summary.py +test/test_api_agent_status_widget.py +test/test_api_aggregate_property.py +test/test_api_alert_list_alert.py +test/test_api_alert_list_alert_type.py +test/test_api_alert_list_widget.py +test/test_api_alert_list_widget_all_of_active_within.py +test/test_api_box_and_whiskers_widget.py +test/test_api_color_grid_widget.py +test/test_api_dashboard.py +test/test_api_dashboard_asw.py +test/test_api_dashboard_snapshot.py +test/test_api_dashboard_snapshot_all_of_dashboard.py +test/test_api_data_point_group.py +test/test_api_default_timespan.py +test/test_api_duration.py +test/test_api_geo_map_widget.py +test/test_api_graphlet_point.py +test/test_api_grouped_barchart_widget.py +test/test_api_multi_metric_column.py +test/test_api_multi_metric_column_data.py +test/test_api_multi_metric_table_widget.py +test/test_api_multi_search_filter_api_test_table_filter_key.py +test/test_api_numbers_card.py +test/test_api_numbers_card_all_of_fixed_timespan.py +test/test_api_numbers_card_data.py +test/test_api_numbers_card_widget.py +test/test_api_pie_chart_widget.py +test/test_api_report_data_component_label_map.py +test/test_api_report_data_component_label_map_entry.py +test/test_api_report_snapshot_time_span.py +test/test_api_stacked_area_chart_widget.py +test/test_api_stacked_barchart_widget.py +test/test_api_table_widget.py +test/test_api_test_table_data.py +test/test_api_test_table_graphlets_data.py +test/test_api_test_table_widget.py +test/test_api_timeseries_widget.py +test/test_api_widget.py +test/test_api_widget_data_point.py +test/test_api_widget_data_response.py +test/test_api_widget_filter_api_test_table_filter_key.py +test/test_api_widget_fixed_y_scale_prefix.py +test/test_api_widget_measure.py +test/test_api_widgets_data_v2.py +test/test_asw_repeat.py +test/test_asw_repeat_unit.py +test/test_box_and_whiskers_datasource.py +test/test_color_grid_datasource.py +test/test_dashboard_links.py +test/test_dashboard_links_links.py +test/test_dashboard_metric.py +test/test_dashboard_metric_direction.py +test/test_dashboard_order.py +test/test_dashboard_snapshot_links.py +test/test_dashboard_snapshot_links_links.py +test/test_dashboard_snapshots200_response.py +test/test_dashboard_snapshots_api.py +test/test_dashboard_snapshots_page.py +test/test_dashboards_api.py +test/test_duration_unit.py +test/test_enterprise_agent_state.py +test/test_error.py +test/test_generate_dashboard_snapshot_request.py +test/test_geo_map_datasource.py +test/test_get_dashboard_data200_response.py +test/test_grouped_bar_chart_datasource.py +test/test_link.py +test/test_metric_group.py +test/test_multi_metrics_table_datasource.py +test/test_numbers_card_datasource.py +test/test_pagination_links.py +test/test_pagination_links_links.py +test/test_pie_chart_datasource.py +test/test_query_window.py +test/test_scalable_widget.py +test/test_self_links.py +test/test_self_links_links.py +test/test_snapshot_data_by_widget200_response.py +test/test_stacked_area_chart_datasource.py +test/test_stacked_bar_chart_datasource.py +test/test_table_datasource.py +test/test_test_table_datasource.py +test/test_test_table_filter_key.py +test/test_test_table_filter_type.py +test/test_timeseries_datasource.py +test/test_unauthorized_error.py +test/test_update_snapshot_expiration_date_api_request.py +test/test_visual_mode.py +test/test_widget.py +test/test_widget_measure_type.py +test/test_widget_sort_direction.py +test/test_widget_sort_property.py +test/test_widget_type.py +tox.ini diff --git a/dashboards_api/.openapi-generator/VERSION b/dashboards_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/dashboards_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/dashboards_api/.travis.yml b/dashboards_api/.travis.yml new file mode 100644 index 00000000..c132d17f --- /dev/null +++ b/dashboards_api/.travis.yml @@ -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=dashboards_api diff --git a/dashboards_api/README.md b/dashboards_api/README.md new file mode 100644 index 00000000..8ac5e896 --- /dev/null +++ b/dashboards_api/README.md @@ -0,0 +1,230 @@ +# dashboards-api +Manage ThousandEyes Dashboards + +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 dashboards_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 dashboards_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 dashboards_api +from dashboards_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 = dashboards_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 = dashboards_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with dashboards_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = dashboards_api.DashboardSnapshotsApi(api_client) + generate_dashboard_snapshot_request = dashboards_api.GenerateDashboardSnapshotRequest() # GenerateDashboardSnapshotRequest | Request body schema to create a dashboard snapshot. + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create dashboard snapshot + api_response = api_instance.create_dashboard_snapshot(generate_dashboard_snapshot_request, aid=aid) + print("The response of DashboardSnapshotsApi->create_dashboard_snapshot:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling DashboardSnapshotsApi->create_dashboard_snapshot: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DashboardSnapshotsApi* | [**create_dashboard_snapshot**](docs/DashboardSnapshotsApi.md#create_dashboard_snapshot) | **POST** /v7/dashboard-snapshots | Create dashboard snapshot +*DashboardSnapshotsApi* | [**dashboard_snapshot_by_id**](docs/DashboardSnapshotsApi.md#dashboard_snapshot_by_id) | **GET** /v7/dashboard-snapshots/{snapshotId} | Retrieve dashboard snapshot +*DashboardSnapshotsApi* | [**dashboard_snapshots**](docs/DashboardSnapshotsApi.md#dashboard_snapshots) | **GET** /v7/dashboard-snapshots | List dashboard snapshots +*DashboardSnapshotsApi* | [**delete_dashboard_snapshot**](docs/DashboardSnapshotsApi.md#delete_dashboard_snapshot) | **DELETE** /v7/dashboard-snapshots/{snapshotId} | Delete dashboard snapshot +*DashboardSnapshotsApi* | [**snapshot_data_by_widget**](docs/DashboardSnapshotsApi.md#snapshot_data_by_widget) | **GET** /v7/dashboard-snapshots/{snapshotId}/widgets/{widgetId} | Retrieve dashboard snapshot data +*DashboardSnapshotsApi* | [**update_snapshot_expiration_date**](docs/DashboardSnapshotsApi.md#update_snapshot_expiration_date) | **PATCH** /v7/dashboard-snapshots/{snapshotId} | Update snapshot expiration +*DashboardsApi* | [**create_dashboard**](docs/DashboardsApi.md#create_dashboard) | **POST** /v7/dashboards | Create dashboard +*DashboardsApi* | [**delete_dashboard**](docs/DashboardsApi.md#delete_dashboard) | **DELETE** /v7/dashboards/{dashboardId} | Delete dashboard +*DashboardsApi* | [**get_dashboard_by_id**](docs/DashboardsApi.md#get_dashboard_by_id) | **GET** /v7/dashboards/{dashboardId} | Retrieve dashboard +*DashboardsApi* | [**get_dashboard_data**](docs/DashboardsApi.md#get_dashboard_data) | **GET** /v7/dashboards/{dashboardId}/widgets/{widgetId} | Retrieve dashboard widget data +*DashboardsApi* | [**get_dashboards_for_user**](docs/DashboardsApi.md#get_dashboards_for_user) | **GET** /v7/dashboards | List dashboards +*DashboardsApi* | [**update_dashboard**](docs/DashboardsApi.md#update_dashboard) | **PUT** /v7/dashboards/{dashboardId} | Update dashboard + + +## Documentation For Models + + - [AgentStatusDatasource](docs/AgentStatusDatasource.md) + - [AgentWidgetShow](docs/AgentWidgetShow.md) + - [AgentWidgetType](docs/AgentWidgetType.md) + - [AlertListDatasource](docs/AlertListDatasource.md) + - [ApiAgentLocation](docs/ApiAgentLocation.md) + - [ApiAgentStatusAgent](docs/ApiAgentStatusAgent.md) + - [ApiAgentStatusIpInfo](docs/ApiAgentStatusIpInfo.md) + - [ApiAgentStatusSummary](docs/ApiAgentStatusSummary.md) + - [ApiAgentStatusWidget](docs/ApiAgentStatusWidget.md) + - [ApiAggregateProperty](docs/ApiAggregateProperty.md) + - [ApiAlertListAlert](docs/ApiAlertListAlert.md) + - [ApiAlertListAlertType](docs/ApiAlertListAlertType.md) + - [ApiAlertListWidget](docs/ApiAlertListWidget.md) + - [ApiAlertListWidgetAllOfActiveWithin](docs/ApiAlertListWidgetAllOfActiveWithin.md) + - [ApiBoxAndWhiskersWidget](docs/ApiBoxAndWhiskersWidget.md) + - [ApiColorGridWidget](docs/ApiColorGridWidget.md) + - [ApiDashboard](docs/ApiDashboard.md) + - [ApiDashboardAsw](docs/ApiDashboardAsw.md) + - [ApiDashboardSnapshot](docs/ApiDashboardSnapshot.md) + - [ApiDashboardSnapshotAllOfDashboard](docs/ApiDashboardSnapshotAllOfDashboard.md) + - [ApiDataPointGroup](docs/ApiDataPointGroup.md) + - [ApiDefaultTimespan](docs/ApiDefaultTimespan.md) + - [ApiDuration](docs/ApiDuration.md) + - [ApiGeoMapWidget](docs/ApiGeoMapWidget.md) + - [ApiGraphletPoint](docs/ApiGraphletPoint.md) + - [ApiGroupedBarchartWidget](docs/ApiGroupedBarchartWidget.md) + - [ApiMultiMetricColumn](docs/ApiMultiMetricColumn.md) + - [ApiMultiMetricColumnData](docs/ApiMultiMetricColumnData.md) + - [ApiMultiMetricTableWidget](docs/ApiMultiMetricTableWidget.md) + - [ApiMultiSearchFilterApiTestTableFilterKey](docs/ApiMultiSearchFilterApiTestTableFilterKey.md) + - [ApiNumbersCard](docs/ApiNumbersCard.md) + - [ApiNumbersCardAllOfFixedTimespan](docs/ApiNumbersCardAllOfFixedTimespan.md) + - [ApiNumbersCardData](docs/ApiNumbersCardData.md) + - [ApiNumbersCardWidget](docs/ApiNumbersCardWidget.md) + - [ApiPieChartWidget](docs/ApiPieChartWidget.md) + - [ApiReportDataComponentLabelMap](docs/ApiReportDataComponentLabelMap.md) + - [ApiReportDataComponentLabelMapEntry](docs/ApiReportDataComponentLabelMapEntry.md) + - [ApiReportSnapshotTimeSpan](docs/ApiReportSnapshotTimeSpan.md) + - [ApiStackedAreaChartWidget](docs/ApiStackedAreaChartWidget.md) + - [ApiStackedBarchartWidget](docs/ApiStackedBarchartWidget.md) + - [ApiTableWidget](docs/ApiTableWidget.md) + - [ApiTestTableData](docs/ApiTestTableData.md) + - [ApiTestTableGraphletsData](docs/ApiTestTableGraphletsData.md) + - [ApiTestTableWidget](docs/ApiTestTableWidget.md) + - [ApiTimeseriesWidget](docs/ApiTimeseriesWidget.md) + - [ApiWidget](docs/ApiWidget.md) + - [ApiWidgetDataPoint](docs/ApiWidgetDataPoint.md) + - [ApiWidgetDataResponse](docs/ApiWidgetDataResponse.md) + - [ApiWidgetFilterApiTestTableFilterKey](docs/ApiWidgetFilterApiTestTableFilterKey.md) + - [ApiWidgetFixedYScalePrefix](docs/ApiWidgetFixedYScalePrefix.md) + - [ApiWidgetMeasure](docs/ApiWidgetMeasure.md) + - [ApiWidgetsDataV2](docs/ApiWidgetsDataV2.md) + - [AswRepeat](docs/AswRepeat.md) + - [AswRepeatUnit](docs/AswRepeatUnit.md) + - [BoxAndWhiskersDatasource](docs/BoxAndWhiskersDatasource.md) + - [ColorGridDatasource](docs/ColorGridDatasource.md) + - [DashboardLinks](docs/DashboardLinks.md) + - [DashboardLinksLinks](docs/DashboardLinksLinks.md) + - [DashboardMetric](docs/DashboardMetric.md) + - [DashboardMetricDirection](docs/DashboardMetricDirection.md) + - [DashboardOrder](docs/DashboardOrder.md) + - [DashboardSnapshotLinks](docs/DashboardSnapshotLinks.md) + - [DashboardSnapshotLinksLinks](docs/DashboardSnapshotLinksLinks.md) + - [DashboardSnapshots200Response](docs/DashboardSnapshots200Response.md) + - [DashboardSnapshotsPage](docs/DashboardSnapshotsPage.md) + - [DurationUnit](docs/DurationUnit.md) + - [EnterpriseAgentState](docs/EnterpriseAgentState.md) + - [Error](docs/Error.md) + - [GenerateDashboardSnapshotRequest](docs/GenerateDashboardSnapshotRequest.md) + - [GeoMapDatasource](docs/GeoMapDatasource.md) + - [GetDashboardData200Response](docs/GetDashboardData200Response.md) + - [GroupedBarChartDatasource](docs/GroupedBarChartDatasource.md) + - [Link](docs/Link.md) + - [MetricGroup](docs/MetricGroup.md) + - [MultiMetricsTableDatasource](docs/MultiMetricsTableDatasource.md) + - [NumbersCardDatasource](docs/NumbersCardDatasource.md) + - [PaginationLinks](docs/PaginationLinks.md) + - [PaginationLinksLinks](docs/PaginationLinksLinks.md) + - [PieChartDatasource](docs/PieChartDatasource.md) + - [QueryWindow](docs/QueryWindow.md) + - [ScalableWidget](docs/ScalableWidget.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [SnapshotDataByWidget200Response](docs/SnapshotDataByWidget200Response.md) + - [StackedAreaChartDatasource](docs/StackedAreaChartDatasource.md) + - [StackedBarChartDatasource](docs/StackedBarChartDatasource.md) + - [TableDatasource](docs/TableDatasource.md) + - [TestTableDatasource](docs/TestTableDatasource.md) + - [TestTableFilterKey](docs/TestTableFilterKey.md) + - [TestTableFilterType](docs/TestTableFilterType.md) + - [TimeseriesDatasource](docs/TimeseriesDatasource.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + - [UpdateSnapshotExpirationDateApiRequest](docs/UpdateSnapshotExpirationDateApiRequest.md) + - [VisualMode](docs/VisualMode.md) + - [Widget](docs/Widget.md) + - [WidgetMeasureType](docs/WidgetMeasureType.md) + - [WidgetSortDirection](docs/WidgetSortDirection.md) + - [WidgetSortProperty](docs/WidgetSortProperty.md) + - [WidgetType](docs/WidgetType.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/dashboards_api/dashboards_api/__init__.py b/dashboards_api/dashboards_api/__init__.py new file mode 100644 index 00000000..967e4fa3 --- /dev/null +++ b/dashboards_api/dashboards_api/__init__.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.api.dashboard_snapshots_api import DashboardSnapshotsApi +from dashboards_api.api.dashboards_api import DashboardsApi + +# import ApiClient +from dashboards_api.api_response import ApiResponse +from dashboards_api.api_client import ApiClient +from dashboards_api.configuration import Configuration +from dashboards_api.exceptions import OpenApiException +from dashboards_api.exceptions import ApiTypeError +from dashboards_api.exceptions import ApiValueError +from dashboards_api.exceptions import ApiKeyError +from dashboards_api.exceptions import ApiAttributeError +from dashboards_api.exceptions import ApiException + +# import models into sdk package +from dashboards_api.models.agent_status_datasource import AgentStatusDatasource +from dashboards_api.models.agent_widget_show import AgentWidgetShow +from dashboards_api.models.agent_widget_type import AgentWidgetType +from dashboards_api.models.alert_list_datasource import AlertListDatasource +from dashboards_api.models.api_agent_location import ApiAgentLocation +from dashboards_api.models.api_agent_status_agent import ApiAgentStatusAgent +from dashboards_api.models.api_agent_status_ip_info import ApiAgentStatusIpInfo +from dashboards_api.models.api_agent_status_summary import ApiAgentStatusSummary +from dashboards_api.models.api_agent_status_widget import ApiAgentStatusWidget +from dashboards_api.models.api_aggregate_property import ApiAggregateProperty +from dashboards_api.models.api_alert_list_alert import ApiAlertListAlert +from dashboards_api.models.api_alert_list_alert_type import ApiAlertListAlertType +from dashboards_api.models.api_alert_list_widget import ApiAlertListWidget +from dashboards_api.models.api_alert_list_widget_all_of_active_within import ApiAlertListWidgetAllOfActiveWithin +from dashboards_api.models.api_box_and_whiskers_widget import ApiBoxAndWhiskersWidget +from dashboards_api.models.api_color_grid_widget import ApiColorGridWidget +from dashboards_api.models.api_dashboard import ApiDashboard +from dashboards_api.models.api_dashboard_asw import ApiDashboardAsw +from dashboards_api.models.api_dashboard_snapshot import ApiDashboardSnapshot +from dashboards_api.models.api_dashboard_snapshot_all_of_dashboard import ApiDashboardSnapshotAllOfDashboard +from dashboards_api.models.api_data_point_group import ApiDataPointGroup +from dashboards_api.models.api_default_timespan import ApiDefaultTimespan +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_geo_map_widget import ApiGeoMapWidget +from dashboards_api.models.api_graphlet_point import ApiGraphletPoint +from dashboards_api.models.api_grouped_barchart_widget import ApiGroupedBarchartWidget +from dashboards_api.models.api_multi_metric_column import ApiMultiMetricColumn +from dashboards_api.models.api_multi_metric_column_data import ApiMultiMetricColumnData +from dashboards_api.models.api_multi_metric_table_widget import ApiMultiMetricTableWidget +from dashboards_api.models.api_multi_search_filter_api_test_table_filter_key import ApiMultiSearchFilterApiTestTableFilterKey +from dashboards_api.models.api_numbers_card import ApiNumbersCard +from dashboards_api.models.api_numbers_card_all_of_fixed_timespan import ApiNumbersCardAllOfFixedTimespan +from dashboards_api.models.api_numbers_card_data import ApiNumbersCardData +from dashboards_api.models.api_numbers_card_widget import ApiNumbersCardWidget +from dashboards_api.models.api_pie_chart_widget import ApiPieChartWidget +from dashboards_api.models.api_report_data_component_label_map import ApiReportDataComponentLabelMap +from dashboards_api.models.api_report_data_component_label_map_entry import ApiReportDataComponentLabelMapEntry +from dashboards_api.models.api_report_snapshot_time_span import ApiReportSnapshotTimeSpan +from dashboards_api.models.api_stacked_area_chart_widget import ApiStackedAreaChartWidget +from dashboards_api.models.api_stacked_barchart_widget import ApiStackedBarchartWidget +from dashboards_api.models.api_table_widget import ApiTableWidget +from dashboards_api.models.api_test_table_data import ApiTestTableData +from dashboards_api.models.api_test_table_graphlets_data import ApiTestTableGraphletsData +from dashboards_api.models.api_test_table_widget import ApiTestTableWidget +from dashboards_api.models.api_timeseries_widget import ApiTimeseriesWidget +from dashboards_api.models.api_widget import ApiWidget +from dashboards_api.models.api_widget_data_point import ApiWidgetDataPoint +from dashboards_api.models.api_widget_data_response import ApiWidgetDataResponse +from dashboards_api.models.api_widget_filter_api_test_table_filter_key import ApiWidgetFilterApiTestTableFilterKey +from dashboards_api.models.api_widget_fixed_y_scale_prefix import ApiWidgetFixedYScalePrefix +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.api_widgets_data_v2 import ApiWidgetsDataV2 +from dashboards_api.models.asw_repeat import AswRepeat +from dashboards_api.models.asw_repeat_unit import AswRepeatUnit +from dashboards_api.models.box_and_whiskers_datasource import BoxAndWhiskersDatasource +from dashboards_api.models.color_grid_datasource import ColorGridDatasource +from dashboards_api.models.dashboard_links import DashboardLinks +from dashboards_api.models.dashboard_links_links import DashboardLinksLinks +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.dashboard_order import DashboardOrder +from dashboards_api.models.dashboard_snapshot_links import DashboardSnapshotLinks +from dashboards_api.models.dashboard_snapshot_links_links import DashboardSnapshotLinksLinks +from dashboards_api.models.dashboard_snapshots200_response import DashboardSnapshots200Response +from dashboards_api.models.dashboard_snapshots_page import DashboardSnapshotsPage +from dashboards_api.models.duration_unit import DurationUnit +from dashboards_api.models.enterprise_agent_state import EnterpriseAgentState +from dashboards_api.models.error import Error +from dashboards_api.models.generate_dashboard_snapshot_request import GenerateDashboardSnapshotRequest +from dashboards_api.models.geo_map_datasource import GeoMapDatasource +from dashboards_api.models.get_dashboard_data200_response import GetDashboardData200Response +from dashboards_api.models.grouped_bar_chart_datasource import GroupedBarChartDatasource +from dashboards_api.models.link import Link +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.multi_metrics_table_datasource import MultiMetricsTableDatasource +from dashboards_api.models.numbers_card_datasource import NumbersCardDatasource +from dashboards_api.models.pagination_links import PaginationLinks +from dashboards_api.models.pagination_links_links import PaginationLinksLinks +from dashboards_api.models.pie_chart_datasource import PieChartDatasource +from dashboards_api.models.query_window import QueryWindow +from dashboards_api.models.scalable_widget import ScalableWidget +from dashboards_api.models.self_links import SelfLinks +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.snapshot_data_by_widget200_response import SnapshotDataByWidget200Response +from dashboards_api.models.stacked_area_chart_datasource import StackedAreaChartDatasource +from dashboards_api.models.stacked_bar_chart_datasource import StackedBarChartDatasource +from dashboards_api.models.table_datasource import TableDatasource +from dashboards_api.models.test_table_datasource import TestTableDatasource +from dashboards_api.models.test_table_filter_key import TestTableFilterKey +from dashboards_api.models.test_table_filter_type import TestTableFilterType +from dashboards_api.models.timeseries_datasource import TimeseriesDatasource +from dashboards_api.models.unauthorized_error import UnauthorizedError +from dashboards_api.models.update_snapshot_expiration_date_api_request import UpdateSnapshotExpirationDateApiRequest +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget import Widget +from dashboards_api.models.widget_measure_type import WidgetMeasureType +from dashboards_api.models.widget_sort_direction import WidgetSortDirection +from dashboards_api.models.widget_sort_property import WidgetSortProperty +from dashboards_api.models.widget_type import WidgetType diff --git a/dashboards_api/dashboards_api/api/__init__.py b/dashboards_api/dashboards_api/api/__init__.py new file mode 100644 index 00000000..a1304364 --- /dev/null +++ b/dashboards_api/dashboards_api/api/__init__.py @@ -0,0 +1,6 @@ +# flake8: noqa + +# import apis into api package +from dashboards_api.api.dashboard_snapshots_api import DashboardSnapshotsApi +from dashboards_api.api.dashboards_api import DashboardsApi + diff --git a/dashboards_api/dashboards_api/api/dashboard_snapshots_api.py b/dashboards_api/dashboards_api/api/dashboard_snapshots_api.py new file mode 100644 index 00000000..53f90c1e --- /dev/null +++ b/dashboards_api/dashboards_api/api/dashboard_snapshots_api.py @@ -0,0 +1,1874 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.api_dashboard_snapshot import ApiDashboardSnapshot +from dashboards_api.models.dashboard_snapshots200_response import DashboardSnapshots200Response +from dashboards_api.models.generate_dashboard_snapshot_request import GenerateDashboardSnapshotRequest +from dashboards_api.models.snapshot_data_by_widget200_response import SnapshotDataByWidget200Response +from dashboards_api.models.update_snapshot_expiration_date_api_request import UpdateSnapshotExpirationDateApiRequest + +from dashboards_api.api_client import ApiClient +from dashboards_api.api_response import ApiResponse +from dashboards_api.rest import RESTResponseType + + +class DashboardSnapshotsApi: + """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 create_dashboard_snapshot( + self, + generate_dashboard_snapshot_request: Annotated[GenerateDashboardSnapshotRequest, Field(description="Request body schema to create a dashboard snapshot.")], + 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, + ) -> ApiDashboardSnapshot: + """Create dashboard snapshot + + Creates a new dashboard snapshot within your account group. The `Edit Snapshots` permission is required to use this endpoint. + + :param generate_dashboard_snapshot_request: Request body schema to create a dashboard snapshot. (required) + :type generate_dashboard_snapshot_request: GenerateDashboardSnapshotRequest + :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._create_dashboard_snapshot_serialize( + generate_dashboard_snapshot_request=generate_dashboard_snapshot_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiDashboardSnapshot", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_dashboard_snapshot_with_http_info( + self, + generate_dashboard_snapshot_request: Annotated[GenerateDashboardSnapshotRequest, Field(description="Request body schema to create a dashboard snapshot.")], + 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[ApiDashboardSnapshot]: + """Create dashboard snapshot + + Creates a new dashboard snapshot within your account group. The `Edit Snapshots` permission is required to use this endpoint. + + :param generate_dashboard_snapshot_request: Request body schema to create a dashboard snapshot. (required) + :type generate_dashboard_snapshot_request: GenerateDashboardSnapshotRequest + :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._create_dashboard_snapshot_serialize( + generate_dashboard_snapshot_request=generate_dashboard_snapshot_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiDashboardSnapshot", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_dashboard_snapshot_without_preload_content( + self, + generate_dashboard_snapshot_request: Annotated[GenerateDashboardSnapshotRequest, Field(description="Request body schema to create a dashboard snapshot.")], + 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: + """Create dashboard snapshot + + Creates a new dashboard snapshot within your account group. The `Edit Snapshots` permission is required to use this endpoint. + + :param generate_dashboard_snapshot_request: Request body schema to create a dashboard snapshot. (required) + :type generate_dashboard_snapshot_request: GenerateDashboardSnapshotRequest + :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._create_dashboard_snapshot_serialize( + generate_dashboard_snapshot_request=generate_dashboard_snapshot_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiDashboardSnapshot", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_dashboard_snapshot_serialize( + self, + generate_dashboard_snapshot_request, + 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 + if generate_dashboard_snapshot_request is not None: + _body_params = generate_dashboard_snapshot_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/hal+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/dashboard-snapshots', + 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 dashboard_snapshot_by_id( + self, + snapshot_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint.")], + 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, + ) -> ApiDashboardSnapshot: + """Retrieve dashboard snapshot + + This endpoint returns a list of widgets configured in dashboard snapshot configured in ThousandEyes. Seed this endpoint with a snapshotId found from the /dashboard-snapshots endpoint. This endpoint requires the `View Snapshots` permission be assigned to the role of the user accessing this endpoint. Returns a list of widgets configured within a dashboard snapshot. Use the `snapshotId` obtained from the `/dashboard-snapshots` endpoint. The `View Snapshots` permission is required to use this endpoint.\" + + :param snapshot_id: A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. (required) + :type snapshot_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._dashboard_snapshot_by_id_serialize( + snapshot_id=snapshot_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': "ApiDashboardSnapshot", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 dashboard_snapshot_by_id_with_http_info( + self, + snapshot_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint.")], + 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[ApiDashboardSnapshot]: + """Retrieve dashboard snapshot + + This endpoint returns a list of widgets configured in dashboard snapshot configured in ThousandEyes. Seed this endpoint with a snapshotId found from the /dashboard-snapshots endpoint. This endpoint requires the `View Snapshots` permission be assigned to the role of the user accessing this endpoint. Returns a list of widgets configured within a dashboard snapshot. Use the `snapshotId` obtained from the `/dashboard-snapshots` endpoint. The `View Snapshots` permission is required to use this endpoint.\" + + :param snapshot_id: A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. (required) + :type snapshot_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._dashboard_snapshot_by_id_serialize( + snapshot_id=snapshot_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': "ApiDashboardSnapshot", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 dashboard_snapshot_by_id_without_preload_content( + self, + snapshot_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint.")], + 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 dashboard snapshot + + This endpoint returns a list of widgets configured in dashboard snapshot configured in ThousandEyes. Seed this endpoint with a snapshotId found from the /dashboard-snapshots endpoint. This endpoint requires the `View Snapshots` permission be assigned to the role of the user accessing this endpoint. Returns a list of widgets configured within a dashboard snapshot. Use the `snapshotId` obtained from the `/dashboard-snapshots` endpoint. The `View Snapshots` permission is required to use this endpoint.\" + + :param snapshot_id: A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. (required) + :type snapshot_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._dashboard_snapshot_by_id_serialize( + snapshot_id=snapshot_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': "ApiDashboardSnapshot", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _dashboard_snapshot_by_id_serialize( + self, + snapshot_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 snapshot_id is not None: + _path_params['snapshotId'] = snapshot_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/dashboard-snapshots/{snapshotId}', + 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 dashboard_snapshots( + 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, + dashboard_id: Optional[StrictStr] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DashboardSnapshots200Response: + """List dashboard snapshots + + Returns a list of dashboard snapshots within your account group. Use this data to identify a specific dashboard snapshot, which can be used in other endpoints to access aggregated data. The `View Snapshots` permission is required to use this endpoint.\" + + :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 dashboard_id: + :type dashboard_id: str + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._dashboard_snapshots_serialize( + aid=aid, + dashboard_id=dashboard_id, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DashboardSnapshots200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 dashboard_snapshots_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, + dashboard_id: Optional[StrictStr] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DashboardSnapshots200Response]: + """List dashboard snapshots + + Returns a list of dashboard snapshots within your account group. Use this data to identify a specific dashboard snapshot, which can be used in other endpoints to access aggregated data. The `View Snapshots` permission is required to use this endpoint.\" + + :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 dashboard_id: + :type dashboard_id: str + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._dashboard_snapshots_serialize( + aid=aid, + dashboard_id=dashboard_id, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DashboardSnapshots200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 dashboard_snapshots_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, + dashboard_id: Optional[StrictStr] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List dashboard snapshots + + Returns a list of dashboard snapshots within your account group. Use this data to identify a specific dashboard snapshot, which can be used in other endpoints to access aggregated data. The `View Snapshots` permission is required to use this endpoint.\" + + :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 dashboard_id: + :type dashboard_id: str + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._dashboard_snapshots_serialize( + aid=aid, + dashboard_id=dashboard_id, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DashboardSnapshots200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _dashboard_snapshots_serialize( + self, + aid, + dashboard_id, + cursor, + _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)) + + if dashboard_id is not None: + + _query_params.append(('dashboardId', dashboard_id)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/dashboard-snapshots', + 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 delete_dashboard_snapshot( + self, + snapshot_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint.")], + 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, + ) -> None: + """Delete dashboard snapshot + + Deletes a dashboard snapshot using the `snapshotId` provided in the request. Users with the `Edit reports for all users in account group` permission (Account Admin) can delete any dashboard snapshot. + + :param snapshot_id: A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. (required) + :type snapshot_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._delete_dashboard_snapshot_serialize( + snapshot_id=snapshot_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_dashboard_snapshot_with_http_info( + self, + snapshot_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint.")], + 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[None]: + """Delete dashboard snapshot + + Deletes a dashboard snapshot using the `snapshotId` provided in the request. Users with the `Edit reports for all users in account group` permission (Account Admin) can delete any dashboard snapshot. + + :param snapshot_id: A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. (required) + :type snapshot_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._delete_dashboard_snapshot_serialize( + snapshot_id=snapshot_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_dashboard_snapshot_without_preload_content( + self, + snapshot_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint.")], + 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: + """Delete dashboard snapshot + + Deletes a dashboard snapshot using the `snapshotId` provided in the request. Users with the `Edit reports for all users in account group` permission (Account Admin) can delete any dashboard snapshot. + + :param snapshot_id: A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. (required) + :type snapshot_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._delete_dashboard_snapshot_serialize( + snapshot_id=snapshot_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_dashboard_snapshot_serialize( + self, + snapshot_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 snapshot_id is not None: + _path_params['snapshotId'] = snapshot_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/dashboard-snapshots/{snapshotId}', + 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 snapshot_data_by_widget( + self, + snapshot_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint.")], + widget_id: Annotated[StrictStr, Field(description="A Identifier for a widget.")], + 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, + ) -> SnapshotDataByWidget200Response: + """Retrieve dashboard snapshot data + + Returns actual metrics used in the generation of a dashboard snapshot. + + :param snapshot_id: A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. (required) + :type snapshot_id: str + :param widget_id: A Identifier for a widget. (required) + :type widget_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._snapshot_data_by_widget_serialize( + snapshot_id=snapshot_id, + widget_id=widget_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': "SnapshotDataByWidget200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 snapshot_data_by_widget_with_http_info( + self, + snapshot_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint.")], + widget_id: Annotated[StrictStr, Field(description="A Identifier for a widget.")], + 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[SnapshotDataByWidget200Response]: + """Retrieve dashboard snapshot data + + Returns actual metrics used in the generation of a dashboard snapshot. + + :param snapshot_id: A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. (required) + :type snapshot_id: str + :param widget_id: A Identifier for a widget. (required) + :type widget_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._snapshot_data_by_widget_serialize( + snapshot_id=snapshot_id, + widget_id=widget_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': "SnapshotDataByWidget200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 snapshot_data_by_widget_without_preload_content( + self, + snapshot_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint.")], + widget_id: Annotated[StrictStr, Field(description="A Identifier for a widget.")], + 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 dashboard snapshot data + + Returns actual metrics used in the generation of a dashboard snapshot. + + :param snapshot_id: A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. (required) + :type snapshot_id: str + :param widget_id: A Identifier for a widget. (required) + :type widget_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._snapshot_data_by_widget_serialize( + snapshot_id=snapshot_id, + widget_id=widget_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': "SnapshotDataByWidget200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _snapshot_data_by_widget_serialize( + self, + snapshot_id, + widget_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 snapshot_id is not None: + _path_params['snapshotId'] = snapshot_id + if widget_id is not None: + _path_params['widgetId'] = widget_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/dashboard-snapshots/{snapshotId}/widgets/{widgetId}', + 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 update_snapshot_expiration_date( + self, + snapshot_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint.")], + update_snapshot_expiration_date_api_request: Annotated[UpdateSnapshotExpirationDateApiRequest, Field(description="Request body schema to update a snapshot expiration.")], + 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, + ) -> None: + """Update snapshot expiration + + Updates the expiration date of a dashboard snapshot. The `Edit snapshots` permission is required to access this endpoint. + + :param snapshot_id: A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. (required) + :type snapshot_id: str + :param update_snapshot_expiration_date_api_request: Request body schema to update a snapshot expiration. (required) + :type update_snapshot_expiration_date_api_request: UpdateSnapshotExpirationDateApiRequest + :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._update_snapshot_expiration_date_serialize( + snapshot_id=snapshot_id, + update_snapshot_expiration_date_api_request=update_snapshot_expiration_date_api_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 update_snapshot_expiration_date_with_http_info( + self, + snapshot_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint.")], + update_snapshot_expiration_date_api_request: Annotated[UpdateSnapshotExpirationDateApiRequest, Field(description="Request body schema to update a snapshot expiration.")], + 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[None]: + """Update snapshot expiration + + Updates the expiration date of a dashboard snapshot. The `Edit snapshots` permission is required to access this endpoint. + + :param snapshot_id: A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. (required) + :type snapshot_id: str + :param update_snapshot_expiration_date_api_request: Request body schema to update a snapshot expiration. (required) + :type update_snapshot_expiration_date_api_request: UpdateSnapshotExpirationDateApiRequest + :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._update_snapshot_expiration_date_serialize( + snapshot_id=snapshot_id, + update_snapshot_expiration_date_api_request=update_snapshot_expiration_date_api_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 update_snapshot_expiration_date_without_preload_content( + self, + snapshot_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint.")], + update_snapshot_expiration_date_api_request: Annotated[UpdateSnapshotExpirationDateApiRequest, Field(description="Request body schema to update a snapshot expiration.")], + 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: + """Update snapshot expiration + + Updates the expiration date of a dashboard snapshot. The `Edit snapshots` permission is required to access this endpoint. + + :param snapshot_id: A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. (required) + :type snapshot_id: str + :param update_snapshot_expiration_date_api_request: Request body schema to update a snapshot expiration. (required) + :type update_snapshot_expiration_date_api_request: UpdateSnapshotExpirationDateApiRequest + :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._update_snapshot_expiration_date_serialize( + snapshot_id=snapshot_id, + update_snapshot_expiration_date_api_request=update_snapshot_expiration_date_api_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_snapshot_expiration_date_serialize( + self, + snapshot_id, + update_snapshot_expiration_date_api_request, + 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 snapshot_id is not None: + _path_params['snapshotId'] = snapshot_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 + if update_snapshot_expiration_date_api_request is not None: + _body_params = update_snapshot_expiration_date_api_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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/hal+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='PATCH', + resource_path='/v7/dashboard-snapshots/{snapshotId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/dashboards_api/dashboards_api/api/dashboards_api.py b/dashboards_api/dashboards_api/api/dashboards_api.py new file mode 100644 index 00000000..8de6a087 --- /dev/null +++ b/dashboards_api/dashboards_api/api/dashboards_api.py @@ -0,0 +1,1998 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 datetime import datetime + +from pydantic import StrictFloat, StrictInt, StrictStr, field_validator + +from typing import List, Optional, Union + +from dashboards_api.models.api_dashboard import ApiDashboard +from dashboards_api.models.dashboard_order import DashboardOrder +from dashboards_api.models.get_dashboard_data200_response import GetDashboardData200Response + +from dashboards_api.api_client import ApiClient +from dashboards_api.api_response import ApiResponse +from dashboards_api.rest import RESTResponseType + + +class DashboardsApi: + """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 create_dashboard( + self, + api_dashboard: Annotated[ApiDashboard, Field(description="Request body schema to create a dashboard.")], + 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, + ) -> ApiDashboard: + """Create dashboard + + Creates a new dashboard in your account group. To create a dashboard, you must have one of the following permissions: * `Edit dashboard templates for all users in account group` permission (Account Admin). * `Edit own dashboard templates` premission (Regular User). + + :param api_dashboard: Request body schema to create a dashboard. (required) + :type api_dashboard: ApiDashboard + :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._create_dashboard_serialize( + api_dashboard=api_dashboard, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiDashboard", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_dashboard_with_http_info( + self, + api_dashboard: Annotated[ApiDashboard, Field(description="Request body schema to create a dashboard.")], + 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[ApiDashboard]: + """Create dashboard + + Creates a new dashboard in your account group. To create a dashboard, you must have one of the following permissions: * `Edit dashboard templates for all users in account group` permission (Account Admin). * `Edit own dashboard templates` premission (Regular User). + + :param api_dashboard: Request body schema to create a dashboard. (required) + :type api_dashboard: ApiDashboard + :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._create_dashboard_serialize( + api_dashboard=api_dashboard, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiDashboard", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_dashboard_without_preload_content( + self, + api_dashboard: Annotated[ApiDashboard, Field(description="Request body schema to create a dashboard.")], + 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: + """Create dashboard + + Creates a new dashboard in your account group. To create a dashboard, you must have one of the following permissions: * `Edit dashboard templates for all users in account group` permission (Account Admin). * `Edit own dashboard templates` premission (Regular User). + + :param api_dashboard: Request body schema to create a dashboard. (required) + :type api_dashboard: ApiDashboard + :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._create_dashboard_serialize( + api_dashboard=api_dashboard, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiDashboard", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_dashboard_serialize( + self, + api_dashboard, + 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 + if api_dashboard is not None: + _body_params = api_dashboard + + + # 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/hal+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/dashboards', + 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 delete_dashboard( + self, + dashboard_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint.")], + 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, + ) -> None: + """Delete dashboard + + Deletes a dashboard using the `dashboardId` provided in the request. **Note**: * Users with the `Edit dashboard templates for all users in account group` permission (Account Admin) can delete any dashboard. * Users with the `Edit own dashboard templates` permission (Regular User) can only delete the dashboards they have created themselves. + + :param dashboard_id: A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. (required) + :type dashboard_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._delete_dashboard_serialize( + dashboard_id=dashboard_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_dashboard_with_http_info( + self, + dashboard_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint.")], + 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[None]: + """Delete dashboard + + Deletes a dashboard using the `dashboardId` provided in the request. **Note**: * Users with the `Edit dashboard templates for all users in account group` permission (Account Admin) can delete any dashboard. * Users with the `Edit own dashboard templates` permission (Regular User) can only delete the dashboards they have created themselves. + + :param dashboard_id: A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. (required) + :type dashboard_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._delete_dashboard_serialize( + dashboard_id=dashboard_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_dashboard_without_preload_content( + self, + dashboard_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint.")], + 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: + """Delete dashboard + + Deletes a dashboard using the `dashboardId` provided in the request. **Note**: * Users with the `Edit dashboard templates for all users in account group` permission (Account Admin) can delete any dashboard. * Users with the `Edit own dashboard templates` permission (Regular User) can only delete the dashboards they have created themselves. + + :param dashboard_id: A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. (required) + :type dashboard_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._delete_dashboard_serialize( + dashboard_id=dashboard_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_dashboard_serialize( + self, + dashboard_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 dashboard_id is not None: + _path_params['dashboardId'] = dashboard_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/dashboards/{dashboardId}', + 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_dashboard_by_id( + self, + dashboard_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint.")], + 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, + ) -> ApiDashboard: + """Retrieve dashboard + + Returns a list of widgets within a dashboard, along with the dashboard's metadata. + + :param dashboard_id: A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. (required) + :type dashboard_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_dashboard_by_id_serialize( + dashboard_id=dashboard_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': "ApiDashboard", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_dashboard_by_id_with_http_info( + self, + dashboard_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint.")], + 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[ApiDashboard]: + """Retrieve dashboard + + Returns a list of widgets within a dashboard, along with the dashboard's metadata. + + :param dashboard_id: A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. (required) + :type dashboard_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_dashboard_by_id_serialize( + dashboard_id=dashboard_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': "ApiDashboard", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_dashboard_by_id_without_preload_content( + self, + dashboard_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint.")], + 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 dashboard + + Returns a list of widgets within a dashboard, along with the dashboard's metadata. + + :param dashboard_id: A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. (required) + :type dashboard_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_dashboard_by_id_serialize( + dashboard_id=dashboard_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': "ApiDashboard", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_dashboard_by_id_serialize( + self, + dashboard_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 dashboard_id is not None: + _path_params['dashboardId'] = dashboard_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/dashboards/{dashboardId}', + 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_dashboard_data( + self, + dashboard_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint.")], + widget_id: Annotated[StrictStr, Field(description="A Identifier for a widget.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Optionally specify the maximum number of objects to retrieve. This only applies to the **Alert List** and **Test Table** Widgets. * The default for the **Alert List** widget is set by its limitBy configuration. * The default value for the **Test Table** widget is 10.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="An optional pagination cursor. This parameter should not not be used directly. Instead, use the `_links` returned by the API. This feature is only available in the **Test Table** widget.")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Optional sorting parameter with attributes listed comma-separated. This only applies to the **Alert List** and **Test Table** Widgets. * For the **Alert List** widget, you can sort by `alertStatus` or `startTime`. The default is `alertStatus`. * For the **Test Table** widget, you can sort by `alertStatus`, `testName`, or `testType`. The sequence might vary from the web application. The default sort attribute is `alertStatus`.")] = None, + order: Annotated[Optional[DashboardOrder], Field(description="Optional sorting order parameter that accepts either `asc` (ascending) or `desc` (descending) values. This only applies to the **Alert List** and **Test Table** Widgets.")] = 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, + ) -> GetDashboardData200Response: + """Retrieve dashboard widget data + + Returns the raw data displayed within a widget in the dashboard. + + :param dashboard_id: A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. (required) + :type dashboard_id: str + :param widget_id: A Identifier for a widget. (required) + :type widget_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: Optionally specify the maximum number of objects to retrieve. This only applies to the **Alert List** and **Test Table** Widgets. * The default for the **Alert List** widget is set by its limitBy configuration. * The default value for the **Test Table** widget is 10. + :type max: float + :param cursor: An optional pagination cursor. This parameter should not not be used directly. Instead, use the `_links` returned by the API. This feature is only available in the **Test Table** widget. + :type cursor: str + :param sort: Optional sorting parameter with attributes listed comma-separated. This only applies to the **Alert List** and **Test Table** Widgets. * For the **Alert List** widget, you can sort by `alertStatus` or `startTime`. The default is `alertStatus`. * For the **Test Table** widget, you can sort by `alertStatus`, `testName`, or `testType`. The sequence might vary from the web application. The default sort attribute is `alertStatus`. + :type sort: str + :param order: Optional sorting order parameter that accepts either `asc` (ascending) or `desc` (descending) values. This only applies to the **Alert List** and **Test Table** Widgets. + :type order: DashboardOrder + :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_dashboard_data_serialize( + dashboard_id=dashboard_id, + widget_id=widget_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + cursor=cursor, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetDashboardData200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_dashboard_data_with_http_info( + self, + dashboard_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint.")], + widget_id: Annotated[StrictStr, Field(description="A Identifier for a widget.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Optionally specify the maximum number of objects to retrieve. This only applies to the **Alert List** and **Test Table** Widgets. * The default for the **Alert List** widget is set by its limitBy configuration. * The default value for the **Test Table** widget is 10.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="An optional pagination cursor. This parameter should not not be used directly. Instead, use the `_links` returned by the API. This feature is only available in the **Test Table** widget.")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Optional sorting parameter with attributes listed comma-separated. This only applies to the **Alert List** and **Test Table** Widgets. * For the **Alert List** widget, you can sort by `alertStatus` or `startTime`. The default is `alertStatus`. * For the **Test Table** widget, you can sort by `alertStatus`, `testName`, or `testType`. The sequence might vary from the web application. The default sort attribute is `alertStatus`.")] = None, + order: Annotated[Optional[DashboardOrder], Field(description="Optional sorting order parameter that accepts either `asc` (ascending) or `desc` (descending) values. This only applies to the **Alert List** and **Test Table** Widgets.")] = 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[GetDashboardData200Response]: + """Retrieve dashboard widget data + + Returns the raw data displayed within a widget in the dashboard. + + :param dashboard_id: A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. (required) + :type dashboard_id: str + :param widget_id: A Identifier for a widget. (required) + :type widget_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: Optionally specify the maximum number of objects to retrieve. This only applies to the **Alert List** and **Test Table** Widgets. * The default for the **Alert List** widget is set by its limitBy configuration. * The default value for the **Test Table** widget is 10. + :type max: float + :param cursor: An optional pagination cursor. This parameter should not not be used directly. Instead, use the `_links` returned by the API. This feature is only available in the **Test Table** widget. + :type cursor: str + :param sort: Optional sorting parameter with attributes listed comma-separated. This only applies to the **Alert List** and **Test Table** Widgets. * For the **Alert List** widget, you can sort by `alertStatus` or `startTime`. The default is `alertStatus`. * For the **Test Table** widget, you can sort by `alertStatus`, `testName`, or `testType`. The sequence might vary from the web application. The default sort attribute is `alertStatus`. + :type sort: str + :param order: Optional sorting order parameter that accepts either `asc` (ascending) or `desc` (descending) values. This only applies to the **Alert List** and **Test Table** Widgets. + :type order: DashboardOrder + :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_dashboard_data_serialize( + dashboard_id=dashboard_id, + widget_id=widget_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + cursor=cursor, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetDashboardData200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_dashboard_data_without_preload_content( + self, + dashboard_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint.")], + widget_id: Annotated[StrictStr, Field(description="A Identifier for a widget.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Optionally specify the maximum number of objects to retrieve. This only applies to the **Alert List** and **Test Table** Widgets. * The default for the **Alert List** widget is set by its limitBy configuration. * The default value for the **Test Table** widget is 10.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="An optional pagination cursor. This parameter should not not be used directly. Instead, use the `_links` returned by the API. This feature is only available in the **Test Table** widget.")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Optional sorting parameter with attributes listed comma-separated. This only applies to the **Alert List** and **Test Table** Widgets. * For the **Alert List** widget, you can sort by `alertStatus` or `startTime`. The default is `alertStatus`. * For the **Test Table** widget, you can sort by `alertStatus`, `testName`, or `testType`. The sequence might vary from the web application. The default sort attribute is `alertStatus`.")] = None, + order: Annotated[Optional[DashboardOrder], Field(description="Optional sorting order parameter that accepts either `asc` (ascending) or `desc` (descending) values. This only applies to the **Alert List** and **Test Table** Widgets.")] = 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 dashboard widget data + + Returns the raw data displayed within a widget in the dashboard. + + :param dashboard_id: A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. (required) + :type dashboard_id: str + :param widget_id: A Identifier for a widget. (required) + :type widget_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: Optionally specify the maximum number of objects to retrieve. This only applies to the **Alert List** and **Test Table** Widgets. * The default for the **Alert List** widget is set by its limitBy configuration. * The default value for the **Test Table** widget is 10. + :type max: float + :param cursor: An optional pagination cursor. This parameter should not not be used directly. Instead, use the `_links` returned by the API. This feature is only available in the **Test Table** widget. + :type cursor: str + :param sort: Optional sorting parameter with attributes listed comma-separated. This only applies to the **Alert List** and **Test Table** Widgets. * For the **Alert List** widget, you can sort by `alertStatus` or `startTime`. The default is `alertStatus`. * For the **Test Table** widget, you can sort by `alertStatus`, `testName`, or `testType`. The sequence might vary from the web application. The default sort attribute is `alertStatus`. + :type sort: str + :param order: Optional sorting order parameter that accepts either `asc` (ascending) or `desc` (descending) values. This only applies to the **Alert List** and **Test Table** Widgets. + :type order: DashboardOrder + :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_dashboard_data_serialize( + dashboard_id=dashboard_id, + widget_id=widget_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + cursor=cursor, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetDashboardData200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_dashboard_data_serialize( + self, + dashboard_id, + widget_id, + aid, + window, + start_date, + end_date, + max, + cursor, + sort, + order, + _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 dashboard_id is not None: + _path_params['dashboardId'] = dashboard_id + if widget_id is not None: + _path_params['widgetId'] = widget_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if max is not None: + + _query_params.append(('max', max)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order.value)) + + # 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/dashboards/{dashboardId}/widgets/{widgetId}', + 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_dashboards_for_user( + 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, + ) -> List[ApiDashboard]: + """List dashboards + + Returns a list of dashboards and their settings within your 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_dashboards_for_user_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': "List[ApiDashboard]", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_dashboards_for_user_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[List[ApiDashboard]]: + """List dashboards + + Returns a list of dashboards and their settings within your 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_dashboards_for_user_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': "List[ApiDashboard]", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_dashboards_for_user_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 dashboards + + Returns a list of dashboards and their settings within your 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_dashboards_for_user_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': "List[ApiDashboard]", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_dashboards_for_user_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/dashboards', + 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 update_dashboard( + self, + dashboard_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint.")], + api_dashboard: Annotated[ApiDashboard, Field(description="Request body schema to update a dashboard.")], + 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, + ) -> ApiDashboard: + """Update dashboard + + Updates an existing dashboard in your account group. **Note**: * Users with the `Edit dashboard templates for all users in account group` permission (Account Admin) can update any dashboard. * Users with the `Edit own dashboard templates` permission (Regular User) can only update the dashboards they have created themselves. + + :param dashboard_id: A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. (required) + :type dashboard_id: str + :param api_dashboard: Request body schema to update a dashboard. (required) + :type api_dashboard: ApiDashboard + :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._update_dashboard_serialize( + dashboard_id=dashboard_id, + api_dashboard=api_dashboard, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiDashboard", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_dashboard_with_http_info( + self, + dashboard_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint.")], + api_dashboard: Annotated[ApiDashboard, Field(description="Request body schema to update a dashboard.")], + 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[ApiDashboard]: + """Update dashboard + + Updates an existing dashboard in your account group. **Note**: * Users with the `Edit dashboard templates for all users in account group` permission (Account Admin) can update any dashboard. * Users with the `Edit own dashboard templates` permission (Regular User) can only update the dashboards they have created themselves. + + :param dashboard_id: A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. (required) + :type dashboard_id: str + :param api_dashboard: Request body schema to update a dashboard. (required) + :type api_dashboard: ApiDashboard + :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._update_dashboard_serialize( + dashboard_id=dashboard_id, + api_dashboard=api_dashboard, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiDashboard", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_dashboard_without_preload_content( + self, + dashboard_id: Annotated[StrictStr, Field(description="A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint.")], + api_dashboard: Annotated[ApiDashboard, Field(description="Request body schema to update a dashboard.")], + 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: + """Update dashboard + + Updates an existing dashboard in your account group. **Note**: * Users with the `Edit dashboard templates for all users in account group` permission (Account Admin) can update any dashboard. * Users with the `Edit own dashboard templates` permission (Regular User) can only update the dashboards they have created themselves. + + :param dashboard_id: A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. (required) + :type dashboard_id: str + :param api_dashboard: Request body schema to update a dashboard. (required) + :type api_dashboard: ApiDashboard + :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._update_dashboard_serialize( + dashboard_id=dashboard_id, + api_dashboard=api_dashboard, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiDashboard", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_dashboard_serialize( + self, + dashboard_id, + api_dashboard, + 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 dashboard_id is not None: + _path_params['dashboardId'] = dashboard_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 + if api_dashboard is not None: + _body_params = api_dashboard + + + # 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/hal+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='PUT', + resource_path='/v7/dashboards/{dashboardId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/dashboards_api/dashboards_api/api_client.py b/dashboards_api/dashboards_api/api_client.py new file mode 100644 index 00000000..5651b7d3 --- /dev/null +++ b/dashboards_api/dashboards_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.configuration import Configuration +from dashboards_api.api_response import ApiResponse +import dashboards_api.models +from dashboards_api import rest +from dashboards_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(dashboards_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) diff --git a/dashboards_api/dashboards_api/api_response.py b/dashboards_api/dashboards_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/dashboards_api/dashboards_api/api_response.py @@ -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 + } diff --git a/dashboards_api/dashboards_api/configuration.py b/dashboards_api/dashboards_api/configuration.py new file mode 100644 index 00000000..db3f594a --- /dev/null +++ b/dashboards_api/dashboards_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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("dashboards_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 diff --git a/dashboards_api/dashboards_api/exceptions.py b/dashboards_api/dashboards_api/exceptions.py new file mode 100644 index 00000000..35a18e29 --- /dev/null +++ b/dashboards_api/dashboards_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 diff --git a/dashboards_api/dashboards_api/models/__init__.py b/dashboards_api/dashboards_api/models/__init__.py new file mode 100644 index 00000000..acca9f38 --- /dev/null +++ b/dashboards_api/dashboards_api/models/__init__.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +# flake8: noqa +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.agent_status_datasource import AgentStatusDatasource +from dashboards_api.models.agent_widget_show import AgentWidgetShow +from dashboards_api.models.agent_widget_type import AgentWidgetType +from dashboards_api.models.alert_list_datasource import AlertListDatasource +from dashboards_api.models.api_agent_location import ApiAgentLocation +from dashboards_api.models.api_agent_status_agent import ApiAgentStatusAgent +from dashboards_api.models.api_agent_status_ip_info import ApiAgentStatusIpInfo +from dashboards_api.models.api_agent_status_summary import ApiAgentStatusSummary +from dashboards_api.models.api_agent_status_widget import ApiAgentStatusWidget +from dashboards_api.models.api_aggregate_property import ApiAggregateProperty +from dashboards_api.models.api_alert_list_alert import ApiAlertListAlert +from dashboards_api.models.api_alert_list_alert_type import ApiAlertListAlertType +from dashboards_api.models.api_alert_list_widget import ApiAlertListWidget +from dashboards_api.models.api_alert_list_widget_all_of_active_within import ApiAlertListWidgetAllOfActiveWithin +from dashboards_api.models.api_box_and_whiskers_widget import ApiBoxAndWhiskersWidget +from dashboards_api.models.api_color_grid_widget import ApiColorGridWidget +from dashboards_api.models.api_dashboard import ApiDashboard +from dashboards_api.models.api_dashboard_asw import ApiDashboardAsw +from dashboards_api.models.api_dashboard_snapshot import ApiDashboardSnapshot +from dashboards_api.models.api_dashboard_snapshot_all_of_dashboard import ApiDashboardSnapshotAllOfDashboard +from dashboards_api.models.api_data_point_group import ApiDataPointGroup +from dashboards_api.models.api_default_timespan import ApiDefaultTimespan +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_geo_map_widget import ApiGeoMapWidget +from dashboards_api.models.api_graphlet_point import ApiGraphletPoint +from dashboards_api.models.api_grouped_barchart_widget import ApiGroupedBarchartWidget +from dashboards_api.models.api_multi_metric_column import ApiMultiMetricColumn +from dashboards_api.models.api_multi_metric_column_data import ApiMultiMetricColumnData +from dashboards_api.models.api_multi_metric_table_widget import ApiMultiMetricTableWidget +from dashboards_api.models.api_multi_search_filter_api_test_table_filter_key import ApiMultiSearchFilterApiTestTableFilterKey +from dashboards_api.models.api_numbers_card import ApiNumbersCard +from dashboards_api.models.api_numbers_card_all_of_fixed_timespan import ApiNumbersCardAllOfFixedTimespan +from dashboards_api.models.api_numbers_card_data import ApiNumbersCardData +from dashboards_api.models.api_numbers_card_widget import ApiNumbersCardWidget +from dashboards_api.models.api_pie_chart_widget import ApiPieChartWidget +from dashboards_api.models.api_report_data_component_label_map import ApiReportDataComponentLabelMap +from dashboards_api.models.api_report_data_component_label_map_entry import ApiReportDataComponentLabelMapEntry +from dashboards_api.models.api_report_snapshot_time_span import ApiReportSnapshotTimeSpan +from dashboards_api.models.api_stacked_area_chart_widget import ApiStackedAreaChartWidget +from dashboards_api.models.api_stacked_barchart_widget import ApiStackedBarchartWidget +from dashboards_api.models.api_table_widget import ApiTableWidget +from dashboards_api.models.api_test_table_data import ApiTestTableData +from dashboards_api.models.api_test_table_graphlets_data import ApiTestTableGraphletsData +from dashboards_api.models.api_test_table_widget import ApiTestTableWidget +from dashboards_api.models.api_timeseries_widget import ApiTimeseriesWidget +from dashboards_api.models.api_widget import ApiWidget +from dashboards_api.models.api_widget_data_point import ApiWidgetDataPoint +from dashboards_api.models.api_widget_data_response import ApiWidgetDataResponse +from dashboards_api.models.api_widget_filter_api_test_table_filter_key import ApiWidgetFilterApiTestTableFilterKey +from dashboards_api.models.api_widget_fixed_y_scale_prefix import ApiWidgetFixedYScalePrefix +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.api_widgets_data_v2 import ApiWidgetsDataV2 +from dashboards_api.models.asw_repeat import AswRepeat +from dashboards_api.models.asw_repeat_unit import AswRepeatUnit +from dashboards_api.models.box_and_whiskers_datasource import BoxAndWhiskersDatasource +from dashboards_api.models.color_grid_datasource import ColorGridDatasource +from dashboards_api.models.dashboard_links import DashboardLinks +from dashboards_api.models.dashboard_links_links import DashboardLinksLinks +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.dashboard_order import DashboardOrder +from dashboards_api.models.dashboard_snapshot_links import DashboardSnapshotLinks +from dashboards_api.models.dashboard_snapshot_links_links import DashboardSnapshotLinksLinks +from dashboards_api.models.dashboard_snapshots200_response import DashboardSnapshots200Response +from dashboards_api.models.dashboard_snapshots_page import DashboardSnapshotsPage +from dashboards_api.models.duration_unit import DurationUnit +from dashboards_api.models.enterprise_agent_state import EnterpriseAgentState +from dashboards_api.models.error import Error +from dashboards_api.models.generate_dashboard_snapshot_request import GenerateDashboardSnapshotRequest +from dashboards_api.models.geo_map_datasource import GeoMapDatasource +from dashboards_api.models.get_dashboard_data200_response import GetDashboardData200Response +from dashboards_api.models.grouped_bar_chart_datasource import GroupedBarChartDatasource +from dashboards_api.models.link import Link +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.multi_metrics_table_datasource import MultiMetricsTableDatasource +from dashboards_api.models.numbers_card_datasource import NumbersCardDatasource +from dashboards_api.models.pagination_links import PaginationLinks +from dashboards_api.models.pagination_links_links import PaginationLinksLinks +from dashboards_api.models.pie_chart_datasource import PieChartDatasource +from dashboards_api.models.query_window import QueryWindow +from dashboards_api.models.scalable_widget import ScalableWidget +from dashboards_api.models.self_links import SelfLinks +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.snapshot_data_by_widget200_response import SnapshotDataByWidget200Response +from dashboards_api.models.stacked_area_chart_datasource import StackedAreaChartDatasource +from dashboards_api.models.stacked_bar_chart_datasource import StackedBarChartDatasource +from dashboards_api.models.table_datasource import TableDatasource +from dashboards_api.models.test_table_datasource import TestTableDatasource +from dashboards_api.models.test_table_filter_key import TestTableFilterKey +from dashboards_api.models.test_table_filter_type import TestTableFilterType +from dashboards_api.models.timeseries_datasource import TimeseriesDatasource +from dashboards_api.models.unauthorized_error import UnauthorizedError +from dashboards_api.models.update_snapshot_expiration_date_api_request import UpdateSnapshotExpirationDateApiRequest +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget import Widget +from dashboards_api.models.widget_measure_type import WidgetMeasureType +from dashboards_api.models.widget_sort_direction import WidgetSortDirection +from dashboards_api.models.widget_sort_property import WidgetSortProperty +from dashboards_api.models.widget_type import WidgetType diff --git a/dashboards_api/dashboards_api/models/agent_status_datasource.py b/dashboards_api/dashboards_api/models/agent_status_datasource.py new file mode 100644 index 00000000..8a00ca44 --- /dev/null +++ b/dashboards_api/dashboards_api/models/agent_status_datasource.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 AgentStatusDatasource(str, Enum): + """ + Datasource of the agent to retrieve status. + """ + + """ + allowed enum values + """ + ALERTS = 'ALERTS' + DEVICES = 'DEVICES' + DNSP = 'DNSP' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + ENDPOINT_AST_TEST = 'ENDPOINT_AST_TEST' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_LOCAL_NETWORK = 'ENDPOINT_LOCAL_NETWORK' + ENDPOINT_LOCAL_NETWORK_WIRELESS = 'ENDPOINT_LOCAL_NETWORK_WIRELESS' + ROUTING = 'ROUTING' + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' + APPDYNAMICS_SERVICE_HEALTH = 'APPDYNAMICS_SERVICE_HEALTH' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AgentStatusDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/agent_widget_show.py b/dashboards_api/dashboards_api/models/agent_widget_show.py new file mode 100644 index 00000000..9335221b --- /dev/null +++ b/dashboards_api/dashboards_api/models/agent_widget_show.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 AgentWidgetShow(str, Enum): + """ + Ownership of the agent. + """ + + """ + allowed enum values + """ + OWNED = 'owned' + ALL = 'all' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AgentWidgetShow from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/agent_widget_type.py b/dashboards_api/dashboards_api/models/agent_widget_type.py new file mode 100644 index 00000000..f5593dd6 --- /dev/null +++ b/dashboards_api/dashboards_api/models/agent_widget_type.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 AgentWidgetType(str, Enum): + """ + Type of the agent. + """ + + """ + allowed enum values + """ + ENTERPRISE = 'enterprise' + ENDPOINT = 'endpoint' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AgentWidgetType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/alert_list_datasource.py b/dashboards_api/dashboards_api/models/alert_list_datasource.py new file mode 100644 index 00000000..15c8960c --- /dev/null +++ b/dashboards_api/dashboards_api/models/alert_list_datasource.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 AlertListDatasource(str, Enum): + """ + Datasource of the alert list. + """ + + """ + allowed enum values + """ + ALERTS = 'ALERTS' + DEVICES = 'DEVICES' + DNSP = 'DNSP' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + ENDPOINT_AST_TEST = 'ENDPOINT_AST_TEST' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_LOCAL_NETWORK = 'ENDPOINT_LOCAL_NETWORK' + ENDPOINT_LOCAL_NETWORK_WIRELESS = 'ENDPOINT_LOCAL_NETWORK_WIRELESS' + ROUTING = 'ROUTING' + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' + APPDYNAMICS_SERVICE_HEALTH = 'APPDYNAMICS_SERVICE_HEALTH' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AlertListDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/api_agent_location.py b/dashboards_api/dashboards_api/models/api_agent_location.py new file mode 100644 index 00000000..f4aa778a --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_agent_location.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiAgentLocation(BaseModel): + """ + Location of the agent. + """ # noqa: E501 + latitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Latitude of the agent.") + longitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Longitude of the agent.") + location_name: Optional[StrictStr] = Field(default=None, description="Name of the agent location.", alias="locationName") + __properties: ClassVar[List[str]] = ["latitude", "longitude", "locationName"] + + 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 ApiAgentLocation 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 ApiAgentLocation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "latitude": obj.get("latitude"), + "longitude": obj.get("longitude"), + "locationName": obj.get("locationName") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_agent_status_agent.py b/dashboards_api/dashboards_api/models/api_agent_status_agent.py new file mode 100644 index 00000000..0fa61802 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_agent_status_agent.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.api_agent_location import ApiAgentLocation +from dashboards_api.models.api_agent_status_ip_info import ApiAgentStatusIpInfo +from dashboards_api.models.enterprise_agent_state import EnterpriseAgentState +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiAgentStatusAgent(BaseModel): + """ + Agent shown in agent status widget. + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Identifier of the agent.", alias="agentId") + status: Optional[EnterpriseAgentState] = None + ip_info: Optional[ApiAgentStatusIpInfo] = Field(default=None, alias="ipInfo") + agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent", alias="agentName") + location: Optional[ApiAgentLocation] = None + __properties: ClassVar[List[str]] = ["agentId", "status", "ipInfo", "agentName", "location"] + + 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 ApiAgentStatusAgent 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 ip_info + if self.ip_info: + _dict['ipInfo'] = self.ip_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of location + if self.location: + _dict['location'] = self.location.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiAgentStatusAgent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "status": obj.get("status"), + "ipInfo": ApiAgentStatusIpInfo.from_dict(obj.get("ipInfo")) if obj.get("ipInfo") is not None else None, + "agentName": obj.get("agentName"), + "location": ApiAgentLocation.from_dict(obj.get("location")) if obj.get("location") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_agent_status_ip_info.py b/dashboards_api/dashboards_api/models/api_agent_status_ip_info.py new file mode 100644 index 00000000..10cdef11 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_agent_status_ip_info.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 ApiAgentStatusIpInfo(BaseModel): + """ + IP information of the agent. + """ # noqa: E501 + public_ip: Optional[StrictStr] = Field(default=None, description="Public IP of the agent.", alias="publicIp") + private_ip: Optional[StrictStr] = Field(default=None, description="Private IP of the agent.", alias="privateIp") + ipv6: Optional[StrictStr] = None + operative_system_version: Optional[StrictStr] = Field(default=None, alias="operativeSystemVersion") + __properties: ClassVar[List[str]] = ["publicIp", "privateIp", "ipv6", "operativeSystemVersion"] + + 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 ApiAgentStatusIpInfo 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 ApiAgentStatusIpInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "publicIp": obj.get("publicIp"), + "privateIp": obj.get("privateIp"), + "ipv6": obj.get("ipv6"), + "operativeSystemVersion": obj.get("operativeSystemVersion") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_agent_status_summary.py b/dashboards_api/dashboards_api/models/api_agent_status_summary.py new file mode 100644 index 00000000..2f111b9c --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_agent_status_summary.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiAgentStatusSummary(BaseModel): + """ + Summary of the agent status. + """ # noqa: E501 + online: Optional[StrictInt] = Field(default=None, description="Shows the number of agents with an online status.") + offline: Optional[StrictInt] = Field(default=None, description="Shows the number of agents with an offline status.") + disabled: Optional[StrictInt] = Field(default=None, description="Shows the number of agents with disabled status.") + __properties: ClassVar[List[str]] = ["online", "offline", "disabled"] + + 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 ApiAgentStatusSummary 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 ApiAgentStatusSummary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "online": obj.get("online"), + "offline": obj.get("offline"), + "disabled": obj.get("disabled") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_agent_status_widget.py b/dashboards_api/dashboards_api/models/api_agent_status_widget.py new file mode 100644 index 00000000..0016c5c9 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_agent_status_widget.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from dashboards_api.models.agent_status_datasource import AgentStatusDatasource +from dashboards_api.models.agent_widget_show import AgentWidgetShow +from dashboards_api.models.agent_widget_type import AgentWidgetType +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiAgentStatusWidget(BaseModel): + """ + ApiAgentStatusWidget + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + agents: Optional[AgentWidgetType] = None + show: Optional[AgentWidgetShow] = None + data_source: Optional[AgentStatusDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "agents", "show", "dataSource"] + + 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 ApiAgentStatusWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.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 ApiAgentStatusWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "agents": obj.get("agents"), + "show": obj.get("show"), + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_aggregate_property.py b/dashboards_api/dashboards_api/models/api_aggregate_property.py new file mode 100644 index 00000000..23f9bcb2 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_aggregate_property.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 ApiAggregateProperty(str, Enum): + """ + Defines the property by which to aggregate the metric. Metrics are grouped based on unique values of the chosen property. Selecting `ALL` aggregates the data into a single group. + """ + + """ + allowed enum values + """ + TIME = 'TIME' + NONE = 'NONE' + ALL = 'ALL' + SOURCE = 'SOURCE' + AGENT = 'AGENT' + MONITOR = 'MONITOR' + CONTINENT = 'CONTINENT' + COUNTRY = 'COUNTRY' + REGION = 'REGION' + TARGET_AGENT = 'TARGET_AGENT' + SOURCE_AND_TARGET_AGENT = 'SOURCE_AND_TARGET_AGENT' + TEST = 'TEST' + SERVER = 'SERVER' + TEST_LABEL = 'TEST_LABEL' + AGENT_LABEL = 'AGENT_LABEL' + TRANSACTION_STEP = 'TRANSACTION_STEP' + TRANSACTION_PAGE = 'TRANSACTION_PAGE' + WEB_TRANSACTION_MARKER = 'WEB_TRANSACTION_MARKER' + WEB_TRANSACTION_MARKER_INTERNAL = 'WEB_TRANSACTION_MARKER_INTERNAL' + WEB_TRANSACTION_PAGE = 'WEB_TRANSACTION_PAGE' + WEB_TRANSACTION_PAGE_INTERNAL = 'WEB_TRANSACTION_PAGE_INTERNAL' + EYEBROW_MACHINE_ID = 'EYEBROW_MACHINE_ID' + EYEBROW_CLIENT_ID = 'EYEBROW_CLIENT_ID' + EYEBROW_HOST = 'EYEBROW_HOST' + EYEBROW_NETWORK_ID = 'EYEBROW_NETWORK_ID' + EYEBROW_WHOIS_RANGE_ID = 'EYEBROW_WHOIS_RANGE_ID' + EYEBROW_PLATFORM = 'EYEBROW_PLATFORM' + EYEBROW_CONNECTION = 'EYEBROW_CONNECTION' + EYEBROW_GEONAME_ID = 'EYEBROW_GEONAME_ID' + EYEBROW_LABEL = 'EYEBROW_LABEL' + EYEBROW_DOMAIN = 'EYEBROW_DOMAIN' + EYEBROW_TEST = 'EYEBROW_TEST' + EYEBROW_AGENT_TYPE = 'EYEBROW_AGENT_TYPE' + EYEBROW_TARGET_IP = 'EYEBROW_TARGET_IP' + EYEBROW_NET_TARGET_IP = 'EYEBROW_NET_TARGET_IP' + EYEBROW_GATEWAY = 'EYEBROW_GATEWAY' + EYEBROW_SSID = 'EYEBROW_SSID' + SSID = 'SSID' + EYEBROW_BSSID = 'EYEBROW_BSSID' + BSSID = 'BSSID' + EYEBROW_VPN_VENDOR = 'EYEBROW_VPN_VENDOR' + EYEBROW_VPN_GATEWAY = 'EYEBROW_VPN_GATEWAY' + EYEBROW_PROXY_ADDRESS = 'EYEBROW_PROXY_ADDRESS' + EYEBROW_NETWORK_PROBE_DNS_SERVER = 'EYEBROW_NETWORK_PROBE_DNS_SERVER' + EYEBROW_DESTINATION_IP_ADDRESS = 'EYEBROW_DESTINATION_IP_ADDRESS' + EYEBROW_SESSION_ERRORS = 'EYEBROW_SESSION_ERRORS' + EYEBROW_ASN = 'EYEBROW_ASN' + DEVICE_INTERFACE = 'DEVICE_INTERFACE' + DEVICE = 'DEVICE' + DEVICE_CLASS = 'DEVICE_CLASS' + DEVICE_INTERFACE_TYPE = 'DEVICE_INTERFACE_TYPE' + INSIGHTS_CATALOG_PROVIDER = 'INSIGHTS_CATALOG_PROVIDER' + INSIGHTS_ASN = 'INSIGHTS_ASN' + ASN = 'ASN' + INSIGHTS_LOCATION = 'INSIGHTS_LOCATION' + INSIGHTS_AFFECTED_TEST = 'INSIGHTS_AFFECTED_TEST' + INSIGHTS_AFFECTED_DOMAIN = 'INSIGHTS_AFFECTED_DOMAIN' + INSIGHTS_AFFECTED_INTERFACE_LOCATION = 'INSIGHTS_AFFECTED_INTERFACE_LOCATION' + INSIGHTS_AFFECTED_INTERFACE_IP = 'INSIGHTS_AFFECTED_INTERFACE_IP' + INSIGHTS_DESTINATION_LOCATION = 'INSIGHTS_DESTINATION_LOCATION' + INSIGHTS_DESTINATION_ASN = 'INSIGHTS_DESTINATION_ASN' + INSIGHTS_DESTINATION_PREFIX = 'INSIGHTS_DESTINATION_PREFIX' + INSIGHTS_APPLICATION = 'INSIGHTS_APPLICATION' + INSIGHTS_ERROR_TYPE = 'INSIGHTS_ERROR_TYPE' + INSIGHTS_AFFECTED_DOMAIN_LOCATION = 'INSIGHTS_AFFECTED_DOMAIN_LOCATION' + INSIGHTS_AFFECTED_SERVER_LOCATION = 'INSIGHTS_AFFECTED_SERVER_LOCATION' + APPDYNAMICS_APPLICATION = 'APPDYNAMICS_APPLICATION' + APPDYNAMICS_SERVICE = 'APPDYNAMICS_SERVICE' + DOMAIN = 'DOMAIN' + EYEBROW_ORG_NAME = 'EYEBROW_ORG_NAME' + EYEBROW_USER = 'EYEBROW_USER' + EYEBROW_AGENT = 'EYEBROW_AGENT' + EYEBROW_COMPUTER_NAME = 'EYEBROW_COMPUTER_NAME' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ApiAggregateProperty from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/api_alert_list_alert.py b/dashboards_api/dashboards_api/models/api_alert_list_alert.py new file mode 100644 index 00000000..e4e2a2f2 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_alert_list_alert.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.api_alert_list_alert_type import ApiAlertListAlertType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiAlertListAlert(BaseModel): + """ + Alert shown in the alert list widget. + """ # noqa: E501 + alert_id: Optional[StrictStr] = Field(default=None, description="Identifier of the alert.", alias="alertId") + test_id: Optional[StrictStr] = Field(default=None, description="Identifier of the test.", alias="testId") + rule_id: Optional[StrictStr] = Field(default=None, description="Identifier of the rule.", alias="ruleId") + alert_source: Optional[StrictStr] = Field(default=None, description="Name of the agent, monitor or device producing the alert.", alias="alertSource") + alert_rule: Optional[StrictStr] = Field(default=None, description="Name of the alert rule that this alert belongs to.", alias="alertRule") + alert_type: Optional[ApiAlertListAlertType] = Field(default=None, alias="alertType") + start_time: Optional[datetime] = Field(default=None, description="UTC date when the alert was first active.", alias="startTime") + duration_in_seconds: Optional[StrictInt] = Field(default=None, description="Number of seconds the alert was active. If it’s still active, this number will increase every second.", alias="durationInSeconds") + active: Optional[StrictBool] = Field(default=None, description="Set to `true` if alert is active, `false` otherwise.") + __properties: ClassVar[List[str]] = ["alertId", "testId", "ruleId", "alertSource", "alertRule", "alertType", "startTime", "durationInSeconds", "active"] + + 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 ApiAlertListAlert 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 ApiAlertListAlert from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alertId": obj.get("alertId"), + "testId": obj.get("testId"), + "ruleId": obj.get("ruleId"), + "alertSource": obj.get("alertSource"), + "alertRule": obj.get("alertRule"), + "alertType": obj.get("alertType"), + "startTime": obj.get("startTime"), + "durationInSeconds": obj.get("durationInSeconds"), + "active": obj.get("active") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_alert_list_alert_type.py b/dashboards_api/dashboards_api/models/api_alert_list_alert_type.py new file mode 100644 index 00000000..bebb36c1 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_alert_list_alert_type.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 ApiAlertListAlertType(str, Enum): + """ + Name of the alert type + """ + + """ + allowed enum values + """ + NETWORK_MINUS__END_MINUS_TO_MINUS_END_LEFT_PARENTHESIS_SERVER_RIGHT_PARENTHESIS = 'Network - End-to-End (Server)' + NETWORK_MINUS_END_MINUS_TO_MINUS_END_MINUS_SERVER = 'network-end-to-end-server' + NETWORK_MINUS__END_MINUS_TO_MINUS_END_LEFT_PARENTHESIS_AGENT_RIGHT_PARENTHESIS = 'Network - End-to-End (Agent)' + NETWORK_MINUS_END_MINUS_TO_MINUS_END_MINUS_AGENT = 'network-end-to-end-agent' + NETWORK_MINUS__PATH_TRACE = 'Network - Path Trace' + NETWORK_MINUS_PATH_MINUS_TRACE = 'network-path-trace' + DNS_SERVER = 'DNS Server' + DNS_MINUS_SERVER = 'dns-server' + DNS_TRACE = 'DNS Trace' + DNS_MINUS_TRACE = 'dns-trace' + DNSSEC = 'DNSSEC' + DNSSEC = 'dnssec' + DNS_PLUS__DOMAIN = 'DNS+ Domain' + DNS_MINUS_PLUS_MINUS_DOMAIN = 'dns-plus-domain' + DNS_PLUS__SERVER = 'DNS+ Server' + DNS_MINUS_PLUS_MINUS_SERVER = 'dns-plus-server' + WEB_MINUS__HTTP_SERVER = 'Web - HTTP Server' + WEB_MINUS_HTTP_MINUS_SERVER = 'web-http-server' + WEB_MINUS__PAGE_LOAD = 'Web - Page Load' + WEB_MINUS_PAGE_MINUS_LOAD = 'web-page-load' + WEB_MINUS__TRANSACTION_LEFT_PARENTHESIS_CLASSIC_RIGHT_PARENTHESIS = 'Web - Transaction (Classic)' + WEB_MINUS_TRANSACTION_MINUS_CLASSIC = 'web-transaction-classic' + WEB_MINUS__TRANSACTION = 'Web - Transaction' + WEB_MINUS_TRANSACTION = 'web-transaction' + WEB_MINUS__FTP_SERVER = 'Web - FTP Server' + WEB_MINUS_FTP_MINUS_SERVER = 'web-ftp-server' + VOICE_MINUS__SIP_SERVER = 'Voice - SIP Server' + VOICE_MINUS_SIP_MINUS_SERVER = 'voice-sip-server' + VOICE_MINUS__RTP_STREAM = 'Voice - RTP Stream' + VOICE_MINUS_RTP_MINUS_STREAM = 'voice-rtp-stream' + DEVICE = 'Device' + DEVICE = 'device' + DEVICE_INTERFACE = 'Device Interface' + DEVICE_MINUS_INTERFACE = 'device-interface' + ENDPOINT_MINUS__END_MINUS_TO_MINUS_END_LEFT_PARENTHESIS_SERVER_RIGHT_PARENTHESIS = 'Endpoint - End-to-End (Server)' + ENDPOINT_MINUS_END_MINUS_TO_MINUS_END_MINUS_SERVER = 'endpoint-end-to-end-server' + ENDPOINT_WEB_MINUS__HTTP_SERVER = 'EndpointWeb - HTTP Server' + ENDPOINT_MINUS_WEB_MINUS_HTTP_MINUS_SERVER = 'endpoint-web-http-server' + ENDPOINT_MINUS__PATH_TRACE = 'Endpoint - Path Trace' + ENDPOINT_MINUS_PATH_MINUS_TRACE = 'endpoint-path-trace' + BROWSER_SESSIONS_MINUS__AGENT = 'Browser Sessions - Agent' + BROWSER_MINUS_SESSION_MINUS_AGENT = 'browser-session-agent' + BROWSER_SESSIONS_MINUS__APPLICATION = 'Browser Sessions - Application' + BROWSER_MINUS_SESSION_MINUS_APPLICATION = 'browser-session-application' + ROUTING_MINUS__BGP = 'Routing - BGP' + ROUTING_MINUS_BGP = 'routing-bgp' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ApiAlertListAlertType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/api_alert_list_widget.py b/dashboards_api/dashboards_api/models/api_alert_list_widget.py new file mode 100644 index 00000000..78af362a --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_alert_list_widget.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import Field +from dashboards_api.models.alert_list_datasource import AlertListDatasource +from dashboards_api.models.api_alert_list_alert_type import ApiAlertListAlertType +from dashboards_api.models.api_alert_list_widget_all_of_active_within import ApiAlertListWidgetAllOfActiveWithin +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiAlertListWidget(BaseModel): + """ + ApiAlertListWidget + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + alert_types: Optional[List[ApiAlertListAlertType]] = Field(default=None, description="List of alert types configured in the widget, an empty list means all alert types.", alias="alertTypes") + limit_to: Optional[StrictInt] = Field(default=None, description="Limit the number of alerts displayed in the widget.", alias="limitTo") + active_within: Optional[ApiAlertListWidgetAllOfActiveWithin] = Field(default=None, alias="activeWithin") + data_source: Optional[AlertListDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "alertTypes", "limitTo", "activeWithin", "dataSource"] + + 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 ApiAlertListWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of active_within + if self.active_within: + _dict['activeWithin'] = self.active_within.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiAlertListWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "alertTypes": obj.get("alertTypes"), + "limitTo": obj.get("limitTo"), + "activeWithin": ApiAlertListWidgetAllOfActiveWithin.from_dict(obj.get("activeWithin")) if obj.get("activeWithin") is not None else None, + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_alert_list_widget_all_of_active_within.py b/dashboards_api/dashboards_api/models/api_alert_list_widget_all_of_active_within.py new file mode 100644 index 00000000..e9beed2c --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_alert_list_widget_all_of_active_within.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +from pydantic import Field +from dashboards_api.models.duration_unit import DurationUnit +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiAlertListWidgetAllOfActiveWithin(BaseModel): + """ + ApiAlertListWidgetAllOfActiveWithin + """ # noqa: E501 + value: Optional[StrictInt] = Field(default=None, description="Timespan value.") + unit: Optional[DurationUnit] = None + __properties: ClassVar[List[str]] = ["value", "unit"] + + 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 ApiAlertListWidgetAllOfActiveWithin 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 ApiAlertListWidgetAllOfActiveWithin from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value"), + "unit": obj.get("unit") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_box_and_whiskers_widget.py b/dashboards_api/dashboards_api/models/api_box_and_whiskers_widget.py new file mode 100644 index 00000000..24c2076b --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_box_and_whiskers_widget.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from dashboards_api.models.api_aggregate_property import ApiAggregateProperty +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_widget_fixed_y_scale_prefix import ApiWidgetFixedYScalePrefix +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.box_and_whiskers_datasource import BoxAndWhiskersDatasource +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiBoxAndWhiskersWidget(BaseModel): + """ + A widget that displays a box and whisker plot, mapping data points over time with key statistics: median, range, and quartiles. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + min_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Mininum scale configured in the widget.", alias="minScale") + max_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum scale configured in the widget.", alias="maxScale") + unit: Optional[ApiWidgetFixedYScalePrefix] = None + group_by: Optional[ApiAggregateProperty] = Field(default=None, alias="groupBy") + data_source: Optional[BoxAndWhiskersDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "minScale", "maxScale", "unit", "groupBy", "dataSource"] + + 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 ApiBoxAndWhiskersWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.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 ApiBoxAndWhiskersWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "minScale": obj.get("minScale"), + "maxScale": obj.get("maxScale"), + "unit": obj.get("unit"), + "groupBy": obj.get("groupBy"), + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_color_grid_widget.py b/dashboards_api/dashboards_api/models/api_color_grid_widget.py new file mode 100644 index 00000000..94cdbb1f --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_color_grid_widget.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from dashboards_api.models.api_aggregate_property import ApiAggregateProperty +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_widget_fixed_y_scale_prefix import ApiWidgetFixedYScalePrefix +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.color_grid_datasource import ColorGridDatasource +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_sort_direction import WidgetSortDirection +from dashboards_api.models.widget_sort_property import WidgetSortProperty +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiColorGridWidget(BaseModel): + """ + The Color Grid widget displays colored cards arranged in rows and columns. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + min_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Mininum scale configured in the widget.", alias="minScale") + max_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum scale configured in the widget.", alias="maxScale") + unit: Optional[ApiWidgetFixedYScalePrefix] = None + cards: Optional[ApiAggregateProperty] = None + group_cards_by: Optional[ApiAggregateProperty] = Field(default=None, alias="groupCardsBy") + columns: Optional[StrictInt] = Field(default=None, description="Number of columns: 1 or 2.") + limit: Optional[StrictInt] = Field(default=None, description="Limit configured in the widget.") + sort_by: Optional[WidgetSortProperty] = Field(default=None, alias="sortBy") + sort_direction: Optional[WidgetSortDirection] = Field(default=None, alias="sortDirection") + data_source: Optional[ColorGridDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "minScale", "maxScale", "unit", "cards", "groupCardsBy", "columns", "limit", "sortBy", "sortDirection", "dataSource"] + + 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 ApiColorGridWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.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 ApiColorGridWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "minScale": obj.get("minScale"), + "maxScale": obj.get("maxScale"), + "unit": obj.get("unit"), + "cards": obj.get("cards"), + "groupCardsBy": obj.get("groupCardsBy"), + "columns": obj.get("columns"), + "limit": obj.get("limit"), + "sortBy": obj.get("sortBy"), + "sortDirection": obj.get("sortDirection"), + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_dashboard.py b/dashboards_api/dashboards_api/models/api_dashboard.py new file mode 100644 index 00000000..b0e02380 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_dashboard.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.api_default_timespan import ApiDefaultTimespan +from dashboards_api.models.api_widget import ApiWidget +from dashboards_api.models.dashboard_links_links import DashboardLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiDashboard(BaseModel): + """ + ApiDashboard + """ # noqa: E501 + links: Optional[DashboardLinksLinks] = Field(default=None, alias="_links") + dashboard_id: Optional[StrictStr] = Field(default=None, description="Identifier of a dashboard.", alias="dashboardId") + title: Optional[StrictStr] = Field(default=None, description="Title of a dashboard.") + is_built_in: Optional[StrictBool] = Field(default=None, description="Indicates if a dashboard is built-in. True for built-in dashboards, false for user-created dashboards.", alias="isBuiltIn") + aid: Optional[StrictStr] = Field(default=None, description="Identifier for the account group associated with a dashboard.") + dashboard_created_by: Optional[StrictStr] = Field(default=None, description="Identifier for the user that created a dashboard.", alias="dashboardCreatedBy") + dashboard_modified_by: Optional[StrictStr] = Field(default=None, description="Identifier for the user that last modified a dashboard.", alias="dashboardModifiedBy") + dashboard_modified_date: Optional[datetime] = Field(default=None, description="UTC date/time when a dashboard was last modified (ISO date-time format).", alias="dashboardModifiedDate") + is_private: Optional[StrictBool] = Field(default=None, description="A dashboard can be viewed by other users in the account. If true, only the creator of the dashboard may view it. If false, all users in the same account may view it.", alias="isPrivate") + is_default_for_user: Optional[StrictBool] = Field(default=None, description="Indicates whether this dashboard is the user's default. True for default, false if not.", alias="isDefaultForUser") + is_default_for_account: Optional[StrictBool] = Field(default=None, description="Indicates whether this dashboard is the account group's default. True for default, false if not.", alias="isDefaultForAccount") + widgets: Optional[List[ApiWidget]] = None + description: Optional[StrictStr] = Field(default=None, description="A text description of the dashboard's purpose and functionality. This information assists users in understanding the dashboard but isn't displayed when viewing a dashboard.") + default_timespan: Optional[ApiDefaultTimespan] = Field(default=None, alias="defaultTimespan") + is_global_override: Optional[StrictBool] = Field(default=None, description="When set to `true`, the defaultTimespan is used and overrides the widget's timespan. If set to `false`, the the widget's timespan is used.", alias="isGlobalOverride") + is_migrated_report: Optional[StrictBool] = Field(default=None, description="True if this dashboard was previously a report.", alias="isMigratedReport") + __properties: ClassVar[List[str]] = ["_links", "dashboardId", "title", "isBuiltIn", "aid", "dashboardCreatedBy", "dashboardModifiedBy", "dashboardModifiedDate", "isPrivate", "isDefaultForUser", "isDefaultForAccount", "widgets", "description", "defaultTimespan", "isGlobalOverride", "isMigratedReport"] + + 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 ApiDashboard 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "dashboard_id", + "is_built_in", + "aid", + "dashboard_created_by", + "dashboard_modified_by", + "dashboard_modified_date", + "is_default_for_user", + "is_default_for_account", + "is_migrated_report", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in widgets (list) + _items = [] + if self.widgets: + for _item in self.widgets: + if _item: + _items.append(_item.to_dict()) + _dict['widgets'] = _items + # override the default output from pydantic by calling `to_dict()` of default_timespan + if self.default_timespan: + _dict['defaultTimespan'] = self.default_timespan.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiDashboard from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": DashboardLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "dashboardId": obj.get("dashboardId"), + "title": obj.get("title"), + "isBuiltIn": obj.get("isBuiltIn"), + "aid": obj.get("aid"), + "dashboardCreatedBy": obj.get("dashboardCreatedBy"), + "dashboardModifiedBy": obj.get("dashboardModifiedBy"), + "dashboardModifiedDate": obj.get("dashboardModifiedDate"), + "isPrivate": obj.get("isPrivate"), + "isDefaultForUser": obj.get("isDefaultForUser"), + "isDefaultForAccount": obj.get("isDefaultForAccount"), + "widgets": [ApiWidget.from_dict(_item) for _item in obj.get("widgets")] if obj.get("widgets") is not None else None, + "description": obj.get("description"), + "defaultTimespan": ApiDefaultTimespan.from_dict(obj.get("defaultTimespan")) if obj.get("defaultTimespan") is not None else None, + "isGlobalOverride": obj.get("isGlobalOverride"), + "isMigratedReport": obj.get("isMigratedReport") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_dashboard_asw.py b/dashboards_api/dashboards_api/models/api_dashboard_asw.py new file mode 100644 index 00000000..34b2a410 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_dashboard_asw.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.asw_repeat import AswRepeat +from dashboards_api.models.asw_repeat_unit import AswRepeatUnit +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiDashboardAsw(BaseModel): + """ + Alert suppression window shown in a widget. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the alert suppression window.") + name: Optional[StrictStr] = Field(default=None, description="Name of the alert suppression window.") + test_ids: Optional[List[StrictStr]] = Field(default=None, alias="testIds") + start_times: Optional[List[datetime]] = Field(default=None, alias="startTimes") + duration_in_seconds: Optional[StrictInt] = Field(default=None, alias="durationInSeconds") + repeat: Optional[AswRepeat] = None + repeat_every: Optional[StrictInt] = Field(default=None, alias="repeatEvery") + repeat_unit: Optional[AswRepeatUnit] = Field(default=None, alias="repeatUnit") + __properties: ClassVar[List[str]] = ["id", "name", "testIds", "startTimes", "durationInSeconds", "repeat", "repeatEvery", "repeatUnit"] + + 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 ApiDashboardAsw 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 ApiDashboardAsw from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "testIds": obj.get("testIds"), + "startTimes": obj.get("startTimes"), + "durationInSeconds": obj.get("durationInSeconds"), + "repeat": obj.get("repeat"), + "repeatEvery": obj.get("repeatEvery"), + "repeatUnit": obj.get("repeatUnit") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_dashboard_snapshot.py b/dashboards_api/dashboards_api/models/api_dashboard_snapshot.py new file mode 100644 index 00000000..7bb235e0 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_dashboard_snapshot.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.api_dashboard_snapshot_all_of_dashboard import ApiDashboardSnapshotAllOfDashboard +from dashboards_api.models.api_report_snapshot_time_span import ApiReportSnapshotTimeSpan +from dashboards_api.models.api_widget import ApiWidget +from dashboards_api.models.dashboard_snapshot_links_links import DashboardSnapshotLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiDashboardSnapshot(BaseModel): + """ + ApiDashboardSnapshot + """ # noqa: E501 + links: Optional[DashboardSnapshotLinksLinks] = Field(default=None, alias="_links") + snapshot_id: Optional[StrictStr] = Field(default=None, description="Identifier of the dashboard snapshot.", alias="snapshotId") + snapshot_name: Optional[StrictStr] = Field(default=None, description="Name of the dashboard snapshot.", alias="snapshotName") + aid: Optional[StrictStr] = Field(default=None, description="Identifier of the account group that the snapshot belongs to.") + is_shared: Optional[StrictBool] = Field(default=None, description="Set `true` if dashboard snapshot is shared, `false` otherwise.", alias="isShared") + snapshot_created_date: Optional[datetime] = Field(default=None, description="UTC date when dashboard snapshot was created (ISO date-time format).", alias="snapshotCreatedDate") + dashboard: Optional[ApiDashboardSnapshotAllOfDashboard] = None + widgets: Optional[List[ApiWidget]] = None + is_scheduled: Optional[StrictBool] = Field(default=None, description="Set `true` if dashboard snapshot was generated from a schedule, `false` otherwise.", alias="isScheduled") + time_span: Optional[ApiReportSnapshotTimeSpan] = Field(default=None, alias="timeSpan") + snapshot_expiration_date: Optional[datetime] = Field(default=None, description="Expiration date of the snapshot. If unspecified, the snapshot expires 1 year from its creation date. The expiration date must be set within 5 years from the current date and adhere to the ISO date-time format.", alias="snapshotExpirationDate") + __properties: ClassVar[List[str]] = ["_links", "snapshotId", "snapshotName", "aid", "isShared", "snapshotCreatedDate", "dashboard", "widgets", "isScheduled", "timeSpan", "snapshotExpirationDate"] + + 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 ApiDashboardSnapshot 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() + # override the default output from pydantic by calling `to_dict()` of dashboard + if self.dashboard: + _dict['dashboard'] = self.dashboard.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in widgets (list) + _items = [] + if self.widgets: + for _item in self.widgets: + if _item: + _items.append(_item.to_dict()) + _dict['widgets'] = _items + # override the default output from pydantic by calling `to_dict()` of time_span + if self.time_span: + _dict['timeSpan'] = self.time_span.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiDashboardSnapshot from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": DashboardSnapshotLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "snapshotId": obj.get("snapshotId"), + "snapshotName": obj.get("snapshotName"), + "aid": obj.get("aid"), + "isShared": obj.get("isShared"), + "snapshotCreatedDate": obj.get("snapshotCreatedDate"), + "dashboard": ApiDashboardSnapshotAllOfDashboard.from_dict(obj.get("dashboard")) if obj.get("dashboard") is not None else None, + "widgets": [ApiWidget.from_dict(_item) for _item in obj.get("widgets")] if obj.get("widgets") is not None else None, + "isScheduled": obj.get("isScheduled"), + "timeSpan": ApiReportSnapshotTimeSpan.from_dict(obj.get("timeSpan")) if obj.get("timeSpan") is not None else None, + "snapshotExpirationDate": obj.get("snapshotExpirationDate") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_dashboard_snapshot_all_of_dashboard.py b/dashboards_api/dashboards_api/models/api_dashboard_snapshot_all_of_dashboard.py new file mode 100644 index 00000000..1d8af97c --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_dashboard_snapshot_all_of_dashboard.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.api_default_timespan import ApiDefaultTimespan +from dashboards_api.models.api_widget import ApiWidget +from dashboards_api.models.dashboard_links_links import DashboardLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiDashboardSnapshotAllOfDashboard(BaseModel): + """ + ApiDashboardSnapshotAllOfDashboard + """ # noqa: E501 + dashboard_id: Optional[StrictStr] = Field(default=None, description="Identifier of a dashboard.", alias="dashboardId") + title: Optional[StrictStr] = Field(default=None, description="Title of a dashboard.") + is_built_in: Optional[StrictBool] = Field(default=None, description="Indicates if a dashboard is built-in. True for built-in dashboards, false for user-created dashboards.", alias="isBuiltIn") + aid: Optional[StrictStr] = Field(default=None, description="Identifier for the account group associated with a dashboard.") + dashboard_created_by: Optional[StrictStr] = Field(default=None, description="Identifier for the user that created a dashboard.", alias="dashboardCreatedBy") + dashboard_modified_by: Optional[StrictStr] = Field(default=None, description="Identifier for the user that last modified a dashboard.", alias="dashboardModifiedBy") + dashboard_modified_date: Optional[datetime] = Field(default=None, description="UTC date/time when a dashboard was last modified (ISO date-time format).", alias="dashboardModifiedDate") + is_private: Optional[StrictBool] = Field(default=None, description="A dashboard can be viewed by other users in the account. If true, only the creator of the dashboard may view it. If false, all users in the same account may view it.", alias="isPrivate") + is_default_for_user: Optional[StrictBool] = Field(default=None, description="Indicates whether this dashboard is the user's default. True for default, false if not.", alias="isDefaultForUser") + is_default_for_account: Optional[StrictBool] = Field(default=None, description="Indicates whether this dashboard is the account group's default. True for default, false if not.", alias="isDefaultForAccount") + widgets: Optional[List[ApiWidget]] = None + description: Optional[StrictStr] = Field(default=None, description="A text description of the dashboard's purpose and functionality. This information assists users in understanding the dashboard but isn't displayed when viewing a dashboard.") + default_timespan: Optional[ApiDefaultTimespan] = Field(default=None, alias="defaultTimespan") + is_global_override: Optional[StrictBool] = Field(default=None, description="When set to `true`, the defaultTimespan is used and overrides the widget's timespan. If set to `false`, the the widget's timespan is used.", alias="isGlobalOverride") + is_migrated_report: Optional[StrictBool] = Field(default=None, description="True if this dashboard was previously a report.", alias="isMigratedReport") + links: Optional[DashboardLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["dashboardId", "title", "isBuiltIn", "aid", "dashboardCreatedBy", "dashboardModifiedBy", "dashboardModifiedDate", "isPrivate", "isDefaultForUser", "isDefaultForAccount", "widgets", "description", "defaultTimespan", "isGlobalOverride", "isMigratedReport", "_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 ApiDashboardSnapshotAllOfDashboard 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "dashboard_id", + "is_built_in", + "aid", + "dashboard_created_by", + "dashboard_modified_by", + "dashboard_modified_date", + "is_default_for_user", + "is_default_for_account", + "is_migrated_report", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in widgets (list) + _items = [] + if self.widgets: + for _item in self.widgets: + if _item: + _items.append(_item.to_dict()) + _dict['widgets'] = _items + # override the default output from pydantic by calling `to_dict()` of default_timespan + if self.default_timespan: + _dict['defaultTimespan'] = self.default_timespan.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 ApiDashboardSnapshotAllOfDashboard from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "dashboardId": obj.get("dashboardId"), + "title": obj.get("title"), + "isBuiltIn": obj.get("isBuiltIn"), + "aid": obj.get("aid"), + "dashboardCreatedBy": obj.get("dashboardCreatedBy"), + "dashboardModifiedBy": obj.get("dashboardModifiedBy"), + "dashboardModifiedDate": obj.get("dashboardModifiedDate"), + "isPrivate": obj.get("isPrivate"), + "isDefaultForUser": obj.get("isDefaultForUser"), + "isDefaultForAccount": obj.get("isDefaultForAccount"), + "widgets": [ApiWidget.from_dict(_item) for _item in obj.get("widgets")] if obj.get("widgets") is not None else None, + "description": obj.get("description"), + "defaultTimespan": ApiDefaultTimespan.from_dict(obj.get("defaultTimespan")) if obj.get("defaultTimespan") is not None else None, + "isGlobalOverride": obj.get("isGlobalOverride"), + "isMigratedReport": obj.get("isMigratedReport"), + "_links": DashboardLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_data_point_group.py b/dashboards_api/dashboards_api/models/api_data_point_group.py new file mode 100644 index 00000000..21d806d1 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_data_point_group.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 ApiDataPointGroup(BaseModel): + """ + Group of data points. + """ # noqa: E501 + group_property: Optional[StrictStr] = Field(default=None, description="Defines the criterion used to aggregate data points under specific group values.", alias="groupProperty") + group_value: Optional[StrictStr] = Field(default=None, description="The value of a group.", alias="groupValue") + __properties: ClassVar[List[str]] = ["groupProperty", "groupValue"] + + 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 ApiDataPointGroup 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 ApiDataPointGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "groupProperty": obj.get("groupProperty"), + "groupValue": obj.get("groupValue") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_default_timespan.py b/dashboards_api/dashboards_api/models/api_default_timespan.py new file mode 100644 index 00000000..90cc702a --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_default_timespan.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiDefaultTimespan(BaseModel): + """ + ApiDefaultTimespan + """ # noqa: E501 + duration: Optional[StrictInt] = Field(default=None, description="Relative timespan in seconds.") + start: Optional[datetime] = Field(default=None, description="UTC start date of the timespan range (ISO date-time format).") + end: Optional[datetime] = Field(default=None, description="UTC end date of the timespan range (ISO date-time format).") + __properties: ClassVar[List[str]] = ["duration", "start", "end"] + + 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 ApiDefaultTimespan 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 ApiDefaultTimespan from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "duration": obj.get("duration"), + "start": obj.get("start"), + "end": obj.get("end") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_duration.py b/dashboards_api/dashboards_api/models/api_duration.py new file mode 100644 index 00000000..1b1f5634 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_duration.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +from pydantic import Field +from dashboards_api.models.duration_unit import DurationUnit +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiDuration(BaseModel): + """ + ApiDuration + """ # noqa: E501 + value: Optional[StrictInt] = Field(default=None, description="Timespan value.") + unit: Optional[DurationUnit] = None + __properties: ClassVar[List[str]] = ["value", "unit"] + + 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 ApiDuration 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 ApiDuration from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value"), + "unit": obj.get("unit") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_geo_map_widget.py b/dashboards_api/dashboards_api/models/api_geo_map_widget.py new file mode 100644 index 00000000..42b6c7d3 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_geo_map_widget.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from dashboards_api.models.api_aggregate_property import ApiAggregateProperty +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_widget_fixed_y_scale_prefix import ApiWidgetFixedYScalePrefix +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.geo_map_datasource import GeoMapDatasource +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_sort_direction import WidgetSortDirection +from dashboards_api.models.widget_sort_property import WidgetSortProperty +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiGeoMapWidget(BaseModel): + """ + Displays data on a geographic map, highlighting information across different regions. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + min_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Mininum scale configured in the widget.", alias="minScale") + max_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum scale configured in the widget.", alias="maxScale") + unit: Optional[ApiWidgetFixedYScalePrefix] = None + group_by: Optional[ApiAggregateProperty] = Field(default=None, alias="groupBy") + is_geo_map_per_test: Optional[StrictBool] = Field(default=None, description="Indicates whether a separate map is displayed for each test within the widget. When set to true, individual maps are generated.", alias="isGeoMapPerTest") + sort_by: Optional[WidgetSortProperty] = Field(default=None, alias="sortBy") + sort_direction: Optional[WidgetSortDirection] = Field(default=None, alias="sortDirection") + data_source: Optional[GeoMapDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "minScale", "maxScale", "unit", "groupBy", "isGeoMapPerTest", "sortBy", "sortDirection", "dataSource"] + + 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 ApiGeoMapWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.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 ApiGeoMapWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "minScale": obj.get("minScale"), + "maxScale": obj.get("maxScale"), + "unit": obj.get("unit"), + "groupBy": obj.get("groupBy"), + "isGeoMapPerTest": obj.get("isGeoMapPerTest"), + "sortBy": obj.get("sortBy"), + "sortDirection": obj.get("sortDirection"), + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_graphlet_point.py b/dashboards_api/dashboards_api/models/api_graphlet_point.py new file mode 100644 index 00000000..646965ce --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_graphlet_point.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiGraphletPoint(BaseModel): + """ + A data point on a graphlet. + """ # noqa: E501 + x: Optional[StrictInt] = Field(default=None, description="Timestamp of the data point.") + y: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Value of the data point.") + __properties: ClassVar[List[str]] = ["x", "y"] + + 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 ApiGraphletPoint 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 ApiGraphletPoint from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "x": obj.get("x"), + "y": obj.get("y") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_grouped_barchart_widget.py b/dashboards_api/dashboards_api/models/api_grouped_barchart_widget.py new file mode 100644 index 00000000..dfb6f06f --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_grouped_barchart_widget.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import Field +from dashboards_api.models.api_aggregate_property import ApiAggregateProperty +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.grouped_bar_chart_datasource import GroupedBarChartDatasource +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_sort_direction import WidgetSortDirection +from dashboards_api.models.widget_sort_property import WidgetSortProperty +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiGroupedBarchartWidget(BaseModel): + """ + Displays grouped bars, each representing multiple data points. You can configure the bars to align horizontally or vertically. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + group_by: Optional[ApiAggregateProperty] = Field(default=None, alias="groupBy") + axis_group_by: Optional[ApiAggregateProperty] = Field(default=None, alias="axisGroupBy") + sort_by: Optional[WidgetSortProperty] = Field(default=None, alias="sortBy") + sort_direction: Optional[WidgetSortDirection] = Field(default=None, alias="sortDirection") + limit: Optional[StrictInt] = Field(default=None, description="Limit configured in the widget.") + show_labels: Optional[StrictBool] = Field(default=None, description="Displays labels on each bar when set to `true`.", alias="showLabels") + is_horizontal_bar_chart: Optional[StrictBool] = Field(default=None, alias="isHorizontalBarChart") + data_source: Optional[GroupedBarChartDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "groupBy", "axisGroupBy", "sortBy", "sortDirection", "limit", "showLabels", "isHorizontalBarChart", "dataSource"] + + 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 ApiGroupedBarchartWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.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 ApiGroupedBarchartWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "groupBy": obj.get("groupBy"), + "axisGroupBy": obj.get("axisGroupBy"), + "sortBy": obj.get("sortBy"), + "sortDirection": obj.get("sortDirection"), + "limit": obj.get("limit"), + "showLabels": obj.get("showLabels"), + "isHorizontalBarChart": obj.get("isHorizontalBarChart"), + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_multi_metric_column.py b/dashboards_api/dashboards_api/models/api_multi_metric_column.py new file mode 100644 index 00000000..65192830 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_multi_metric_column.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictStr +from pydantic import Field +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.multi_metrics_table_datasource import MultiMetricsTableDatasource +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiMultiMetricColumn(BaseModel): + """ + Defines a column within a table that aggregates and displays various metrics (Multi-Metric table). + """ # noqa: E501 + id: Optional[StrictStr] = None + data_source: Optional[MultiMetricsTableDatasource] = Field(default=None, alias="dataSource") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = None + measure: Optional[ApiWidgetMeasure] = None + __properties: ClassVar[List[str]] = ["id", "dataSource", "metricGroup", "direction", "metric", "filters", "measure"] + + 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 ApiMultiMetricColumn 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 measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiMultiMetricColumn from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "dataSource": obj.get("dataSource"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_multi_metric_column_data.py b/dashboards_api/dashboards_api/models/api_multi_metric_column_data.py new file mode 100644 index 00000000..c2a47da0 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_multi_metric_column_data.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +from dashboards_api.models.api_dashboard_asw import ApiDashboardAsw +from dashboards_api.models.api_widget_data_point import ApiWidgetDataPoint +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiMultiMetricColumnData(BaseModel): + """ + The data presented within a single column of a Multi-Metric table. + """ # noqa: E501 + column_id: Optional[StrictStr] = Field(default=None, description="Identifier of the column.", alias="columnId") + bin_size: Optional[StrictInt] = Field(default=None, description="Duration of each bin.", alias="binSize") + points: Optional[List[ApiWidgetDataPoint]] = None + status: Optional[StrictStr] = Field(default=None, description="Message for not fully configured card or no data.") + alert_suppression_windows: Optional[List[ApiDashboardAsw]] = Field(default=None, alias="alertSuppressionWindows") + __properties: ClassVar[List[str]] = ["columnId", "binSize", "points", "status", "alertSuppressionWindows"] + + 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 ApiMultiMetricColumnData 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 points (list) + _items = [] + if self.points: + for _item in self.points: + if _item: + _items.append(_item.to_dict()) + _dict['points'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in alert_suppression_windows (list) + _items = [] + if self.alert_suppression_windows: + for _item in self.alert_suppression_windows: + if _item: + _items.append(_item.to_dict()) + _dict['alertSuppressionWindows'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiMultiMetricColumnData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "columnId": obj.get("columnId"), + "binSize": obj.get("binSize"), + "points": [ApiWidgetDataPoint.from_dict(_item) for _item in obj.get("points")] if obj.get("points") is not None else None, + "status": obj.get("status"), + "alertSuppressionWindows": [ApiDashboardAsw.from_dict(_item) for _item in obj.get("alertSuppressionWindows")] if obj.get("alertSuppressionWindows") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_multi_metric_table_widget.py b/dashboards_api/dashboards_api/models/api_multi_metric_table_widget.py new file mode 100644 index 00000000..00b1f94e --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_multi_metric_table_widget.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import Field +from dashboards_api.models.api_aggregate_property import ApiAggregateProperty +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_multi_metric_column import ApiMultiMetricColumn +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.multi_metrics_table_datasource import MultiMetricsTableDatasource +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_sort_direction import WidgetSortDirection +from dashboards_api.models.widget_sort_property import WidgetSortProperty +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiMultiMetricTableWidget(BaseModel): + """ + A Multi-Metric table widget with columns, each representing a different metric, offering a comprehensive view rather than restricting to a single metric. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + compare_to_previous_value: Optional[StrictBool] = Field(default=None, description="Enables comparison of the current metric value with the previous value.", alias="compareToPreviousValue") + row_group_by: Optional[ApiAggregateProperty] = Field(default=None, alias="rowGroupBy") + sort_by: Optional[WidgetSortProperty] = Field(default=None, alias="sortBy") + sort_direction: Optional[WidgetSortDirection] = Field(default=None, alias="sortDirection") + limit: Optional[StrictInt] = Field(default=None, description="Limit configured in the widget.") + multi_metric_columns: Optional[List[ApiMultiMetricColumn]] = Field(default=None, alias="multiMetricColumns") + data_source: Optional[MultiMetricsTableDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "compareToPreviousValue", "rowGroupBy", "sortBy", "sortDirection", "limit", "multiMetricColumns", "dataSource"] + + 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 ApiMultiMetricTableWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in multi_metric_columns (list) + _items = [] + if self.multi_metric_columns: + for _item in self.multi_metric_columns: + if _item: + _items.append(_item.to_dict()) + _dict['multiMetricColumns'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiMultiMetricTableWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "compareToPreviousValue": obj.get("compareToPreviousValue"), + "rowGroupBy": obj.get("rowGroupBy"), + "sortBy": obj.get("sortBy"), + "sortDirection": obj.get("sortDirection"), + "limit": obj.get("limit"), + "multiMetricColumns": [ApiMultiMetricColumn.from_dict(_item) for _item in obj.get("multiMetricColumns")] if obj.get("multiMetricColumns") is not None else None, + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_multi_search_filter_api_test_table_filter_key.py b/dashboards_api/dashboards_api/models/api_multi_search_filter_api_test_table_filter_key.py new file mode 100644 index 00000000..1366a830 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_multi_search_filter_api_test_table_filter_key.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.test_table_filter_key import TestTableFilterKey +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiMultiSearchFilterApiTestTableFilterKey(BaseModel): + """ + A multi search filter key within the Multi-Metric table widget. The key represents the filter name, and the value specifies the filter value. + """ # noqa: E501 + key: Optional[TestTableFilterKey] = None + value: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["key", "value"] + + 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 ApiMultiSearchFilterApiTestTableFilterKey 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 ApiMultiSearchFilterApiTestTableFilterKey from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "key": obj.get("key"), + "value": obj.get("value") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_numbers_card.py b/dashboards_api/dashboards_api/models/api_numbers_card.py new file mode 100644 index 00000000..3f3937c7 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_numbers_card.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from dashboards_api.models.api_numbers_card_all_of_fixed_timespan import ApiNumbersCardAllOfFixedTimespan +from dashboards_api.models.api_widget_fixed_y_scale_prefix import ApiWidgetFixedYScalePrefix +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.numbers_card_datasource import NumbersCardDatasource +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiNumbersCard(BaseModel): + """ + An individual number card within the numbers card widget. + """ # noqa: E501 + min_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Mininum scale configured in the widget.", alias="minScale") + max_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum scale configured in the widget.", alias="maxScale") + unit: Optional[ApiWidgetFixedYScalePrefix] = None + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + description: Optional[StrictStr] = Field(default=None, description="Description of the number card.") + measure: Optional[ApiWidgetMeasure] = None + compare_to_previous_value: Optional[StrictBool] = Field(default=None, alias="compareToPreviousValue") + fixed_timespan: Optional[ApiNumbersCardAllOfFixedTimespan] = Field(default=None, alias="fixedTimespan") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression windows from the widget when set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + data_source: Optional[NumbersCardDatasource] = Field(default=None, alias="dataSource") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="Filters to apply to the widget.") + __properties: ClassVar[List[str]] = ["minScale", "maxScale", "unit", "id", "description", "measure", "compareToPreviousValue", "fixedTimespan", "shouldExcludeAlertSuppressionWindows", "dataSource", "metricGroup", "direction", "metric", "filters"] + + 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 ApiNumbersCard 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 measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiNumbersCard from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "minScale": obj.get("minScale"), + "maxScale": obj.get("maxScale"), + "unit": obj.get("unit"), + "id": obj.get("id"), + "description": obj.get("description"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "compareToPreviousValue": obj.get("compareToPreviousValue"), + "fixedTimespan": ApiNumbersCardAllOfFixedTimespan.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "dataSource": obj.get("dataSource"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_numbers_card_all_of_fixed_timespan.py b/dashboards_api/dashboards_api/models/api_numbers_card_all_of_fixed_timespan.py new file mode 100644 index 00000000..5f139589 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_numbers_card_all_of_fixed_timespan.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +from pydantic import Field +from dashboards_api.models.duration_unit import DurationUnit +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiNumbersCardAllOfFixedTimespan(BaseModel): + """ + ApiNumbersCardAllOfFixedTimespan + """ # noqa: E501 + value: Optional[StrictInt] = Field(default=None, description="Timespan value.") + unit: Optional[DurationUnit] = None + __properties: ClassVar[List[str]] = ["value", "unit"] + + 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 ApiNumbersCardAllOfFixedTimespan 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 ApiNumbersCardAllOfFixedTimespan from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value"), + "unit": obj.get("unit") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_numbers_card_data.py b/dashboards_api/dashboards_api/models/api_numbers_card_data.py new file mode 100644 index 00000000..922d2274 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_numbers_card_data.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from dashboards_api.models.api_dashboard_asw import ApiDashboardAsw +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiNumbersCardData(BaseModel): + """ + The data displayed on a numbers card. + """ # noqa: E501 + card_id: Optional[StrictStr] = Field(default=None, description="Identifier of the card.", alias="cardId") + start_date: Optional[datetime] = Field(default=None, description="UTC start date of the data shown in the API output (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="UTC end date of the data shown in the API output (ISO date-time format).", alias="endDate") + previous_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Previous value if `compareToPreviousValue == true` in configuration.", alias="previousValue") + bin_size: Optional[StrictInt] = Field(default=None, description="Duration of each bin.", alias="binSize") + timestamp: Optional[StrictInt] = Field(default=None, description="Timestamp of the aggregated data point.") + number_of_data_points: Optional[StrictInt] = Field(default=None, description="Number of points aggregated into the data point", alias="numberOfDataPoints") + value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Aggregated value.") + status: Optional[StrictStr] = Field(default=None, description="Message for not fully configured card or no data.") + alert_suppression_windows: Optional[List[ApiDashboardAsw]] = Field(default=None, alias="alertSuppressionWindows") + __properties: ClassVar[List[str]] = ["cardId", "startDate", "endDate", "previousValue", "binSize", "timestamp", "numberOfDataPoints", "value", "status", "alertSuppressionWindows"] + + 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 ApiNumbersCardData 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 alert_suppression_windows (list) + _items = [] + if self.alert_suppression_windows: + for _item in self.alert_suppression_windows: + if _item: + _items.append(_item.to_dict()) + _dict['alertSuppressionWindows'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiNumbersCardData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cardId": obj.get("cardId"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "previousValue": obj.get("previousValue"), + "binSize": obj.get("binSize"), + "timestamp": obj.get("timestamp"), + "numberOfDataPoints": obj.get("numberOfDataPoints"), + "value": obj.get("value"), + "status": obj.get("status"), + "alertSuppressionWindows": [ApiDashboardAsw.from_dict(_item) for _item in obj.get("alertSuppressionWindows")] if obj.get("alertSuppressionWindows") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_numbers_card_widget.py b/dashboards_api/dashboards_api/models/api_numbers_card_widget.py new file mode 100644 index 00000000..76ec1991 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_numbers_card_widget.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_numbers_card import ApiNumbersCard +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.numbers_card_datasource import NumbersCardDatasource +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiNumbersCardWidget(BaseModel): + """ + A widget composed of multiple cards, each presenting a singular metric, such as average packet loss, page load time, or alert count. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + number_cards: Optional[List[ApiNumbersCard]] = Field(default=None, alias="numberCards") + data_source: Optional[NumbersCardDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "numberCards", "dataSource"] + + 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 ApiNumbersCardWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in number_cards (list) + _items = [] + if self.number_cards: + for _item in self.number_cards: + if _item: + _items.append(_item.to_dict()) + _dict['numberCards'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiNumbersCardWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "numberCards": [ApiNumbersCard.from_dict(_item) for _item in obj.get("numberCards")] if obj.get("numberCards") is not None else None, + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_pie_chart_widget.py b/dashboards_api/dashboards_api/models/api_pie_chart_widget.py new file mode 100644 index 00000000..a9543671 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_pie_chart_widget.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from dashboards_api.models.api_aggregate_property import ApiAggregateProperty +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.pie_chart_datasource import PieChartDatasource +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiPieChartWidget(BaseModel): + """ + Displays data as segments of a pie, with each slice representing a portion of the total value. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + group_by: Optional[ApiAggregateProperty] = Field(default=None, alias="groupBy") + data_source: Optional[PieChartDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "groupBy", "dataSource"] + + 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 ApiPieChartWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.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 ApiPieChartWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "groupBy": obj.get("groupBy"), + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_report_data_component_label_map.py b/dashboards_api/dashboards_api/models/api_report_data_component_label_map.py new file mode 100644 index 00000000..d82ee594 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_report_data_component_label_map.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.api_report_data_component_label_map_entry import ApiReportDataComponentLabelMapEntry +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiReportDataComponentLabelMap(BaseModel): + """ + Map of group labels. + """ # noqa: E501 + group_property: Optional[StrictStr] = Field(default=None, description="Defines the criterion used to aggregate data points under specific group values.", alias="groupProperty") + group_labels: Optional[List[ApiReportDataComponentLabelMapEntry]] = Field(default=None, description="List of group labels.", alias="groupLabels") + __properties: ClassVar[List[str]] = ["groupProperty", "groupLabels"] + + 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 ApiReportDataComponentLabelMap 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 group_labels (list) + _items = [] + if self.group_labels: + for _item in self.group_labels: + if _item: + _items.append(_item.to_dict()) + _dict['groupLabels'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiReportDataComponentLabelMap from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "groupProperty": obj.get("groupProperty"), + "groupLabels": [ApiReportDataComponentLabelMapEntry.from_dict(_item) for _item in obj.get("groupLabels")] if obj.get("groupLabels") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_report_data_component_label_map_entry.py b/dashboards_api/dashboards_api/models/api_report_data_component_label_map_entry.py new file mode 100644 index 00000000..f53f1ae5 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_report_data_component_label_map_entry.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 ApiReportDataComponentLabelMapEntry(BaseModel): + """ + Represents a mapping entry of a group label. + """ # noqa: E501 + group_id: Optional[StrictStr] = Field(default=None, description="Identifier of the group.", alias="groupId") + group_label: Optional[StrictStr] = Field(default=None, description="Label of the group.", alias="groupLabel") + __properties: ClassVar[List[str]] = ["groupId", "groupLabel"] + + 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 ApiReportDataComponentLabelMapEntry 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 ApiReportDataComponentLabelMapEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "groupId": obj.get("groupId"), + "groupLabel": obj.get("groupLabel") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_report_snapshot_time_span.py b/dashboards_api/dashboards_api/models/api_report_snapshot_time_span.py new file mode 100644 index 00000000..5ad64b24 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_report_snapshot_time_span.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiReportSnapshotTimeSpan(BaseModel): + """ + Time span of the dashboard snapshot. + """ # noqa: E501 + start: Optional[datetime] = Field(default=None, description="UTC start date of dashboard snapshot (ISO date-time format).") + duration: Optional[StrictInt] = Field(default=None, description="Duration of dashboard snapshot in seconds.") + __properties: ClassVar[List[str]] = ["start", "duration"] + + 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 ApiReportSnapshotTimeSpan 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 ApiReportSnapshotTimeSpan from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "start": obj.get("start"), + "duration": obj.get("duration") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_stacked_area_chart_widget.py b/dashboards_api/dashboards_api/models/api_stacked_area_chart_widget.py new file mode 100644 index 00000000..96a6518b --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_stacked_area_chart_widget.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from dashboards_api.models.api_aggregate_property import ApiAggregateProperty +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_widget_fixed_y_scale_prefix import ApiWidgetFixedYScalePrefix +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.stacked_area_chart_datasource import StackedAreaChartDatasource +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiStackedAreaChartWidget(BaseModel): + """ + Displays line plots over time, stacking quantities vertically to showcase cumulative data trends, similar to stacked bar charts. Ideal for visualizing changes in response times, error counts, and other metrics, revealing the progression of values across a timeline. Use this chart to replace stacked bar charts for temporal data analysis. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + min_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Mininum scale configured in the widget.", alias="minScale") + max_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum scale configured in the widget.", alias="maxScale") + unit: Optional[ApiWidgetFixedYScalePrefix] = None + group_by: Optional[ApiAggregateProperty] = Field(default=None, alias="groupBy") + data_source: Optional[StackedAreaChartDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "minScale", "maxScale", "unit", "groupBy", "dataSource"] + + 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 ApiStackedAreaChartWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.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 ApiStackedAreaChartWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "minScale": obj.get("minScale"), + "maxScale": obj.get("maxScale"), + "unit": obj.get("unit"), + "groupBy": obj.get("groupBy"), + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_stacked_barchart_widget.py b/dashboards_api/dashboards_api/models/api_stacked_barchart_widget.py new file mode 100644 index 00000000..6c51bd00 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_stacked_barchart_widget.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import Field +from dashboards_api.models.api_aggregate_property import ApiAggregateProperty +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.stacked_bar_chart_datasource import StackedBarChartDatasource +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_sort_direction import WidgetSortDirection +from dashboards_api.models.widget_sort_property import WidgetSortProperty +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiStackedBarchartWidget(BaseModel): + """ + ApiStackedBarchartWidget + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + axis_group_by: Optional[ApiAggregateProperty] = Field(default=None, alias="axisGroupBy") + sort_by: Optional[WidgetSortProperty] = Field(default=None, alias="sortBy") + sort_direction: Optional[WidgetSortDirection] = Field(default=None, alias="sortDirection") + limit: Optional[StrictInt] = Field(default=None, description="Limit configured in the widget.") + show_labels: Optional[StrictBool] = Field(default=None, alias="showLabels") + is_horizontal_bar_chart: Optional[StrictBool] = Field(default=None, description="Set to `true` to display bars horizontally in the widget.", alias="isHorizontalBarChart") + data_source: Optional[StackedBarChartDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "axisGroupBy", "sortBy", "sortDirection", "limit", "showLabels", "isHorizontalBarChart", "dataSource"] + + 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 ApiStackedBarchartWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.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 ApiStackedBarchartWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "axisGroupBy": obj.get("axisGroupBy"), + "sortBy": obj.get("sortBy"), + "sortDirection": obj.get("sortDirection"), + "limit": obj.get("limit"), + "showLabels": obj.get("showLabels"), + "isHorizontalBarChart": obj.get("isHorizontalBarChart"), + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_table_widget.py b/dashboards_api/dashboards_api/models/api_table_widget.py new file mode 100644 index 00000000..a4bcdd04 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_table_widget.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import Field +from dashboards_api.models.api_aggregate_property import ApiAggregateProperty +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.table_datasource import TableDatasource +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_sort_direction import WidgetSortDirection +from dashboards_api.models.widget_sort_property import WidgetSortProperty +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiTableWidget(BaseModel): + """ + Organizes data in rows and columns, with options to list by test, geographic location, data source, or aggregated categories. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + compare_to_previous_value: Optional[StrictBool] = Field(default=None, alias="compareToPreviousValue") + row_group_by: Optional[ApiAggregateProperty] = Field(default=None, alias="rowGroupBy") + column_group_by: Optional[ApiAggregateProperty] = Field(default=None, alias="columnGroupBy") + sort_by: Optional[WidgetSortProperty] = Field(default=None, alias="sortBy") + sort_direction: Optional[WidgetSortDirection] = Field(default=None, alias="sortDirection") + limit: Optional[StrictInt] = Field(default=None, description="Limit configured in the widget.") + data_source: Optional[TableDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "compareToPreviousValue", "rowGroupBy", "columnGroupBy", "sortBy", "sortDirection", "limit", "dataSource"] + + 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 ApiTableWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.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 ApiTableWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "compareToPreviousValue": obj.get("compareToPreviousValue"), + "rowGroupBy": obj.get("rowGroupBy"), + "columnGroupBy": obj.get("columnGroupBy"), + "sortBy": obj.get("sortBy"), + "sortDirection": obj.get("sortDirection"), + "limit": obj.get("limit"), + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_test_table_data.py b/dashboards_api/dashboards_api/models/api_test_table_data.py new file mode 100644 index 00000000..6e0fcc22 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_test_table_data.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, StrictInt, StrictStr +from pydantic import Field +from dashboards_api.models.api_test_table_graphlets_data import ApiTestTableGraphletsData +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiTestTableData(BaseModel): + """ + Data shown in a test table widget. + """ # noqa: E501 + test_id: Optional[StrictStr] = Field(default=None, description="Identifier of the test.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + target: Optional[StrictStr] = Field(default=None, description="Configured target of the test.") + test_type: Optional[StrictStr] = Field(default=None, description="Type of the test.", alias="testType") + alert_count: Optional[StrictInt] = Field(default=None, description="Number of active alerts of the test.", alias="alertCount") + is_shared: Optional[StrictBool] = Field(default=None, description="Set to `true` if test is shared, `false` otherwise.", alias="isShared") + graphlets: Optional[List[ApiTestTableGraphletsData]] = Field(default=None, description="List of time series points for test metrics in the last 12 hours.") + __properties: ClassVar[List[str]] = ["testId", "testName", "target", "testType", "alertCount", "isShared", "graphlets"] + + 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 ApiTestTableData 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 graphlets (list) + _items = [] + if self.graphlets: + for _item in self.graphlets: + if _item: + _items.append(_item.to_dict()) + _dict['graphlets'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiTestTableData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "target": obj.get("target"), + "testType": obj.get("testType"), + "alertCount": obj.get("alertCount"), + "isShared": obj.get("isShared"), + "graphlets": [ApiTestTableGraphletsData.from_dict(_item) for _item in obj.get("graphlets")] if obj.get("graphlets") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_test_table_graphlets_data.py b/dashboards_api/dashboards_api/models/api_test_table_graphlets_data.py new file mode 100644 index 00000000..df0de3ea --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_test_table_graphlets_data.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.api_graphlet_point import ApiGraphletPoint +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiTestTableGraphletsData(BaseModel): + """ + Information displayed within a mini-graph associated with a specific test in a table. + """ # noqa: E501 + metric: Optional[StrictStr] = Field(default=None, description="Name of the metric.") + test_id: Optional[StrictStr] = Field(default=None, description="Identifier of the test.", alias="testId") + points: Optional[List[ApiGraphletPoint]] = None + __properties: ClassVar[List[str]] = ["metric", "testId", "points"] + + 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 ApiTestTableGraphletsData 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 points (list) + _items = [] + if self.points: + for _item in self.points: + if _item: + _items.append(_item.to_dict()) + _dict['points'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiTestTableGraphletsData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "metric": obj.get("metric"), + "testId": obj.get("testId"), + "points": [ApiGraphletPoint.from_dict(_item) for _item in obj.get("points")] if obj.get("points") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_test_table_widget.py b/dashboards_api/dashboards_api/models/api_test_table_widget.py new file mode 100644 index 00000000..b1a62ba5 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_test_table_widget.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_widget_filter_api_test_table_filter_key import ApiWidgetFilterApiTestTableFilterKey +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.test_table_datasource import TestTableDatasource +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiTestTableWidget(BaseModel): + """ + Displays tests and statuses with options to sort and filter. It can be set to show only certain tests, like those with specific labels or failing tests. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + filter: Optional[ApiWidgetFilterApiTestTableFilterKey] = None + exclude: Optional[ApiWidgetFilterApiTestTableFilterKey] = None + data_source: Optional[TestTableDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "filter", "exclude", "dataSource"] + + 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 ApiTestTableWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of filter + if self.filter: + _dict['filter'] = self.filter.to_dict() + # override the default output from pydantic by calling `to_dict()` of exclude + if self.exclude: + _dict['exclude'] = self.exclude.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiTestTableWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "filter": ApiWidgetFilterApiTestTableFilterKey.from_dict(obj.get("filter")) if obj.get("filter") is not None else None, + "exclude": ApiWidgetFilterApiTestTableFilterKey.from_dict(obj.get("exclude")) if obj.get("exclude") is not None else None, + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_timeseries_widget.py b/dashboards_api/dashboards_api/models/api_timeseries_widget.py new file mode 100644 index 00000000..553b3ed7 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_timeseries_widget.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from dashboards_api.models.api_aggregate_property import ApiAggregateProperty +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_widget_fixed_y_scale_prefix import ApiWidgetFixedYScalePrefix +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.timeseries_datasource import TimeseriesDatasource +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiTimeseriesWidget(BaseModel): + """ + The Timeseries widget graphs data over time, with the chosen metric displayed on the vertical axis. vertical axis + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + min_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Mininum scale configured in the widget.", alias="minScale") + max_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum scale configured in the widget.", alias="maxScale") + unit: Optional[ApiWidgetFixedYScalePrefix] = None + show_timeseries_overall_baseline: Optional[StrictBool] = Field(default=None, description="Displays the overall baseline if set to `true`.", alias="showTimeseriesOverallBaseline") + group_by: Optional[ApiAggregateProperty] = Field(default=None, alias="groupBy") + is_timeseries_one_chart_per_line: Optional[StrictBool] = Field(default=None, description="Displays a separate chart for each line if set to `true`.", alias="isTimeseriesOneChartPerLine") + data_source: Optional[TimeseriesDatasource] = Field(default=None, alias="dataSource") + __properties: ClassVar[List[str]] = ["id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows", "_links", "minScale", "maxScale", "unit", "showTimeseriesOverallBaseline", "groupBy", "isTimeseriesOneChartPerLine", "dataSource"] + + 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 ApiTimeseriesWidget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.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 ApiTimeseriesWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "minScale": obj.get("minScale"), + "maxScale": obj.get("maxScale"), + "unit": obj.get("unit"), + "showTimeseriesOverallBaseline": obj.get("showTimeseriesOverallBaseline"), + "groupBy": obj.get("groupBy"), + "isTimeseriesOneChartPerLine": obj.get("isTimeseriesOneChartPerLine"), + "dataSource": obj.get("dataSource") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_widget.py b/dashboards_api/dashboards_api/models/api_widget.py new file mode 100644 index 00000000..7cf19471 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_widget.py @@ -0,0 +1,316 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.api_agent_status_widget import ApiAgentStatusWidget +from dashboards_api.models.api_alert_list_widget import ApiAlertListWidget +from dashboards_api.models.api_box_and_whiskers_widget import ApiBoxAndWhiskersWidget +from dashboards_api.models.api_color_grid_widget import ApiColorGridWidget +from dashboards_api.models.api_geo_map_widget import ApiGeoMapWidget +from dashboards_api.models.api_grouped_barchart_widget import ApiGroupedBarchartWidget +from dashboards_api.models.api_multi_metric_table_widget import ApiMultiMetricTableWidget +from dashboards_api.models.api_numbers_card_widget import ApiNumbersCardWidget +from dashboards_api.models.api_pie_chart_widget import ApiPieChartWidget +from dashboards_api.models.api_stacked_area_chart_widget import ApiStackedAreaChartWidget +from dashboards_api.models.api_stacked_barchart_widget import ApiStackedBarchartWidget +from dashboards_api.models.api_table_widget import ApiTableWidget +from dashboards_api.models.api_test_table_widget import ApiTestTableWidget +from dashboards_api.models.api_timeseries_widget import ApiTimeseriesWidget +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 + +APIWIDGET_ONE_OF_SCHEMAS = ["ApiAgentStatusWidget", "ApiAlertListWidget", "ApiBoxAndWhiskersWidget", "ApiColorGridWidget", "ApiGeoMapWidget", "ApiGroupedBarchartWidget", "ApiMultiMetricTableWidget", "ApiNumbersCardWidget", "ApiPieChartWidget", "ApiStackedAreaChartWidget", "ApiStackedBarchartWidget", "ApiTableWidget", "ApiTestTableWidget", "ApiTimeseriesWidget"] + +class ApiWidget(BaseModel): + """ + ApiWidget + """ + # data type: ApiAgentStatusWidget + oneof_schema_1_validator: Optional[ApiAgentStatusWidget] = None + # data type: ApiAlertListWidget + oneof_schema_2_validator: Optional[ApiAlertListWidget] = None + # data type: ApiBoxAndWhiskersWidget + oneof_schema_3_validator: Optional[ApiBoxAndWhiskersWidget] = None + # data type: ApiColorGridWidget + oneof_schema_4_validator: Optional[ApiColorGridWidget] = None + # data type: ApiGeoMapWidget + oneof_schema_5_validator: Optional[ApiGeoMapWidget] = None + # data type: ApiGroupedBarchartWidget + oneof_schema_6_validator: Optional[ApiGroupedBarchartWidget] = None + # data type: ApiMultiMetricTableWidget + oneof_schema_7_validator: Optional[ApiMultiMetricTableWidget] = None + # data type: ApiNumbersCardWidget + oneof_schema_8_validator: Optional[ApiNumbersCardWidget] = None + # data type: ApiPieChartWidget + oneof_schema_9_validator: Optional[ApiPieChartWidget] = None + # data type: ApiStackedAreaChartWidget + oneof_schema_10_validator: Optional[ApiStackedAreaChartWidget] = None + # data type: ApiStackedBarchartWidget + oneof_schema_11_validator: Optional[ApiStackedBarchartWidget] = None + # data type: ApiTableWidget + oneof_schema_12_validator: Optional[ApiTableWidget] = None + # data type: ApiTestTableWidget + oneof_schema_13_validator: Optional[ApiTestTableWidget] = None + # data type: ApiTimeseriesWidget + oneof_schema_14_validator: Optional[ApiTimeseriesWidget] = None + actual_instance: Optional[Union[ApiAgentStatusWidget, ApiAlertListWidget, ApiBoxAndWhiskersWidget, ApiColorGridWidget, ApiGeoMapWidget, ApiGroupedBarchartWidget, ApiMultiMetricTableWidget, ApiNumbersCardWidget, ApiPieChartWidget, ApiStackedAreaChartWidget, ApiStackedBarchartWidget, ApiTableWidget, ApiTestTableWidget, ApiTimeseriesWidget]] = None + one_of_schemas: List[str] = Literal["ApiAgentStatusWidget", "ApiAlertListWidget", "ApiBoxAndWhiskersWidget", "ApiColorGridWidget", "ApiGeoMapWidget", "ApiGroupedBarchartWidget", "ApiMultiMetricTableWidget", "ApiNumbersCardWidget", "ApiPieChartWidget", "ApiStackedAreaChartWidget", "ApiStackedBarchartWidget", "ApiTableWidget", "ApiTestTableWidget", "ApiTimeseriesWidget"] + + model_config = { + "validate_assignment": True + } + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = ApiWidget.model_construct() + error_messages = [] + match = 0 + # validate data type: ApiAgentStatusWidget + if not isinstance(v, ApiAgentStatusWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiAgentStatusWidget`") + else: + match += 1 + # validate data type: ApiAlertListWidget + if not isinstance(v, ApiAlertListWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiAlertListWidget`") + else: + match += 1 + # validate data type: ApiBoxAndWhiskersWidget + if not isinstance(v, ApiBoxAndWhiskersWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiBoxAndWhiskersWidget`") + else: + match += 1 + # validate data type: ApiColorGridWidget + if not isinstance(v, ApiColorGridWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiColorGridWidget`") + else: + match += 1 + # validate data type: ApiGeoMapWidget + if not isinstance(v, ApiGeoMapWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiGeoMapWidget`") + else: + match += 1 + # validate data type: ApiGroupedBarchartWidget + if not isinstance(v, ApiGroupedBarchartWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiGroupedBarchartWidget`") + else: + match += 1 + # validate data type: ApiMultiMetricTableWidget + if not isinstance(v, ApiMultiMetricTableWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiMultiMetricTableWidget`") + else: + match += 1 + # validate data type: ApiNumbersCardWidget + if not isinstance(v, ApiNumbersCardWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiNumbersCardWidget`") + else: + match += 1 + # validate data type: ApiPieChartWidget + if not isinstance(v, ApiPieChartWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiPieChartWidget`") + else: + match += 1 + # validate data type: ApiStackedAreaChartWidget + if not isinstance(v, ApiStackedAreaChartWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiStackedAreaChartWidget`") + else: + match += 1 + # validate data type: ApiStackedBarchartWidget + if not isinstance(v, ApiStackedBarchartWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiStackedBarchartWidget`") + else: + match += 1 + # validate data type: ApiTableWidget + if not isinstance(v, ApiTableWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiTableWidget`") + else: + match += 1 + # validate data type: ApiTestTableWidget + if not isinstance(v, ApiTestTableWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiTestTableWidget`") + else: + match += 1 + # validate data type: ApiTimeseriesWidget + if not isinstance(v, ApiTimeseriesWidget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApiTimeseriesWidget`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in ApiWidget with oneOf schemas: ApiAgentStatusWidget, ApiAlertListWidget, ApiBoxAndWhiskersWidget, ApiColorGridWidget, ApiGeoMapWidget, ApiGroupedBarchartWidget, ApiMultiMetricTableWidget, ApiNumbersCardWidget, ApiPieChartWidget, ApiStackedAreaChartWidget, ApiStackedBarchartWidget, ApiTableWidget, ApiTestTableWidget, ApiTimeseriesWidget. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in ApiWidget with oneOf schemas: ApiAgentStatusWidget, ApiAlertListWidget, ApiBoxAndWhiskersWidget, ApiColorGridWidget, ApiGeoMapWidget, ApiGroupedBarchartWidget, ApiMultiMetricTableWidget, ApiNumbersCardWidget, ApiPieChartWidget, ApiStackedAreaChartWidget, ApiStackedBarchartWidget, ApiTableWidget, ApiTestTableWidget, ApiTimeseriesWidget. 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 ApiAgentStatusWidget + try: + instance.actual_instance = ApiAgentStatusWidget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ApiAlertListWidget + try: + instance.actual_instance = ApiAlertListWidget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ApiBoxAndWhiskersWidget + try: + instance.actual_instance = ApiBoxAndWhiskersWidget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ApiColorGridWidget + try: + instance.actual_instance = ApiColorGridWidget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ApiGeoMapWidget + try: + instance.actual_instance = ApiGeoMapWidget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ApiGroupedBarchartWidget + try: + instance.actual_instance = ApiGroupedBarchartWidget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ApiMultiMetricTableWidget + try: + instance.actual_instance = ApiMultiMetricTableWidget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ApiNumbersCardWidget + try: + instance.actual_instance = ApiNumbersCardWidget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ApiPieChartWidget + try: + instance.actual_instance = ApiPieChartWidget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ApiStackedAreaChartWidget + try: + instance.actual_instance = ApiStackedAreaChartWidget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ApiStackedBarchartWidget + try: + instance.actual_instance = ApiStackedBarchartWidget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ApiTableWidget + try: + instance.actual_instance = ApiTableWidget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ApiTestTableWidget + try: + instance.actual_instance = ApiTestTableWidget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ApiTimeseriesWidget + try: + instance.actual_instance = ApiTimeseriesWidget.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 ApiWidget with oneOf schemas: ApiAgentStatusWidget, ApiAlertListWidget, ApiBoxAndWhiskersWidget, ApiColorGridWidget, ApiGeoMapWidget, ApiGroupedBarchartWidget, ApiMultiMetricTableWidget, ApiNumbersCardWidget, ApiPieChartWidget, ApiStackedAreaChartWidget, ApiStackedBarchartWidget, ApiTableWidget, ApiTestTableWidget, ApiTimeseriesWidget. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into ApiWidget with oneOf schemas: ApiAgentStatusWidget, ApiAlertListWidget, ApiBoxAndWhiskersWidget, ApiColorGridWidget, ApiGeoMapWidget, ApiGroupedBarchartWidget, ApiMultiMetricTableWidget, ApiNumbersCardWidget, ApiPieChartWidget, ApiStackedAreaChartWidget, ApiStackedBarchartWidget, ApiTableWidget, ApiTestTableWidget, ApiTimeseriesWidget. 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()) + + diff --git a/dashboards_api/dashboards_api/models/api_widget_data_point.py b/dashboards_api/dashboards_api/models/api_widget_data_point.py new file mode 100644 index 00000000..6f401d54 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_widget_data_point.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +from dashboards_api.models.api_data_point_group import ApiDataPointGroup +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiWidgetDataPoint(BaseModel): + """ + Data point of a widget. + """ # noqa: E501 + timestamp: Optional[StrictInt] = Field(default=None, description="Timestamp of the aggregated data point.") + number_of_data_points: Optional[StrictInt] = Field(default=None, description="Number of test data points aggregated into the widget data point.", alias="numberOfDataPoints") + value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Aggregated value.") + groups: Optional[List[ApiDataPointGroup]] = None + __properties: ClassVar[List[str]] = ["timestamp", "numberOfDataPoints", "value", "groups"] + + 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 ApiWidgetDataPoint 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 groups (list) + _items = [] + if self.groups: + for _item in self.groups: + if _item: + _items.append(_item.to_dict()) + _dict['groups'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiWidgetDataPoint from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "numberOfDataPoints": obj.get("numberOfDataPoints"), + "value": obj.get("value"), + "groups": [ApiDataPointGroup.from_dict(_item) for _item in obj.get("groups")] if obj.get("groups") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_widget_data_response.py b/dashboards_api/dashboards_api/models/api_widget_data_response.py new file mode 100644 index 00000000..59fa7d6e --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_widget_data_response.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +from pydantic import Field +from dashboards_api.models.api_report_data_component_label_map import ApiReportDataComponentLabelMap +from dashboards_api.models.api_widgets_data_v2 import ApiWidgetsDataV2 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiWidgetDataResponse(BaseModel): + """ + Response of a widget data request. + """ # noqa: E501 + group_labels: Optional[List[ApiReportDataComponentLabelMap]] = Field(default=None, alias="groupLabels") + bin_size: Optional[StrictInt] = Field(default=None, description="Duration of each bin.", alias="binSize") + data: Optional[ApiWidgetsDataV2] = None + __properties: ClassVar[List[str]] = ["groupLabels", "binSize", "data"] + + 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 ApiWidgetDataResponse 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 group_labels (list) + _items = [] + if self.group_labels: + for _item in self.group_labels: + if _item: + _items.append(_item.to_dict()) + _dict['groupLabels'] = _items + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiWidgetDataResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "groupLabels": [ApiReportDataComponentLabelMap.from_dict(_item) for _item in obj.get("groupLabels")] if obj.get("groupLabels") is not None else None, + "binSize": obj.get("binSize"), + "data": ApiWidgetsDataV2.from_dict(obj.get("data")) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_widget_filter_api_test_table_filter_key.py b/dashboards_api/dashboards_api/models/api_widget_filter_api_test_table_filter_key.py new file mode 100644 index 00000000..f30e6bf0 --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_widget_filter_api_test_table_filter_key.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.api_multi_search_filter_api_test_table_filter_key import ApiMultiSearchFilterApiTestTableFilterKey +from dashboards_api.models.test_table_filter_type import TestTableFilterType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiWidgetFilterApiTestTableFilterKey(BaseModel): + """ + ApiWidgetFilterApiTestTableFilterKey + """ # noqa: E501 + filters: Optional[List[ApiMultiSearchFilterApiTestTableFilterKey]] = None + type: Optional[TestTableFilterType] = None + __properties: ClassVar[List[str]] = ["filters", "type"] + + 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 ApiWidgetFilterApiTestTableFilterKey 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 filters (list) + _items = [] + if self.filters: + for _item in self.filters: + if _item: + _items.append(_item.to_dict()) + _dict['filters'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiWidgetFilterApiTestTableFilterKey from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "filters": [ApiMultiSearchFilterApiTestTableFilterKey.from_dict(_item) for _item in obj.get("filters")] if obj.get("filters") is not None else None, + "type": obj.get("type") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_widget_fixed_y_scale_prefix.py b/dashboards_api/dashboards_api/models/api_widget_fixed_y_scale_prefix.py new file mode 100644 index 00000000..370951dd --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_widget_fixed_y_scale_prefix.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 ApiWidgetFixedYScalePrefix(str, Enum): + """ + Prefix denoting the unit of measurement for the fixed Y-axis scale. + """ + + """ + allowed enum values + """ + KBPS = 'Kbps' + MBPS = 'Mbps' + GBPS = 'Gbps' + KPPS = 'Kpps' + MPPS = 'Mpps' + GPPS = 'Gpps' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ApiWidgetFixedYScalePrefix from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/api_widget_measure.py b/dashboards_api/dashboards_api/models/api_widget_measure.py new file mode 100644 index 00000000..3f30006c --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_widget_measure.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +from dashboards_api.models.widget_measure_type import WidgetMeasureType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiWidgetMeasure(BaseModel): + """ + Determines how to aggregate the the metric. + """ # noqa: E501 + type: Optional[WidgetMeasureType] = None + percentile_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The percentile value to use when `type == NTH_PERCENTILE`.", alias="percentileValue") + __properties: ClassVar[List[str]] = ["type", "percentileValue"] + + 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 ApiWidgetMeasure 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 ApiWidgetMeasure 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"), + "percentileValue": obj.get("percentileValue") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/api_widgets_data_v2.py b/dashboards_api/dashboards_api/models/api_widgets_data_v2.py new file mode 100644 index 00000000..8baccdee --- /dev/null +++ b/dashboards_api/dashboards_api/models/api_widgets_data_v2.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +from dashboards_api.models.api_agent_status_agent import ApiAgentStatusAgent +from dashboards_api.models.api_agent_status_summary import ApiAgentStatusSummary +from dashboards_api.models.api_alert_list_alert import ApiAlertListAlert +from dashboards_api.models.api_dashboard_asw import ApiDashboardAsw +from dashboards_api.models.api_multi_metric_column_data import ApiMultiMetricColumnData +from dashboards_api.models.api_numbers_card_data import ApiNumbersCardData +from dashboards_api.models.api_test_table_data import ApiTestTableData +from dashboards_api.models.api_widget_data_point import ApiWidgetDataPoint +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiWidgetsDataV2(BaseModel): + """ + Data of a widget. + """ # noqa: E501 + cards: Optional[List[ApiNumbersCardData]] = None + columns: Optional[List[ApiMultiMetricColumnData]] = None + points: Optional[List[ApiWidgetDataPoint]] = None + tests: Optional[List[ApiTestTableData]] = None + start_round: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="startRound") + alert_suppression_windows: Optional[List[ApiDashboardAsw]] = Field(default=None, alias="alertSuppressionWindows") + total_alerts: Optional[StrictInt] = Field(default=None, description="Total number of active alerts within configured timespan.", alias="totalAlerts") + active_alerts: Optional[StrictInt] = Field(default=None, description="Total number of currently active alerts.", alias="activeAlerts") + alerts: Optional[List[ApiAlertListAlert]] = None + summary: Optional[ApiAgentStatusSummary] = None + agents: Optional[List[ApiAgentStatusAgent]] = None + status: Optional[StrictStr] = Field(default=None, description="Message for not fully configured card or no data.") + __properties: ClassVar[List[str]] = ["cards", "columns", "points", "tests", "startRound", "alertSuppressionWindows", "totalAlerts", "activeAlerts", "alerts", "summary", "agents", "status"] + + 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 ApiWidgetsDataV2 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 cards (list) + _items = [] + if self.cards: + for _item in self.cards: + if _item: + _items.append(_item.to_dict()) + _dict['cards'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in columns (list) + _items = [] + if self.columns: + for _item in self.columns: + if _item: + _items.append(_item.to_dict()) + _dict['columns'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in points (list) + _items = [] + if self.points: + for _item in self.points: + if _item: + _items.append(_item.to_dict()) + _dict['points'] = _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 alert_suppression_windows (list) + _items = [] + if self.alert_suppression_windows: + for _item in self.alert_suppression_windows: + if _item: + _items.append(_item.to_dict()) + _dict['alertSuppressionWindows'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in alerts (list) + _items = [] + if self.alerts: + for _item in self.alerts: + if _item: + _items.append(_item.to_dict()) + _dict['alerts'] = _items + # override the default output from pydantic by calling `to_dict()` of summary + if self.summary: + _dict['summary'] = self.summary.to_dict() + # 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 ApiWidgetsDataV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cards": [ApiNumbersCardData.from_dict(_item) for _item in obj.get("cards")] if obj.get("cards") is not None else None, + "columns": [ApiMultiMetricColumnData.from_dict(_item) for _item in obj.get("columns")] if obj.get("columns") is not None else None, + "points": [ApiWidgetDataPoint.from_dict(_item) for _item in obj.get("points")] if obj.get("points") is not None else None, + "tests": [ApiTestTableData.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "startRound": obj.get("startRound"), + "alertSuppressionWindows": [ApiDashboardAsw.from_dict(_item) for _item in obj.get("alertSuppressionWindows")] if obj.get("alertSuppressionWindows") is not None else None, + "totalAlerts": obj.get("totalAlerts"), + "activeAlerts": obj.get("activeAlerts"), + "alerts": [ApiAlertListAlert.from_dict(_item) for _item in obj.get("alerts")] if obj.get("alerts") is not None else None, + "summary": ApiAgentStatusSummary.from_dict(obj.get("summary")) if obj.get("summary") is not None else None, + "agents": [ApiAgentStatusAgent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "status": obj.get("status") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/asw_repeat.py b/dashboards_api/dashboards_api/models/asw_repeat.py new file mode 100644 index 00000000..d76e8414 --- /dev/null +++ b/dashboards_api/dashboards_api/models/asw_repeat.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 AswRepeat(str, Enum): + """ + AswRepeat + """ + + """ + allowed enum values + """ + NONE = 'none' + EVERY_MINUS_DAY = 'every-day' + ALT_MINUS_EVERY_MINUS_DAY = 'alt-every-day' + EVERY_MINUS_WEEK = 'every-week' + EVERY_MINUS_TWO_MINUS_WEEK = 'every-two-week' + EVERY_MINUS_MONTH = 'every-month' + EVERY_MINUS_THREE_MINUS_MONTH = 'every-three-month' + CUSTOM = 'custom' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AswRepeat from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/asw_repeat_unit.py b/dashboards_api/dashboards_api/models/asw_repeat_unit.py new file mode 100644 index 00000000..1a1d6b8d --- /dev/null +++ b/dashboards_api/dashboards_api/models/asw_repeat_unit.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 AswRepeatUnit(str, Enum): + """ + AswRepeatUnit + """ + + """ + allowed enum values + """ + DAY = 'day' + WEEK = 'week' + MONTH = 'month' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AswRepeatUnit from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/box_and_whiskers_datasource.py b/dashboards_api/dashboards_api/models/box_and_whiskers_datasource.py new file mode 100644 index 00000000..05046fac --- /dev/null +++ b/dashboards_api/dashboards_api/models/box_and_whiskers_datasource.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 BoxAndWhiskersDatasource(str, Enum): + """ + Datasource of the box and whiskers widget. + """ + + """ + allowed enum values + """ + ALERTS = 'ALERTS' + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + DEVICES = 'DEVICES' + ENDPOINT_AST_TEST = 'ENDPOINT_AST_TEST' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_LOCAL_NETWORK = 'ENDPOINT_LOCAL_NETWORK' + ENDPOINT_LOCAL_NETWORK_WIRELESS = 'ENDPOINT_LOCAL_NETWORK_WIRELESS' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' + ROUTING = 'ROUTING' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of BoxAndWhiskersDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/color_grid_datasource.py b/dashboards_api/dashboards_api/models/color_grid_datasource.py new file mode 100644 index 00000000..6d53ccff --- /dev/null +++ b/dashboards_api/dashboards_api/models/color_grid_datasource.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 ColorGridDatasource(str, Enum): + """ + Datasource of the color grid widget. + """ + + """ + allowed enum values + """ + THIRD_PARTY_APPLICATIONS = 'THIRD_PARTY_APPLICATIONS' + ALERTS = 'ALERTS' + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + DEVICES = 'DEVICES' + ENDPOINT_AST_TEST = 'ENDPOINT_AST_TEST' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_LOCAL_NETWORK = 'ENDPOINT_LOCAL_NETWORK' + ENDPOINT_LOCAL_NETWORK_WIRELESS = 'ENDPOINT_LOCAL_NETWORK_WIRELESS' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' + ROUTING = 'ROUTING' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ColorGridDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/dashboard_links.py b/dashboards_api/dashboards_api/models/dashboard_links.py new file mode 100644 index 00000000..c55e7982 --- /dev/null +++ b/dashboards_api/dashboards_api/models/dashboard_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.dashboard_links_links import DashboardLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DashboardLinks(BaseModel): + """ + A links object containing the self and the snapshots links. + """ # noqa: E501 + links: Optional[DashboardLinksLinks] = 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 DashboardLinks 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 DashboardLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": DashboardLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/dashboard_links_links.py b/dashboards_api/dashboards_api/models/dashboard_links_links.py new file mode 100644 index 00000000..dfeba751 --- /dev/null +++ b/dashboards_api/dashboards_api/models/dashboard_links_links.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DashboardLinksLinks(BaseModel): + """ + DashboardLinksLinks + """ # noqa: E501 + var_self: Optional[Link] = Field(default=None, alias="self") + snapshots: Optional[Link] = None + __properties: ClassVar[List[str]] = ["self", "snapshots"] + + 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 DashboardLinksLinks 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 snapshots + if self.snapshots: + _dict['snapshots'] = self.snapshots.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DashboardLinksLinks 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, + "snapshots": Link.from_dict(obj.get("snapshots")) if obj.get("snapshots") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/dashboard_metric.py b/dashboards_api/dashboards_api/models/dashboard_metric.py new file mode 100644 index 00000000..e5a98d2a --- /dev/null +++ b/dashboards_api/dashboards_api/models/dashboard_metric.py @@ -0,0 +1,247 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 DashboardMetric(str, Enum): + """ + Indicates the specific metric in the report, determined by the layer, test type, and metric values. + """ + + """ + allowed enum values + """ + ONE_WAY_NET_LOSS_TO_TARGET = 'ONE_WAY_NET_LOSS_TO_TARGET' + ONE_WAY_NET_LATENCY_TO_TARGET = 'ONE_WAY_NET_LATENCY_TO_TARGET' + ONE_WAY_NET_JITTER_TO_TARGET = 'ONE_WAY_NET_JITTER_TO_TARGET' + ONE_WAY_NET_THROUGHPUT_TO_TARGET = 'ONE_WAY_NET_THROUGHPUT_TO_TARGET' + ONE_WAY_NET_ERROR_TO_TARGET = 'ONE_WAY_NET_ERROR_TO_TARGET' + ONE_WAY_NET_LOSS_FROM_TARGET = 'ONE_WAY_NET_LOSS_FROM_TARGET' + ONE_WAY_NET_LATENCY_FROM_TARGET = 'ONE_WAY_NET_LATENCY_FROM_TARGET' + ONE_WAY_NET_JITTER_FROM_TARGET = 'ONE_WAY_NET_JITTER_FROM_TARGET' + ONE_WAY_NET_THROUGHPUT_FROM_TARGET = 'ONE_WAY_NET_THROUGHPUT_FROM_TARGET' + ONE_WAY_NET_ERROR_FROM_TARGET = 'ONE_WAY_NET_ERROR_FROM_TARGET' + ONE_WAY_NET_LOSS_BIDIRECTIONAL = 'ONE_WAY_NET_LOSS_BIDIRECTIONAL' + ONE_WAY_NET_LATENCY_BIDIRECTIONAL = 'ONE_WAY_NET_LATENCY_BIDIRECTIONAL' + ONE_WAY_NET_JITTER_BIDIRECTIONAL = 'ONE_WAY_NET_JITTER_BIDIRECTIONAL' + ONE_WAY_NET_THROUGHPUT_BIDIRECTIONAL = 'ONE_WAY_NET_THROUGHPUT_BIDIRECTIONAL' + ONE_WAY_NET_ERROR_BIDIRECTIONAL = 'ONE_WAY_NET_ERROR_BIDIRECTIONAL' + NET_LOSS = 'NET_LOSS' + NET_LATENCY = 'NET_LATENCY' + NET_JITTER = 'NET_JITTER' + NET_BANDWIDTH = 'NET_BANDWIDTH' + NET_CAPACITY = 'NET_CAPACITY' + PROXY_NET_LOSS = 'PROXY_NET_LOSS' + PROXY_NET_LATENCY = 'PROXY_NET_LATENCY' + PROXY_NET_JITTER = 'PROXY_NET_JITTER' + WEB_AVAILABILITY = 'WEB_AVAILABILITY' + WEB_THROUGHPUT = 'WEB_THROUGHPUT' + WEB_DNS = 'WEB_DNS' + WEB_CONNECT = 'WEB_CONNECT' + WEB_SSL = 'WEB_SSL' + WEB_WAIT = 'WEB_WAIT' + WEB_TTFB = 'WEB_TTFB' + WEB_RECEIVE = 'WEB_RECEIVE' + WEB_REDIRECT = 'WEB_REDIRECT' + WEB_FETCH = 'WEB_FETCH' + WEB_AUTHENTICATION_ERROR_COUNT = 'WEB_AUTHENTICATION_ERROR_COUNT' + WEB_DNS_ERROR_COUNT = 'WEB_DNS_ERROR_COUNT' + WEB_CONNECT_ERROR_COUNT = 'WEB_CONNECT_ERROR_COUNT' + WEB_SSL_ERROR_COUNT = 'WEB_SSL_ERROR_COUNT' + WEB_SEND_ERROR_COUNT = 'WEB_SEND_ERROR_COUNT' + WEB_RECEIVE_ERROR_COUNT = 'WEB_RECEIVE_ERROR_COUNT' + WEB_HTTP_ERROR_COUNT = 'WEB_HTTP_ERROR_COUNT' + WEB_CONTENT_ERROR_COUNT = 'WEB_CONTENT_ERROR_COUNT' + WEB_TOTAL_ERROR_COUNT = 'WEB_TOTAL_ERROR_COUNT' + FTP_AVAILABILITY = 'FTP_AVAILABILITY' + FTP_THROUGHPUT = 'FTP_THROUGHPUT' + FTP_DNS = 'FTP_DNS' + FTP_CONNECT = 'FTP_CONNECT' + FTP_SSL = 'FTP_SSL' + FTP_NEGOTIATION = 'FTP_NEGOTIATION' + FTP_WAIT = 'FTP_WAIT' + FTP_TTFB = 'FTP_TTFB' + FTP_TRANSFER = 'FTP_TRANSFER' + FTP_TOTAL = 'FTP_TOTAL' + FTP_DNS_ERROR_COUNT = 'FTP_DNS_ERROR_COUNT' + FTP_CONNECT_ERROR_COUNT = 'FTP_CONNECT_ERROR_COUNT' + FTP_SSL_ERROR_COUNT = 'FTP_SSL_ERROR_COUNT' + FTP_NEGOTIATION_ERROR_COUNT = 'FTP_NEGOTIATION_ERROR_COUNT' + FTP_TRANSFER_ERROR_COUNT = 'FTP_TRANSFER_ERROR_COUNT' + FTP_FTP_ERROR_COUNT = 'FTP_FTP_ERROR_COUNT' + FTP_CONTENT_ERROR_COUNT = 'FTP_CONTENT_ERROR_COUNT' + FTP_TOTAL_ERROR_COUNT = 'FTP_TOTAL_ERROR_COUNT' + WEB_PAGE_LOAD_DOM_TIME = 'WEB_PAGE_LOAD_DOM_TIME' + WEB_PAGE_LOAD = 'WEB_PAGE_LOAD' + WEB_PAGE_TTFB = 'WEB_PAGE_TTFB' + WEB_PAGE_COMPONENT_COUNT = 'WEB_PAGE_COMPONENT_COUNT' + WEB_PAGE_ERROR_COUNT = 'WEB_PAGE_ERROR_COUNT' + WEB_PAGE_LOAD_COMPLETION_RATE = 'WEB_PAGE_LOAD_COMPLETION_RATE' + CLASSIC_TRANSACTION_TIME = 'CLASSIC_TRANSACTION_TIME' + CLASSIC_TRANSACTION_COMPLETION = 'CLASSIC_TRANSACTION_COMPLETION' + CLASSIC_TRANSACTION_STEP_TIME = 'CLASSIC_TRANSACTION_STEP_TIME' + CLASSIC_TRANSACTION_PAGE_TIME = 'CLASSIC_TRANSACTION_PAGE_TIME' + TRANSACTION_MARKER_TIME_DECOMPOSED = 'TRANSACTION_MARKER_TIME_DECOMPOSED' + TRANSACTION_PAGE_LOAD_TIME_DECOMPOSED = 'TRANSACTION_PAGE_LOAD_TIME_DECOMPOSED' + TRANSACTION_PAGE_TIME_DECOMPOSED = 'TRANSACTION_PAGE_TIME_DECOMPOSED' + TRANSACTION_PAGE_LOAD_DOM_TIME_DECOMPOSED = 'TRANSACTION_PAGE_LOAD_DOM_TIME_DECOMPOSED' + TRANSACTION_TIME = 'TRANSACTION_TIME' + TRANSACTION_TIMEOUT = 'TRANSACTION_TIMEOUT' + TRANSACTION_ASSERT_ERROR = 'TRANSACTION_ASSERT_ERROR' + TRANSACTION_OTHER_ERROR = 'TRANSACTION_OTHER_ERROR' + TRANSACTION_PAGE_ERROR = 'TRANSACTION_PAGE_ERROR' + TRANSACTION_COMPLETION = 'TRANSACTION_COMPLETION' + TRANSACTION_ERROR = 'TRANSACTION_ERROR' + TRANSACTION_MARKER_TIME = 'TRANSACTION_MARKER_TIME' + TRANSACTION_PAGE_TIME = 'TRANSACTION_PAGE_TIME' + TRANSACTION_PAGE_LOAD_TIME = 'TRANSACTION_PAGE_LOAD_TIME' + TRANSACTION_PAGE_LOAD_DOM_TIME = 'TRANSACTION_PAGE_LOAD_DOM_TIME' + VOIP_DISCARDS = 'VOIP_DISCARDS' + VOIP_LATENCY = 'VOIP_LATENCY' + VOIP_LOSS = 'VOIP_LOSS' + VOIP_MOS = 'VOIP_MOS' + VOIP_PDV = 'VOIP_PDV' + SIP_AVAILABILITY = 'SIP_AVAILABILITY' + SIP_DNS = 'SIP_DNS' + SIP_CONNECT = 'SIP_CONNECT' + SIP_REDIRECT = 'SIP_REDIRECT' + SIP_REGISTER = 'SIP_REGISTER' + SIP_OPTIONS = 'SIP_OPTIONS' + SIP_INVITE = 'SIP_INVITE' + SIP_WAIT = 'SIP_WAIT' + SIP_RESPONSE_TIME = 'SIP_RESPONSE_TIME' + SIP_TOTAL_TIME = 'SIP_TOTAL_TIME' + SIP_DNS_ERROR_COUNT = 'SIP_DNS_ERROR_COUNT' + SIP_CONNECT_ERROR_COUNT = 'SIP_CONNECT_ERROR_COUNT' + SIP_REGISTER_ERROR_COUNT = 'SIP_REGISTER_ERROR_COUNT' + SIP_OPTIONS_ERROR_COUNT = 'SIP_OPTIONS_ERROR_COUNT' + SIP_INVITE_ERROR_COUNT = 'SIP_INVITE_ERROR_COUNT' + SIP_TOTAL_ERROR_COUNT = 'SIP_TOTAL_ERROR_COUNT' + DNS_SERVER_AVAILABILITY = 'DNS_SERVER_AVAILABILITY' + DNS_SERVER_TIME = 'DNS_SERVER_TIME' + DNS_TRACE_AVAILABILITY = 'DNS_TRACE_AVAILABILITY' + DNS_TRACE_QUERY_COUNT = 'DNS_TRACE_QUERY_COUNT' + DNS_TRACE_QUERY_TIME = 'DNS_TRACE_QUERY_TIME' + DNSSEC_VALIDITY = 'DNSSEC_VALIDITY' + DNSP_AVAILABILITY = 'DNSP_AVAILABILITY' + DNSP_TIME = 'DNSP_TIME' + DNSP_SERVER_TIME = 'DNSP_SERVER_TIME' + BGP_REACHABILITY = 'BGP_REACHABILITY' + BGP_PATH_CHANGES = 'BGP_PATH_CHANGES' + ALERT_COUNT = 'ALERT_COUNT' + ALERT_COUNT_AGENT = 'ALERT_COUNT_AGENT' + ALERT_COUNT_BGP = 'ALERT_COUNT_BGP' + ALERT_COUNT_DNSP = 'ALERT_COUNT_DNSP' + ENDPOINT_SAMPLE_COUNT = 'ENDPOINT_SAMPLE_COUNT' + ENDPOINT_NET_LOSS = 'ENDPOINT_NET_LOSS' + ENDPOINT_NET_LATENCY = 'ENDPOINT_NET_LATENCY' + ENDPOINT_NET_JITTER = 'ENDPOINT_NET_JITTER' + ENDPOINT_NET_CONNECT_FAILURES = 'ENDPOINT_NET_CONNECT_FAILURES' + ENDPOINT_NET_CPU_LOAD_PERCENT = 'ENDPOINT_NET_CPU_LOAD_PERCENT' + ENDPOINT_NET_MEMORY_LOAD_PERCENT = 'ENDPOINT_NET_MEMORY_LOAD_PERCENT' + ENDPOINT_NET_VPN_LOSS = 'ENDPOINT_NET_VPN_LOSS' + ENDPOINT_NET_VPN_LATENCY = 'ENDPOINT_NET_VPN_LATENCY' + ENDPOINT_PAGE_COUNT = 'ENDPOINT_PAGE_COUNT' + ENDPOINT_WEB_COMPLETION = 'ENDPOINT_WEB_COMPLETION' + ENDPOINT_WEB_RESPONSE_TIME = 'ENDPOINT_WEB_RESPONSE_TIME' + ENDPOINT_WEB_PAGE_LOAD = 'ENDPOINT_WEB_PAGE_LOAD' + ENDPOINT_WEB_PAGE_LOAD_DOM_TIME = 'ENDPOINT_WEB_PAGE_LOAD_DOM_TIME' + ENDPOINT_WEB_EXPERIENCE_SCORE = 'ENDPOINT_WEB_EXPERIENCE_SCORE' + ENDPOINT_WEB_BROWSER_ERROR_COUNT = 'ENDPOINT_WEB_BROWSER_ERROR_COUNT' + ENDPOINT_GATEWAY_PROBE_COUNT = 'ENDPOINT_GATEWAY_PROBE_COUNT' + ENDPOINT_GATEWAY_COMBINED_TRANSMISSION_RATE = 'ENDPOINT_GATEWAY_COMBINED_TRANSMISSION_RATE' + ENDPOINT_GATEWAY_SIGNAL_QUALITY = 'ENDPOINT_GATEWAY_SIGNAL_QUALITY' + ENDPOINT_GATEWAY_LOSS = 'ENDPOINT_GATEWAY_LOSS' + ENDPOINT_GATEWAY_LATENCY = 'ENDPOINT_GATEWAY_LATENCY' + ENDPOINT_GATEWAY_PROXY_LOSS = 'ENDPOINT_GATEWAY_PROXY_LOSS' + ENDPOINT_GATEWAY_PROXY_LATENCY = 'ENDPOINT_GATEWAY_PROXY_LATENCY' + ENDPOINT_GATEWAY_VPN_LOSS = 'ENDPOINT_GATEWAY_VPN_LOSS' + ENDPOINT_GATEWAY_VPN_LATENCY = 'ENDPOINT_GATEWAY_VPN_LATENCY' + ENDPOINT_GATEWAY_DNS_LOSS = 'ENDPOINT_GATEWAY_DNS_LOSS' + ENDPOINT_GATEWAY_DNS_LATENCY = 'ENDPOINT_GATEWAY_DNS_LATENCY' + ENDPOINT_GATEWAY_DNS_TIME = 'ENDPOINT_GATEWAY_DNS_TIME' + ENDPOINT_GATEWAY_CPU_LOAD_PERCENT = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT' + ENDPOINT_GATEWAY_MEMORY_LOAD_PERCENT = 'ENDPOINT_GATEWAY_MEMORY_LOAD_PERCENT' + EYEBROW_GATEWAY_WIRELESS_CHANNEL_SWAP_EVENTS = 'EYEBROW_GATEWAY_WIRELESS_CHANNEL_SWAP_EVENTS' + EYEBROW_GATEWAY_WIRELESS_RETRANSMISSION_RATE = 'EYEBROW_GATEWAY_WIRELESS_RETRANSMISSION_RATE' + EYEBROW_GATEWAY_WIRELESS_ROAMING_EVENTS = 'EYEBROW_GATEWAY_WIRELESS_ROAMING_EVENTS' + EYEBROW_GATEWAY_WIRELESS_SIGNAL_QUALITY = 'EYEBROW_GATEWAY_WIRELESS_SIGNAL_QUALITY' + EYEBROW_GATEWAY_WIRELESS_THROUGHPUT = 'EYEBROW_GATEWAY_WIRELESS_THROUGHPUT' + ENDPOINT_AST_TEST_NET_LOSS = 'ENDPOINT_AST_TEST_NET_LOSS' + ENDPOINT_AST_TEST_NET_JITTER = 'ENDPOINT_AST_TEST_NET_JITTER' + ENDPOINT_AST_TEST_NET_LATENCY = 'ENDPOINT_AST_TEST_NET_LATENCY' + ENDPOINT_AST_TEST_NET_CPU_LOAD_PERCENT = 'ENDPOINT_AST_TEST_NET_CPU_LOAD_PERCENT' + ENDPOINT_AST_TEST_NET_MEMORY_LOAD_PERCENT = 'ENDPOINT_AST_TEST_NET_MEMORY_LOAD_PERCENT' + ENDPOINT_AST_TEST_VPN_LOSS = 'ENDPOINT_AST_TEST_VPN_LOSS' + ENDPOINT_AST_TEST_VPN_LATENCY = 'ENDPOINT_AST_TEST_VPN_LATENCY' + ENDPOINT_AST_TEST_TCP_CONNECTION_ERROR_COUNT = 'ENDPOINT_AST_TEST_TCP_CONNECTION_ERROR_COUNT' + ENDPOINT_GATEWAY_WIRELESS_CHANNEL_SWAP_EVENTS = 'ENDPOINT_GATEWAY_WIRELESS_CHANNEL_SWAP_EVENTS' + ENDPOINT_GATEWAY_WIRELESS_RETRANSMISSION_RATE = 'ENDPOINT_GATEWAY_WIRELESS_RETRANSMISSION_RATE' + ENDPOINT_GATEWAY_WIRELESS_ROAMING_EVENTS = 'ENDPOINT_GATEWAY_WIRELESS_ROAMING_EVENTS' + ENDPOINT_GATEWAY_WIRELESS_SIGNAL_QUALITY = 'ENDPOINT_GATEWAY_WIRELESS_SIGNAL_QUALITY' + ENDPOINT_GATEWAY_WIRELESS_THROUGHPUT = 'ENDPOINT_GATEWAY_WIRELESS_THROUGHPUT' + ENDPOINT_TEST_NET_LOSS = 'ENDPOINT_TEST_NET_LOSS' + ENDPOINT_TEST_NET_JITTER = 'ENDPOINT_TEST_NET_JITTER' + ENDPOINT_TEST_NET_LATENCY = 'ENDPOINT_TEST_NET_LATENCY' + ENDPOINT_TEST_NET_CPU_LOAD_PERCENT = 'ENDPOINT_TEST_NET_CPU_LOAD_PERCENT' + ENDPOINT_TEST_NET_MEMORY_LOAD_PERCENT = 'ENDPOINT_TEST_NET_MEMORY_LOAD_PERCENT' + ENDPOINT_TEST_VPN_LOSS = 'ENDPOINT_TEST_VPN_LOSS' + ENDPOINT_TEST_VPN_LATENCY = 'ENDPOINT_TEST_VPN_LATENCY' + ENDPOINT_TEST_TCP_CONNECTION_ERROR_COUNT = 'ENDPOINT_TEST_TCP_CONNECTION_ERROR_COUNT' + ENDPOINT_TEST_HTTP_AVAILABILITY = 'ENDPOINT_TEST_HTTP_AVAILABILITY' + ENDPOINT_TEST_HTTP_WAIT = 'ENDPOINT_TEST_HTTP_WAIT' + ENDPOINT_TEST_HTTP_SSL = 'ENDPOINT_TEST_HTTP_SSL' + ENDPOINT_TEST_HTTP_CONNECT = 'ENDPOINT_TEST_HTTP_CONNECT' + ENDPOINT_TEST_HTTP_DNS_LOOKUP = 'ENDPOINT_TEST_HTTP_DNS_LOOKUP' + ENDPOINT_TEST_HTTP_RESPONSE_TIME = 'ENDPOINT_TEST_HTTP_RESPONSE_TIME' + ENDPOINT_TEST_HTTP_THROUGHPUT = 'ENDPOINT_TEST_HTTP_THROUGHPUT' + DEVICE_AVAILABILITY = 'DEVICE_AVAILABILITY' + DEVICE_THROUGHPUT_INPUT = 'DEVICE_THROUGHPUT_INPUT' + DEVICE_THROUGHPUT_OUTPUT = 'DEVICE_THROUGHPUT_OUTPUT' + DEVICE_DISCARDS_INPUT = 'DEVICE_DISCARDS_INPUT' + DEVICE_DISCARDS_OUTPUT = 'DEVICE_DISCARDS_OUTPUT' + DEVICE_ERRORS_INPUT = 'DEVICE_ERRORS_INPUT' + DEVICE_ERRORS_OUTPUT = 'DEVICE_ERRORS_OUTPUT' + DEVICE_DISCARDS_AND_ERRORS_INPUT = 'DEVICE_DISCARDS_AND_ERRORS_INPUT' + DEVICE_DISCARDS_AND_ERRORS_OUTPUT = 'DEVICE_DISCARDS_AND_ERRORS_OUTPUT' + DEVICE_INTERFACES_UP = 'DEVICE_INTERFACES_UP' + DEVICE_INTERFACES_WITH_STATE_CHANGES = 'DEVICE_INTERFACES_WITH_STATE_CHANGES' + NETWORK_OUTAGES_OUTAGES = 'NETWORK_OUTAGES_OUTAGES' + NETWORK_OUTAGES_LOCATIONS = 'NETWORK_OUTAGES_LOCATIONS' + NETWORK_OUTAGES_INTERFACES = 'NETWORK_OUTAGES_INTERFACES' + NETWORK_OUTAGES_AFFECTED_TESTS = 'NETWORK_OUTAGES_AFFECTED_TESTS' + APPLICATION_OUTAGES_AFFECTED_TESTS = 'APPLICATION_OUTAGES_AFFECTED_TESTS' + APPLICATION_OUTAGES_SERVERS = 'APPLICATION_OUTAGES_SERVERS' + APPLICATION_OUTAGES_LOCATIONS = 'APPLICATION_OUTAGES_LOCATIONS' + APPLICATION_OUTAGES_OUTAGES = 'APPLICATION_OUTAGES_OUTAGES' + APPDYNAMICS_SERVICE_HEALTH = 'APPDYNAMICS_SERVICE_HEALTH' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DashboardMetric from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/dashboard_metric_direction.py b/dashboards_api/dashboards_api/models/dashboard_metric_direction.py new file mode 100644 index 00000000..da689ead --- /dev/null +++ b/dashboards_api/dashboards_api/models/dashboard_metric_direction.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 DashboardMetricDirection(str, Enum): + """ + Direction of agent to agent metric. + """ + + """ + allowed enum values + """ + TO_TARGET = 'TO_TARGET' + FROM_TARGET = 'FROM_TARGET' + BIDIRECTIONAL = 'BIDIRECTIONAL' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DashboardMetricDirection from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/dashboard_order.py b/dashboards_api/dashboards_api/models/dashboard_order.py new file mode 100644 index 00000000..c5af9316 --- /dev/null +++ b/dashboards_api/dashboards_api/models/dashboard_order.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 DashboardOrder(str, Enum): + """ + DashboardOrder + """ + + """ + allowed enum values + """ + ASC = 'asc' + DESC = 'desc' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DashboardOrder from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/dashboard_snapshot_links.py b/dashboards_api/dashboards_api/models/dashboard_snapshot_links.py new file mode 100644 index 00000000..bb36ebf9 --- /dev/null +++ b/dashboards_api/dashboards_api/models/dashboard_snapshot_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.dashboard_snapshot_links_links import DashboardSnapshotLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DashboardSnapshotLinks(BaseModel): + """ + A links object containing the self link. + """ # noqa: E501 + links: Optional[DashboardSnapshotLinksLinks] = 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 DashboardSnapshotLinks 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 DashboardSnapshotLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": DashboardSnapshotLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/dashboard_snapshot_links_links.py b/dashboards_api/dashboards_api/models/dashboard_snapshot_links_links.py new file mode 100644 index 00000000..a4f41b61 --- /dev/null +++ b/dashboards_api/dashboards_api/models/dashboard_snapshot_links_links.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DashboardSnapshotLinksLinks(BaseModel): + """ + DashboardSnapshotLinksLinks + """ # noqa: E501 + var_self: Optional[Link] = Field(default=None, alias="self") + app_link: Optional[Link] = Field(default=None, alias="appLink") + __properties: ClassVar[List[str]] = ["self", "appLink"] + + 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 DashboardSnapshotLinksLinks 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 app_link + if self.app_link: + _dict['appLink'] = self.app_link.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DashboardSnapshotLinksLinks 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, + "appLink": Link.from_dict(obj.get("appLink")) if obj.get("appLink") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/dashboard_snapshots200_response.py b/dashboards_api/dashboards_api/models/dashboard_snapshots200_response.py new file mode 100644 index 00000000..27256715 --- /dev/null +++ b/dashboards_api/dashboards_api/models/dashboard_snapshots200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.api_dashboard_snapshot import ApiDashboardSnapshot +from dashboards_api.models.pagination_links_links import PaginationLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DashboardSnapshots200Response(BaseModel): + """ + DashboardSnapshots200Response + """ # noqa: E501 + dashboard_snapshots: Optional[List[ApiDashboardSnapshot]] = Field(default=None, alias="dashboardSnapshots") + links: Optional[PaginationLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["dashboardSnapshots", "_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 DashboardSnapshots200Response 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 dashboard_snapshots (list) + _items = [] + if self.dashboard_snapshots: + for _item in self.dashboard_snapshots: + if _item: + _items.append(_item.to_dict()) + _dict['dashboardSnapshots'] = _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 DashboardSnapshots200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "dashboardSnapshots": [ApiDashboardSnapshot.from_dict(_item) for _item in obj.get("dashboardSnapshots")] if obj.get("dashboardSnapshots") is not None else None, + "_links": PaginationLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/dashboard_snapshots_page.py b/dashboards_api/dashboards_api/models/dashboard_snapshots_page.py new file mode 100644 index 00000000..d2281b48 --- /dev/null +++ b/dashboards_api/dashboards_api/models/dashboard_snapshots_page.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.api_dashboard_snapshot import ApiDashboardSnapshot +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DashboardSnapshotsPage(BaseModel): + """ + Dashboard snapshots page. + """ # noqa: E501 + dashboard_snapshots: Optional[List[ApiDashboardSnapshot]] = Field(default=None, alias="dashboardSnapshots") + __properties: ClassVar[List[str]] = ["dashboardSnapshots"] + + 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 DashboardSnapshotsPage 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 dashboard_snapshots (list) + _items = [] + if self.dashboard_snapshots: + for _item in self.dashboard_snapshots: + if _item: + _items.append(_item.to_dict()) + _dict['dashboardSnapshots'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DashboardSnapshotsPage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "dashboardSnapshots": [ApiDashboardSnapshot.from_dict(_item) for _item in obj.get("dashboardSnapshots")] if obj.get("dashboardSnapshots") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/duration_unit.py b/dashboards_api/dashboards_api/models/duration_unit.py new file mode 100644 index 00000000..1b16d490 --- /dev/null +++ b/dashboards_api/dashboards_api/models/duration_unit.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 DurationUnit(str, Enum): + """ + Timespan unit. + """ + + """ + allowed enum values + """ + MINUTE = 'minute' + HOUR = 'hour' + DAY = 'day' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DurationUnit from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/enterprise_agent_state.py b/dashboards_api/dashboards_api/models/enterprise_agent_state.py new file mode 100644 index 00000000..58e960e0 --- /dev/null +++ b/dashboards_api/dashboards_api/models/enterprise_agent_state.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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)) + + diff --git a/dashboards_api/dashboards_api/models/error.py b/dashboards_api/dashboards_api/models/error.py new file mode 100644 index 00000000..6e004f07 --- /dev/null +++ b/dashboards_api/dashboards_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 + + diff --git a/dashboards_api/dashboards_api/models/generate_dashboard_snapshot_request.py b/dashboards_api/dashboards_api/models/generate_dashboard_snapshot_request.py new file mode 100644 index 00000000..143a1c2b --- /dev/null +++ b/dashboards_api/dashboards_api/models/generate_dashboard_snapshot_request.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GenerateDashboardSnapshotRequest(BaseModel): + """ + Request to generate a snapshot from a dashboard. + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="Date and time to start aggregating data (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="Date and time to end aggregating data (ISO date-time format).", alias="endDate") + display_name: Optional[StrictStr] = Field(default=None, description="The name of the snapshot, does not have to be unique.", alias="displayName") + dashboard_id: Optional[StrictStr] = Field(default=None, description="TheIdentifierof the dashboard to generate a snapshot from", alias="dashboardId") + anonymize_data: Optional[StrictBool] = Field(default=None, description="Set to `true` to anonymize the data in the snapshot.", alias="anonymizeData") + timezone: Optional[StrictStr] = Field(default=None, description="Specifies the timezone used for date and time fields.") + expiration_date: Optional[datetime] = Field(default=None, description="Expiration date of the snapshot. If unspecified, the snapshot expires 1 year from its creation date. The expiration date must be set within 5 years from the current date and adhere to the ISO date-time format.", alias="expirationDate") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "displayName", "dashboardId", "anonymizeData", "timezone", "expirationDate"] + + 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 GenerateDashboardSnapshotRequest 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 GenerateDashboardSnapshotRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "displayName": obj.get("displayName"), + "dashboardId": obj.get("dashboardId"), + "anonymizeData": obj.get("anonymizeData"), + "timezone": obj.get("timezone"), + "expirationDate": obj.get("expirationDate") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/geo_map_datasource.py b/dashboards_api/dashboards_api/models/geo_map_datasource.py new file mode 100644 index 00000000..a20c8a98 --- /dev/null +++ b/dashboards_api/dashboards_api/models/geo_map_datasource.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 GeoMapDatasource(str, Enum): + """ + Datasource of the geo map widget. + """ + + """ + allowed enum values + """ + ALERTS = 'ALERTS' + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + ENDPOINT_AST_TEST = 'ENDPOINT_AST_TEST' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_LOCAL_NETWORK = 'ENDPOINT_LOCAL_NETWORK' + ENDPOINT_LOCAL_NETWORK_WIRELESS = 'ENDPOINT_LOCAL_NETWORK_WIRELESS' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' + ROUTING = 'ROUTING' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GeoMapDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/get_dashboard_data200_response.py b/dashboards_api/dashboards_api/models/get_dashboard_data200_response.py new file mode 100644 index 00000000..e355e9a1 --- /dev/null +++ b/dashboards_api/dashboards_api/models/get_dashboard_data200_response.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +from pydantic import Field +from dashboards_api.models.api_report_data_component_label_map import ApiReportDataComponentLabelMap +from dashboards_api.models.api_widgets_data_v2 import ApiWidgetsDataV2 +from dashboards_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetDashboardData200Response(BaseModel): + """ + GetDashboardData200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + group_labels: Optional[List[ApiReportDataComponentLabelMap]] = Field(default=None, alias="groupLabels") + bin_size: Optional[StrictInt] = Field(default=None, description="Duration of each bin.", alias="binSize") + data: Optional[ApiWidgetsDataV2] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "groupLabels", "binSize", "data", "_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 GetDashboardData200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in group_labels (list) + _items = [] + if self.group_labels: + for _item in self.group_labels: + if _item: + _items.append(_item.to_dict()) + _dict['groupLabels'] = _items + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.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 GetDashboardData200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "groupLabels": [ApiReportDataComponentLabelMap.from_dict(_item) for _item in obj.get("groupLabels")] if obj.get("groupLabels") is not None else None, + "binSize": obj.get("binSize"), + "data": ApiWidgetsDataV2.from_dict(obj.get("data")) if obj.get("data") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/grouped_bar_chart_datasource.py b/dashboards_api/dashboards_api/models/grouped_bar_chart_datasource.py new file mode 100644 index 00000000..5cb1eee2 --- /dev/null +++ b/dashboards_api/dashboards_api/models/grouped_bar_chart_datasource.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 GroupedBarChartDatasource(str, Enum): + """ + Datasource of the grouped bar chart widget. + """ + + """ + allowed enum values + """ + ALERTS = 'ALERTS' + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + DEVICES = 'DEVICES' + ENDPOINT_AST_TEST = 'ENDPOINT_AST_TEST' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_LOCAL_NETWORK = 'ENDPOINT_LOCAL_NETWORK' + ENDPOINT_LOCAL_NETWORK_WIRELESS = 'ENDPOINT_LOCAL_NETWORK_WIRELESS' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' + ROUTING = 'ROUTING' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GroupedBarChartDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/link.py b/dashboards_api/dashboards_api/models/link.py new file mode 100644 index 00000000..1e5a4d36 --- /dev/null +++ b/dashboards_api/dashboards_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 + + diff --git a/dashboards_api/dashboards_api/models/metric_group.py b/dashboards_api/dashboards_api/models/metric_group.py new file mode 100644 index 00000000..b4902a14 --- /dev/null +++ b/dashboards_api/dashboards_api/models/metric_group.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 MetricGroup(str, Enum): + """ + Metric group of widget as it appears in the UI. Note: may not be required in some cases. + """ + + """ + allowed enum values + """ + AGENT_TO_AGENT = 'AGENT_TO_AGENT' + AGENT_TO_SERVER = 'AGENT_TO_SERVER' + HTTP_SERVER = 'HTTP_SERVER' + FTP_SERVER = 'FTP_SERVER' + PAGE_LOAD = 'PAGE_LOAD' + TRANSACTIONS_CLASSIC = 'TRANSACTIONS_CLASSIC' + TRANSACTIONS = 'TRANSACTIONS' + ENDPOINT_BROWSER_SESSION_NETWORK = 'ENDPOINT_BROWSER_SESSION_NETWORK' + ENDPOINT_BROWSER_SESSION_SYSTEMK = 'ENDPOINT_BROWSER_SESSION_SYSTEMK' + ENDPOINT_BROWSER_SESSION_VISITED_PAGES = 'ENDPOINT_BROWSER_SESSION_VISITED_PAGES' + ENDPOINT_SCHEDULED_TEST_HTTP_SERVER = 'ENDPOINT_SCHEDULED_TEST_HTTP_SERVER' + ENDPOINT_SCHEDULED_TEST_NETWORK = 'ENDPOINT_SCHEDULED_TEST_NETWORK' + ENDPOINT_SCHEDULED_TEST_SYSTEM = 'ENDPOINT_SCHEDULED_TEST_SYSTEM' + ENDPOINT_AST_TEST_NETWORK = 'ENDPOINT_AST_TEST_NETWORK' + ENDPOINT_AST_TEST_SYSTEM = 'ENDPOINT_AST_TEST_SYSTEM' + ENDPOINT_LOCAL_NETWORK_GATEWAY = 'ENDPOINT_LOCAL_NETWORK_GATEWAY' + ENDPOINT_LOCAL_NETWORK_AGENTS = 'ENDPOINT_LOCAL_NETWORK_AGENTS' + ENDPOINT_LOCAL_NETWORK_DNS = 'ENDPOINT_LOCAL_NETWORK_DNS' + ENDPOINT_LOCAL_NETWORK_NETWORK_ACCESS = 'ENDPOINT_LOCAL_NETWORK_NETWORK_ACCESS' + ENDPOINT_LOCAL_NETWORK_PROXY = 'ENDPOINT_LOCAL_NETWORK_PROXY' + ENDPOINT_LOCAL_NETWORK_SYSTEM = 'ENDPOINT_LOCAL_NETWORK_SYSTEM' + ENDPOINT_LOCAL_NETWORK_VPN = 'ENDPOINT_LOCAL_NETWORK_VPN' + ENDPOINT_LOCAL_NETWORK_WIRELESS = 'ENDPOINT_LOCAL_NETWORK_WIRELESS' + BGP = 'BGP' + DEVICE = 'DEVICE' + VOIP = 'VOIP' + SIP = 'SIP' + ALERTS = 'ALERTS' + DNS = 'DNS' + DOMAIN_TRACE = 'DOMAIN_TRACE' + DNSSEC = 'DNSSEC' + DNSP = 'DNSP' + NETWORK_OUTAGES = 'NETWORK_OUTAGES' + APPLICATION_OUTAGES = 'APPLICATION_OUTAGES' + APPDYNAMICS_SERVICE_HEALTH = 'APPDYNAMICS_SERVICE_HEALTH' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of MetricGroup from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/multi_metrics_table_datasource.py b/dashboards_api/dashboards_api/models/multi_metrics_table_datasource.py new file mode 100644 index 00000000..61d60ddc --- /dev/null +++ b/dashboards_api/dashboards_api/models/multi_metrics_table_datasource.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 MultiMetricsTableDatasource(str, Enum): + """ + Datasource of the Multi-Metrics table widget. + """ + + """ + allowed enum values + """ + ALERTS = 'ALERTS' + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + DEVICES = 'DEVICES' + ENDPOINT_AST_TEST = 'ENDPOINT_AST_TEST' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_LOCAL_NETWORK = 'ENDPOINT_LOCAL_NETWORK' + ENDPOINT_LOCAL_NETWORK_WIRELESS = 'ENDPOINT_LOCAL_NETWORK_WIRELESS' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' + ROUTING = 'ROUTING' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of MultiMetricsTableDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/numbers_card_datasource.py b/dashboards_api/dashboards_api/models/numbers_card_datasource.py new file mode 100644 index 00000000..2e50a7a6 --- /dev/null +++ b/dashboards_api/dashboards_api/models/numbers_card_datasource.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 NumbersCardDatasource(str, Enum): + """ + Datasource of the numbers card widget. + """ + + """ + allowed enum values + """ + ALERTS = 'ALERTS' + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + DEVICES = 'DEVICES' + ENDPOINT_AST_TEST = 'ENDPOINT_AST_TEST' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_LOCAL_NETWORK = 'ENDPOINT_LOCAL_NETWORK' + ENDPOINT_LOCAL_NETWORK_WIRELESS = 'ENDPOINT_LOCAL_NETWORK_WIRELESS' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' + ROUTING = 'ROUTING' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of NumbersCardDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/pagination_links.py b/dashboards_api/dashboards_api/models/pagination_links.py new file mode 100644 index 00000000..a701eb68 --- /dev/null +++ b/dashboards_api/dashboards_api/models/pagination_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.pagination_links_links import PaginationLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationLinks(BaseModel): + """ + A links object containing pagination related link(s). + """ # noqa: E501 + links: Optional[PaginationLinksLinks] = 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 PaginationLinks 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 PaginationLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": PaginationLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/pagination_links_links.py b/dashboards_api/dashboards_api/models/pagination_links_links.py new file mode 100644 index 00000000..cefa15be --- /dev/null +++ b/dashboards_api/dashboards_api/models/pagination_links_links.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_api.models.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationLinksLinks(BaseModel): + """ + PaginationLinksLinks + """ # noqa: E501 + previous: Optional[Link] = None + next: Optional[Link] = None + __properties: ClassVar[List[str]] = ["previous", "next"] + + 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 PaginationLinksLinks 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 previous + if self.previous: + _dict['previous'] = self.previous.to_dict() + # override the default output from pydantic by calling `to_dict()` of next + if self.next: + _dict['next'] = self.next.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PaginationLinksLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "previous": Link.from_dict(obj.get("previous")) if obj.get("previous") is not None else None, + "next": Link.from_dict(obj.get("next")) if obj.get("next") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/pie_chart_datasource.py b/dashboards_api/dashboards_api/models/pie_chart_datasource.py new file mode 100644 index 00000000..67276815 --- /dev/null +++ b/dashboards_api/dashboards_api/models/pie_chart_datasource.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 PieChartDatasource(str, Enum): + """ + Datasource of the pie chart widget. + """ + + """ + allowed enum values + """ + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of PieChartDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/query_window.py b/dashboards_api/dashboards_api/models/query_window.py new file mode 100644 index 00000000..38122fa0 --- /dev/null +++ b/dashboards_api/dashboards_api/models/query_window.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class QueryWindow(BaseModel): + """ + QueryWindow + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + __properties: ClassVar[List[str]] = ["startDate", "endDate"] + + 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 QueryWindow 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of QueryWindow from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/scalable_widget.py b/dashboards_api/dashboards_api/models/scalable_widget.py new file mode 100644 index 00000000..10c3425d --- /dev/null +++ b/dashboards_api/dashboards_api/models/scalable_widget.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +from dashboards_api.models.api_widget_fixed_y_scale_prefix import ApiWidgetFixedYScalePrefix +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ScalableWidget(BaseModel): + """ + ScalableWidget + """ # noqa: E501 + min_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Mininum scale configured in the widget.", alias="minScale") + max_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum scale configured in the widget.", alias="maxScale") + unit: Optional[ApiWidgetFixedYScalePrefix] = None + __properties: ClassVar[List[str]] = ["minScale", "maxScale", "unit"] + + 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 ScalableWidget 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 ScalableWidget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "minScale": obj.get("minScale"), + "maxScale": obj.get("maxScale"), + "unit": obj.get("unit") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/self_links.py b/dashboards_api/dashboards_api/models/self_links.py new file mode 100644 index 00000000..b29b821a --- /dev/null +++ b/dashboards_api/dashboards_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_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 + + diff --git a/dashboards_api/dashboards_api/models/self_links_links.py b/dashboards_api/dashboards_api/models/self_links_links.py new file mode 100644 index 00000000..ecd3521f --- /dev/null +++ b/dashboards_api/dashboards_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_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 + + diff --git a/dashboards_api/dashboards_api/models/snapshot_data_by_widget200_response.py b/dashboards_api/dashboards_api/models/snapshot_data_by_widget200_response.py new file mode 100644 index 00000000..8066daaa --- /dev/null +++ b/dashboards_api/dashboards_api/models/snapshot_data_by_widget200_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +from pydantic import Field +from dashboards_api.models.api_report_data_component_label_map import ApiReportDataComponentLabelMap +from dashboards_api.models.api_widgets_data_v2 import ApiWidgetsDataV2 +from dashboards_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SnapshotDataByWidget200Response(BaseModel): + """ + SnapshotDataByWidget200Response + """ # noqa: E501 + group_labels: Optional[List[ApiReportDataComponentLabelMap]] = Field(default=None, alias="groupLabels") + bin_size: Optional[StrictInt] = Field(default=None, description="Duration of each bin.", alias="binSize") + data: Optional[ApiWidgetsDataV2] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["groupLabels", "binSize", "data", "_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 SnapshotDataByWidget200Response 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 group_labels (list) + _items = [] + if self.group_labels: + for _item in self.group_labels: + if _item: + _items.append(_item.to_dict()) + _dict['groupLabels'] = _items + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.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 SnapshotDataByWidget200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "groupLabels": [ApiReportDataComponentLabelMap.from_dict(_item) for _item in obj.get("groupLabels")] if obj.get("groupLabels") is not None else None, + "binSize": obj.get("binSize"), + "data": ApiWidgetsDataV2.from_dict(obj.get("data")) if obj.get("data") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/stacked_area_chart_datasource.py b/dashboards_api/dashboards_api/models/stacked_area_chart_datasource.py new file mode 100644 index 00000000..28ec7479 --- /dev/null +++ b/dashboards_api/dashboards_api/models/stacked_area_chart_datasource.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 StackedAreaChartDatasource(str, Enum): + """ + Datasource of the stacked area chart widget. + """ + + """ + allowed enum values + """ + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of StackedAreaChartDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/stacked_bar_chart_datasource.py b/dashboards_api/dashboards_api/models/stacked_bar_chart_datasource.py new file mode 100644 index 00000000..d543b201 --- /dev/null +++ b/dashboards_api/dashboards_api/models/stacked_bar_chart_datasource.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 StackedBarChartDatasource(str, Enum): + """ + Datasource of the stacked bar chart widget. + """ + + """ + allowed enum values + """ + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of StackedBarChartDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/table_datasource.py b/dashboards_api/dashboards_api/models/table_datasource.py new file mode 100644 index 00000000..a01eba86 --- /dev/null +++ b/dashboards_api/dashboards_api/models/table_datasource.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 TableDatasource(str, Enum): + """ + Datasource of the table widget. + """ + + """ + allowed enum values + """ + ALERTS = 'ALERTS' + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + DEVICES = 'DEVICES' + ENDPOINT_AST_TEST = 'ENDPOINT_AST_TEST' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_LOCAL_NETWORK = 'ENDPOINT_LOCAL_NETWORK' + ENDPOINT_LOCAL_NETWORK_WIRELESS = 'ENDPOINT_LOCAL_NETWORK_WIRELESS' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' + ROUTING = 'ROUTING' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TableDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/test_table_datasource.py b/dashboards_api/dashboards_api/models/test_table_datasource.py new file mode 100644 index 00000000..a674b22d --- /dev/null +++ b/dashboards_api/dashboards_api/models/test_table_datasource.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 TestTableDatasource(str, Enum): + """ + Datasource of the test table widget. + """ + + """ + allowed enum values + """ + ALERTS = 'ALERTS' + DEVICES = 'DEVICES' + DNSP = 'DNSP' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + ENDPOINT_AST_TEST = 'ENDPOINT_AST_TEST' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_LOCAL_NETWORK = 'ENDPOINT_LOCAL_NETWORK' + ENDPOINT_LOCAL_NETWORK_WIRELESS = 'ENDPOINT_LOCAL_NETWORK_WIRELESS' + ROUTING = 'ROUTING' + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' + APPDYNAMICS_SERVICE_HEALTH = 'APPDYNAMICS_SERVICE_HEALTH' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestTableDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/test_table_filter_key.py b/dashboards_api/dashboards_api/models/test_table_filter_key.py new file mode 100644 index 00000000..21907130 --- /dev/null +++ b/dashboards_api/dashboards_api/models/test_table_filter_key.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 TestTableFilterKey(str, Enum): + """ + TestTableFilterKey + """ + + """ + allowed enum values + """ + ANYTHING = 'Anything' + TEST_NAME = 'Test Name' + TARGET = 'Target' + TEST_ID = 'Test ID' + TEST_TYPE = 'Test type' + LABEL_ID = 'Label ID' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestTableFilterKey from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/test_table_filter_type.py b/dashboards_api/dashboards_api/models/test_table_filter_type.py new file mode 100644 index 00000000..e412dd95 --- /dev/null +++ b/dashboards_api/dashboards_api/models/test_table_filter_type.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 TestTableFilterType(str, Enum): + """ + TestTableFilterType + """ + + """ + allowed enum values + """ + ALL = 'all' + ANY = 'any' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestTableFilterType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/timeseries_datasource.py b/dashboards_api/dashboards_api/models/timeseries_datasource.py new file mode 100644 index 00000000..8c00de61 --- /dev/null +++ b/dashboards_api/dashboards_api/models/timeseries_datasource.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 TimeseriesDatasource(str, Enum): + """ + Datasource of the Timeseries widget. + """ + + """ + allowed enum values + """ + ALERTS = 'ALERTS' + CLOUD_AND_ENTERPRISE_AGENTS = 'CLOUD_AND_ENTERPRISE_AGENTS' + DEVICES = 'DEVICES' + ENDPOINT_AST_TEST = 'ENDPOINT_AST_TEST' + ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' + ENDPOINT_LOCAL_NETWORK = 'ENDPOINT_LOCAL_NETWORK' + ENDPOINT_LOCAL_NETWORK_WIRELESS = 'ENDPOINT_LOCAL_NETWORK_WIRELESS' + ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' + INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' + ROUTING = 'ROUTING' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TimeseriesDatasource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/unauthorized_error.py b/dashboards_api/dashboards_api/models/unauthorized_error.py new file mode 100644 index 00000000..a99b706b --- /dev/null +++ b/dashboards_api/dashboards_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 + + diff --git a/dashboards_api/dashboards_api/models/update_snapshot_expiration_date_api_request.py b/dashboards_api/dashboards_api/models/update_snapshot_expiration_date_api_request.py new file mode 100644 index 00000000..5cb917b1 --- /dev/null +++ b/dashboards_api/dashboards_api/models/update_snapshot_expiration_date_api_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdateSnapshotExpirationDateApiRequest(BaseModel): + """ + Request to update the expiration date of a snapshot. + """ # noqa: E501 + snapshot_expiration_date: Optional[datetime] = Field(default=None, description="Expiration date of the snapshot. If unspecified, the snapshot expires 1 year from its creation date. The expiration date must be set within 5 years from the current date and adhere to the ISO date-time format.", alias="snapshotExpirationDate") + __properties: ClassVar[List[str]] = ["snapshotExpirationDate"] + + 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 UpdateSnapshotExpirationDateApiRequest 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 UpdateSnapshotExpirationDateApiRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "snapshotExpirationDate": obj.get("snapshotExpirationDate") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/visual_mode.py b/dashboards_api/dashboards_api/models/visual_mode.py new file mode 100644 index 00000000..38d57bbc --- /dev/null +++ b/dashboards_api/dashboards_api/models/visual_mode.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 VisualMode(str, Enum): + """ + Visual mode in the UI. Either full or half the width of the window. + """ + + """ + allowed enum values + """ + FULL = 'Full' + HALF_SCREEN = 'Half screen' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of VisualMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/widget.py b/dashboards_api/dashboards_api/models/widget.py new file mode 100644 index 00000000..0c4291a8 --- /dev/null +++ b/dashboards_api/dashboards_api/models/widget.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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, Union +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from dashboards_api.models.api_duration import ApiDuration +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure +from dashboards_api.models.dashboard_metric import DashboardMetric +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection +from dashboards_api.models.metric_group import MetricGroup +from dashboards_api.models.self_links_links import SelfLinksLinks +from dashboards_api.models.visual_mode import VisualMode +from dashboards_api.models.widget_type import WidgetType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Widget(BaseModel): + """ + Widget + """ # noqa: E501 + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + id: Optional[StrictStr] = Field(default=None, description="Identifier of the widget.") + type: Optional[WidgetType] = None + title: Optional[StrictStr] = Field(default=None, description="Title of the widget") + visual_mode: Optional[VisualMode] = Field(default=None, alias="visualMode") + embed_url: Optional[StrictStr] = Field(default=None, description="When `isEmbedded` is set to `true`, an `embedUrl` is provided.", alias="embedUrl") + is_embedded: Optional[StrictBool] = Field(default=None, description="Set to `true` if widget is marked as embedded; otherwise, set to `false`.", alias="isEmbedded") + metric_group: Optional[MetricGroup] = Field(default=None, alias="metricGroup") + direction: Optional[DashboardMetricDirection] = None + metric: Optional[DashboardMetric] = None + filters: Optional[Dict[str, List[Union[str, Any]]]] = Field(default=None, description="(Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property.") + measure: Optional[ApiWidgetMeasure] = None + fixed_timespan: Optional[ApiDuration] = Field(default=None, alias="fixedTimespan") + api_link: Optional[StrictStr] = Field(default=None, alias="apiLink") + should_exclude_alert_suppression_windows: Optional[StrictBool] = Field(default=None, description="Excludes alert suppression window data if set to `true`.", alias="shouldExcludeAlertSuppressionWindows") + __properties: ClassVar[List[str]] = ["_links", "id", "type", "title", "visualMode", "embedUrl", "isEmbedded", "metricGroup", "direction", "metric", "filters", "measure", "fixedTimespan", "apiLink", "shouldExcludeAlertSuppressionWindows"] + + 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 Widget 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={ + "embed_url", + "api_link", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of measure + if self.measure: + _dict['measure'] = self.measure.to_dict() + # override the default output from pydantic by calling `to_dict()` of fixed_timespan + if self.fixed_timespan: + _dict['fixedTimespan'] = self.fixed_timespan.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Widget 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, + "id": obj.get("id"), + "type": obj.get("type"), + "title": obj.get("title"), + "visualMode": obj.get("visualMode"), + "embedUrl": obj.get("embedUrl"), + "isEmbedded": obj.get("isEmbedded"), + "metricGroup": obj.get("metricGroup"), + "direction": obj.get("direction"), + "metric": obj.get("metric"), + "filters": obj.get("filters"), + "measure": ApiWidgetMeasure.from_dict(obj.get("measure")) if obj.get("measure") is not None else None, + "fixedTimespan": ApiDuration.from_dict(obj.get("fixedTimespan")) if obj.get("fixedTimespan") is not None else None, + "apiLink": obj.get("apiLink"), + "shouldExcludeAlertSuppressionWindows": obj.get("shouldExcludeAlertSuppressionWindows") + }) + return _obj + + diff --git a/dashboards_api/dashboards_api/models/widget_measure_type.py b/dashboards_api/dashboards_api/models/widget_measure_type.py new file mode 100644 index 00000000..b7d05158 --- /dev/null +++ b/dashboards_api/dashboards_api/models/widget_measure_type.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 WidgetMeasureType(str, Enum): + """ + Determines how to aggregate the the metric. + """ + + """ + allowed enum values + """ + MINIMUM = 'MINIMUM' + MAXIMUM = 'MAXIMUM' + MEAN = 'MEAN' + MEDIAN = 'MEDIAN' + NTH_PERCENTILE = 'NTH_PERCENTILE' + PERCPOSITIVE = 'PERCPOSITIVE' + PERCZERO = 'PERCZERO' + STDDEV = 'STDDEV' + TOTAL = 'TOTAL' + VALUES = 'VALUES' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WidgetMeasureType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/widget_sort_direction.py b/dashboards_api/dashboards_api/models/widget_sort_direction.py new file mode 100644 index 00000000..7271694b --- /dev/null +++ b/dashboards_api/dashboards_api/models/widget_sort_direction.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 WidgetSortDirection(str, Enum): + """ + Specifies the order in which cards are sorted. + """ + + """ + allowed enum values + """ + ASCENDING = 'ascending' + DESCENDING = 'descending' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WidgetSortDirection from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/widget_sort_property.py b/dashboards_api/dashboards_api/models/widget_sort_property.py new file mode 100644 index 00000000..4c6affb1 --- /dev/null +++ b/dashboards_api/dashboards_api/models/widget_sort_property.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 WidgetSortProperty(str, Enum): + """ + Determines the card sorting criterion. + """ + + """ + allowed enum values + """ + ALPHABETICAL = 'alphabetical' + VALUE = 'value' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WidgetSortProperty from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/models/widget_type.py b/dashboards_api/dashboards_api/models/widget_type.py new file mode 100644 index 00000000..84c163ca --- /dev/null +++ b/dashboards_api/dashboards_api/models/widget_type.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 WidgetType(str, Enum): + """ + Type of the Widget + """ + + """ + allowed enum values + """ + BAR_CHART_COLON__STACKED = 'Bar Chart: Stacked' + BAR_CHART_COLON__GROUPED = 'Bar Chart: Grouped' + TIME_SERIES_COLON__LINE = 'Time Series: Line' + TIME_SERIES_COLON__STACKED_AREA = 'Time Series: Stacked Area' + PIE_CHART = 'Pie Chart' + TABLE = 'Table' + MULTI_METRIC_TABLE = 'Multi Metric Table' + NUMBER = 'Number' + AGENT_STATUS = 'Agent Status' + COLOR_GRID = 'Color Grid' + ALERT_LIST = 'Alert List' + TEST_TABLE = 'Test Table' + MAP = 'Map' + BOX_AND_WHISKERS = 'Box and Whiskers' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WidgetType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dashboards_api/dashboards_api/py.typed b/dashboards_api/dashboards_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/dashboards_api/dashboards_api/rest.py b/dashboards_api/dashboards_api/rest.py new file mode 100644 index 00000000..690891f9 --- /dev/null +++ b/dashboards_api/dashboards_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 dashboards_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) diff --git a/dashboards_api/docs/AgentStatusDatasource.md b/dashboards_api/docs/AgentStatusDatasource.md new file mode 100644 index 00000000..af1f0156 --- /dev/null +++ b/dashboards_api/docs/AgentStatusDatasource.md @@ -0,0 +1,11 @@ +# AgentStatusDatasource + +Datasource of the agent to retrieve status. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/AgentWidgetShow.md b/dashboards_api/docs/AgentWidgetShow.md new file mode 100644 index 00000000..865d5470 --- /dev/null +++ b/dashboards_api/docs/AgentWidgetShow.md @@ -0,0 +1,11 @@ +# AgentWidgetShow + +Ownership of the agent. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/AgentWidgetType.md b/dashboards_api/docs/AgentWidgetType.md new file mode 100644 index 00000000..c777de33 --- /dev/null +++ b/dashboards_api/docs/AgentWidgetType.md @@ -0,0 +1,11 @@ +# AgentWidgetType + +Type of the agent. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/AlertListDatasource.md b/dashboards_api/docs/AlertListDatasource.md new file mode 100644 index 00000000..cc00957a --- /dev/null +++ b/dashboards_api/docs/AlertListDatasource.md @@ -0,0 +1,11 @@ +# AlertListDatasource + +Datasource of the alert list. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiAgentLocation.md b/dashboards_api/docs/ApiAgentLocation.md new file mode 100644 index 00000000..a2babd4f --- /dev/null +++ b/dashboards_api/docs/ApiAgentLocation.md @@ -0,0 +1,31 @@ +# ApiAgentLocation + +Location of the agent. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**latitude** | **float** | Latitude of the agent. | [optional] +**longitude** | **float** | Longitude of the agent. | [optional] +**location_name** | **str** | Name of the agent location. | [optional] + +## Example + +```python +from dashboards_api.models.api_agent_location import ApiAgentLocation + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAgentLocation from a JSON string +api_agent_location_instance = ApiAgentLocation.from_json(json) +# print the JSON string representation of the object +print ApiAgentLocation.to_json() + +# convert the object into a dict +api_agent_location_dict = api_agent_location_instance.to_dict() +# create an instance of ApiAgentLocation from a dict +api_agent_location_form_dict = api_agent_location.from_dict(api_agent_location_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiAgentStatusAgent.md b/dashboards_api/docs/ApiAgentStatusAgent.md new file mode 100644 index 00000000..f99b4579 --- /dev/null +++ b/dashboards_api/docs/ApiAgentStatusAgent.md @@ -0,0 +1,33 @@ +# ApiAgentStatusAgent + +Agent shown in agent status widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Identifier of the agent. | [optional] +**status** | [**EnterpriseAgentState**](EnterpriseAgentState.md) | | [optional] +**ip_info** | [**ApiAgentStatusIpInfo**](ApiAgentStatusIpInfo.md) | | [optional] +**agent_name** | **str** | Name of the agent | [optional] +**location** | [**ApiAgentLocation**](ApiAgentLocation.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_agent_status_agent import ApiAgentStatusAgent + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAgentStatusAgent from a JSON string +api_agent_status_agent_instance = ApiAgentStatusAgent.from_json(json) +# print the JSON string representation of the object +print ApiAgentStatusAgent.to_json() + +# convert the object into a dict +api_agent_status_agent_dict = api_agent_status_agent_instance.to_dict() +# create an instance of ApiAgentStatusAgent from a dict +api_agent_status_agent_form_dict = api_agent_status_agent.from_dict(api_agent_status_agent_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiAgentStatusIpInfo.md b/dashboards_api/docs/ApiAgentStatusIpInfo.md new file mode 100644 index 00000000..f8da582b --- /dev/null +++ b/dashboards_api/docs/ApiAgentStatusIpInfo.md @@ -0,0 +1,32 @@ +# ApiAgentStatusIpInfo + +IP information of the agent. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**public_ip** | **str** | Public IP of the agent. | [optional] +**private_ip** | **str** | Private IP of the agent. | [optional] +**ipv6** | **str** | | [optional] +**operative_system_version** | **str** | | [optional] + +## Example + +```python +from dashboards_api.models.api_agent_status_ip_info import ApiAgentStatusIpInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAgentStatusIpInfo from a JSON string +api_agent_status_ip_info_instance = ApiAgentStatusIpInfo.from_json(json) +# print the JSON string representation of the object +print ApiAgentStatusIpInfo.to_json() + +# convert the object into a dict +api_agent_status_ip_info_dict = api_agent_status_ip_info_instance.to_dict() +# create an instance of ApiAgentStatusIpInfo from a dict +api_agent_status_ip_info_form_dict = api_agent_status_ip_info.from_dict(api_agent_status_ip_info_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiAgentStatusSummary.md b/dashboards_api/docs/ApiAgentStatusSummary.md new file mode 100644 index 00000000..dcdd23a5 --- /dev/null +++ b/dashboards_api/docs/ApiAgentStatusSummary.md @@ -0,0 +1,31 @@ +# ApiAgentStatusSummary + +Summary of the agent status. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**online** | **int** | Shows the number of agents with an online status. | [optional] +**offline** | **int** | Shows the number of agents with an offline status. | [optional] +**disabled** | **int** | Shows the number of agents with disabled status. | [optional] + +## Example + +```python +from dashboards_api.models.api_agent_status_summary import ApiAgentStatusSummary + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAgentStatusSummary from a JSON string +api_agent_status_summary_instance = ApiAgentStatusSummary.from_json(json) +# print the JSON string representation of the object +print ApiAgentStatusSummary.to_json() + +# convert the object into a dict +api_agent_status_summary_dict = api_agent_status_summary_instance.to_dict() +# create an instance of ApiAgentStatusSummary from a dict +api_agent_status_summary_form_dict = api_agent_status_summary.from_dict(api_agent_status_summary_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiAgentStatusWidget.md b/dashboards_api/docs/ApiAgentStatusWidget.md new file mode 100644 index 00000000..85bb9b7e --- /dev/null +++ b/dashboards_api/docs/ApiAgentStatusWidget.md @@ -0,0 +1,45 @@ +# ApiAgentStatusWidget + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**agents** | [**AgentWidgetType**](AgentWidgetType.md) | | [optional] +**show** | [**AgentWidgetShow**](AgentWidgetShow.md) | | [optional] +**data_source** | [**AgentStatusDatasource**](AgentStatusDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_agent_status_widget import ApiAgentStatusWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAgentStatusWidget from a JSON string +api_agent_status_widget_instance = ApiAgentStatusWidget.from_json(json) +# print the JSON string representation of the object +print ApiAgentStatusWidget.to_json() + +# convert the object into a dict +api_agent_status_widget_dict = api_agent_status_widget_instance.to_dict() +# create an instance of ApiAgentStatusWidget from a dict +api_agent_status_widget_form_dict = api_agent_status_widget.from_dict(api_agent_status_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiAggregateProperty.md b/dashboards_api/docs/ApiAggregateProperty.md new file mode 100644 index 00000000..ee4e9122 --- /dev/null +++ b/dashboards_api/docs/ApiAggregateProperty.md @@ -0,0 +1,11 @@ +# ApiAggregateProperty + +Defines the property by which to aggregate the metric. Metrics are grouped based on unique values of the chosen property. Selecting `ALL` aggregates the data into a single group. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiAlertListAlert.md b/dashboards_api/docs/ApiAlertListAlert.md new file mode 100644 index 00000000..fc8571b7 --- /dev/null +++ b/dashboards_api/docs/ApiAlertListAlert.md @@ -0,0 +1,37 @@ +# ApiAlertListAlert + +Alert shown in the alert list widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alert_id** | **str** | Identifier of the alert. | [optional] +**test_id** | **str** | Identifier of the test. | [optional] +**rule_id** | **str** | Identifier of the rule. | [optional] +**alert_source** | **str** | Name of the agent, monitor or device producing the alert. | [optional] +**alert_rule** | **str** | Name of the alert rule that this alert belongs to. | [optional] +**alert_type** | [**ApiAlertListAlertType**](ApiAlertListAlertType.md) | | [optional] +**start_time** | **datetime** | UTC date when the alert was first active. | [optional] +**duration_in_seconds** | **int** | Number of seconds the alert was active. If it’s still active, this number will increase every second. | [optional] +**active** | **bool** | Set to `true` if alert is active, `false` otherwise. | [optional] + +## Example + +```python +from dashboards_api.models.api_alert_list_alert import ApiAlertListAlert + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAlertListAlert from a JSON string +api_alert_list_alert_instance = ApiAlertListAlert.from_json(json) +# print the JSON string representation of the object +print ApiAlertListAlert.to_json() + +# convert the object into a dict +api_alert_list_alert_dict = api_alert_list_alert_instance.to_dict() +# create an instance of ApiAlertListAlert from a dict +api_alert_list_alert_form_dict = api_alert_list_alert.from_dict(api_alert_list_alert_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiAlertListAlertType.md b/dashboards_api/docs/ApiAlertListAlertType.md new file mode 100644 index 00000000..00479cf9 --- /dev/null +++ b/dashboards_api/docs/ApiAlertListAlertType.md @@ -0,0 +1,11 @@ +# ApiAlertListAlertType + +Name of the alert type + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiAlertListWidget.md b/dashboards_api/docs/ApiAlertListWidget.md new file mode 100644 index 00000000..29a56910 --- /dev/null +++ b/dashboards_api/docs/ApiAlertListWidget.md @@ -0,0 +1,46 @@ +# ApiAlertListWidget + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**alert_types** | [**List[ApiAlertListAlertType]**](ApiAlertListAlertType.md) | List of alert types configured in the widget, an empty list means all alert types. | [optional] +**limit_to** | **int** | Limit the number of alerts displayed in the widget. | [optional] +**active_within** | [**ApiAlertListWidgetAllOfActiveWithin**](ApiAlertListWidgetAllOfActiveWithin.md) | | [optional] +**data_source** | [**AlertListDatasource**](AlertListDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_alert_list_widget import ApiAlertListWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAlertListWidget from a JSON string +api_alert_list_widget_instance = ApiAlertListWidget.from_json(json) +# print the JSON string representation of the object +print ApiAlertListWidget.to_json() + +# convert the object into a dict +api_alert_list_widget_dict = api_alert_list_widget_instance.to_dict() +# create an instance of ApiAlertListWidget from a dict +api_alert_list_widget_form_dict = api_alert_list_widget.from_dict(api_alert_list_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiAlertListWidgetAllOfActiveWithin.md b/dashboards_api/docs/ApiAlertListWidgetAllOfActiveWithin.md new file mode 100644 index 00000000..0c599206 --- /dev/null +++ b/dashboards_api/docs/ApiAlertListWidgetAllOfActiveWithin.md @@ -0,0 +1,29 @@ +# ApiAlertListWidgetAllOfActiveWithin + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | Timespan value. | [optional] +**unit** | [**DurationUnit**](DurationUnit.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_alert_list_widget_all_of_active_within import ApiAlertListWidgetAllOfActiveWithin + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAlertListWidgetAllOfActiveWithin from a JSON string +api_alert_list_widget_all_of_active_within_instance = ApiAlertListWidgetAllOfActiveWithin.from_json(json) +# print the JSON string representation of the object +print ApiAlertListWidgetAllOfActiveWithin.to_json() + +# convert the object into a dict +api_alert_list_widget_all_of_active_within_dict = api_alert_list_widget_all_of_active_within_instance.to_dict() +# create an instance of ApiAlertListWidgetAllOfActiveWithin from a dict +api_alert_list_widget_all_of_active_within_form_dict = api_alert_list_widget_all_of_active_within.from_dict(api_alert_list_widget_all_of_active_within_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiBoxAndWhiskersWidget.md b/dashboards_api/docs/ApiBoxAndWhiskersWidget.md new file mode 100644 index 00000000..4eab8cf2 --- /dev/null +++ b/dashboards_api/docs/ApiBoxAndWhiskersWidget.md @@ -0,0 +1,48 @@ +# ApiBoxAndWhiskersWidget + +A widget that displays a box and whisker plot, mapping data points over time with key statistics: median, range, and quartiles. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**min_scale** | **float** | Mininum scale configured in the widget. | [optional] +**max_scale** | **float** | Maximum scale configured in the widget. | [optional] +**unit** | [**ApiWidgetFixedYScalePrefix**](ApiWidgetFixedYScalePrefix.md) | | [optional] +**group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**data_source** | [**BoxAndWhiskersDatasource**](BoxAndWhiskersDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_box_and_whiskers_widget import ApiBoxAndWhiskersWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiBoxAndWhiskersWidget from a JSON string +api_box_and_whiskers_widget_instance = ApiBoxAndWhiskersWidget.from_json(json) +# print the JSON string representation of the object +print ApiBoxAndWhiskersWidget.to_json() + +# convert the object into a dict +api_box_and_whiskers_widget_dict = api_box_and_whiskers_widget_instance.to_dict() +# create an instance of ApiBoxAndWhiskersWidget from a dict +api_box_and_whiskers_widget_form_dict = api_box_and_whiskers_widget.from_dict(api_box_and_whiskers_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiColorGridWidget.md b/dashboards_api/docs/ApiColorGridWidget.md new file mode 100644 index 00000000..dc1f6cd0 --- /dev/null +++ b/dashboards_api/docs/ApiColorGridWidget.md @@ -0,0 +1,53 @@ +# ApiColorGridWidget + +The Color Grid widget displays colored cards arranged in rows and columns. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**min_scale** | **float** | Mininum scale configured in the widget. | [optional] +**max_scale** | **float** | Maximum scale configured in the widget. | [optional] +**unit** | [**ApiWidgetFixedYScalePrefix**](ApiWidgetFixedYScalePrefix.md) | | [optional] +**cards** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**group_cards_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**columns** | **int** | Number of columns: 1 or 2. | [optional] +**limit** | **int** | Limit configured in the widget. | [optional] +**sort_by** | [**WidgetSortProperty**](WidgetSortProperty.md) | | [optional] +**sort_direction** | [**WidgetSortDirection**](WidgetSortDirection.md) | | [optional] +**data_source** | [**ColorGridDatasource**](ColorGridDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_color_grid_widget import ApiColorGridWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiColorGridWidget from a JSON string +api_color_grid_widget_instance = ApiColorGridWidget.from_json(json) +# print the JSON string representation of the object +print ApiColorGridWidget.to_json() + +# convert the object into a dict +api_color_grid_widget_dict = api_color_grid_widget_instance.to_dict() +# create an instance of ApiColorGridWidget from a dict +api_color_grid_widget_form_dict = api_color_grid_widget.from_dict(api_color_grid_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiDashboard.md b/dashboards_api/docs/ApiDashboard.md new file mode 100644 index 00000000..2874e0ef --- /dev/null +++ b/dashboards_api/docs/ApiDashboard.md @@ -0,0 +1,43 @@ +# ApiDashboard + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**DashboardLinksLinks**](DashboardLinksLinks.md) | | [optional] +**dashboard_id** | **str** | Identifier of a dashboard. | [optional] [readonly] +**title** | **str** | Title of a dashboard. | [optional] +**is_built_in** | **bool** | Indicates if a dashboard is built-in. True for built-in dashboards, false for user-created dashboards. | [optional] [readonly] +**aid** | **str** | Identifier for the account group associated with a dashboard. | [optional] [readonly] +**dashboard_created_by** | **str** | Identifier for the user that created a dashboard. | [optional] [readonly] +**dashboard_modified_by** | **str** | Identifier for the user that last modified a dashboard. | [optional] [readonly] +**dashboard_modified_date** | **datetime** | UTC date/time when a dashboard was last modified (ISO date-time format). | [optional] [readonly] +**is_private** | **bool** | A dashboard can be viewed by other users in the account. If true, only the creator of the dashboard may view it. If false, all users in the same account may view it. | [optional] +**is_default_for_user** | **bool** | Indicates whether this dashboard is the user's default. True for default, false if not. | [optional] [readonly] +**is_default_for_account** | **bool** | Indicates whether this dashboard is the account group's default. True for default, false if not. | [optional] [readonly] +**widgets** | [**List[ApiWidget]**](ApiWidget.md) | | [optional] +**description** | **str** | A text description of the dashboard's purpose and functionality. This information assists users in understanding the dashboard but isn't displayed when viewing a dashboard. | [optional] +**default_timespan** | [**ApiDefaultTimespan**](ApiDefaultTimespan.md) | | [optional] +**is_global_override** | **bool** | When set to `true`, the defaultTimespan is used and overrides the widget's timespan. If set to `false`, the the widget's timespan is used. | [optional] +**is_migrated_report** | **bool** | True if this dashboard was previously a report. | [optional] [readonly] + +## Example + +```python +from dashboards_api.models.api_dashboard import ApiDashboard + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiDashboard from a JSON string +api_dashboard_instance = ApiDashboard.from_json(json) +# print the JSON string representation of the object +print ApiDashboard.to_json() + +# convert the object into a dict +api_dashboard_dict = api_dashboard_instance.to_dict() +# create an instance of ApiDashboard from a dict +api_dashboard_form_dict = api_dashboard.from_dict(api_dashboard_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiDashboardAsw.md b/dashboards_api/docs/ApiDashboardAsw.md new file mode 100644 index 00000000..3145be33 --- /dev/null +++ b/dashboards_api/docs/ApiDashboardAsw.md @@ -0,0 +1,36 @@ +# ApiDashboardAsw + +Alert suppression window shown in a widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the alert suppression window. | [optional] +**name** | **str** | Name of the alert suppression window. | [optional] +**test_ids** | **List[str]** | | [optional] +**start_times** | **List[datetime]** | | [optional] +**duration_in_seconds** | **int** | | [optional] +**repeat** | [**AswRepeat**](AswRepeat.md) | | [optional] +**repeat_every** | **int** | | [optional] +**repeat_unit** | [**AswRepeatUnit**](AswRepeatUnit.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_dashboard_asw import ApiDashboardAsw + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiDashboardAsw from a JSON string +api_dashboard_asw_instance = ApiDashboardAsw.from_json(json) +# print the JSON string representation of the object +print ApiDashboardAsw.to_json() + +# convert the object into a dict +api_dashboard_asw_dict = api_dashboard_asw_instance.to_dict() +# create an instance of ApiDashboardAsw from a dict +api_dashboard_asw_form_dict = api_dashboard_asw.from_dict(api_dashboard_asw_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiDashboardSnapshot.md b/dashboards_api/docs/ApiDashboardSnapshot.md new file mode 100644 index 00000000..254c45fe --- /dev/null +++ b/dashboards_api/docs/ApiDashboardSnapshot.md @@ -0,0 +1,38 @@ +# ApiDashboardSnapshot + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**DashboardSnapshotLinksLinks**](DashboardSnapshotLinksLinks.md) | | [optional] +**snapshot_id** | **str** | Identifier of the dashboard snapshot. | [optional] +**snapshot_name** | **str** | Name of the dashboard snapshot. | [optional] +**aid** | **str** | Identifier of the account group that the snapshot belongs to. | [optional] +**is_shared** | **bool** | Set `true` if dashboard snapshot is shared, `false` otherwise. | [optional] +**snapshot_created_date** | **datetime** | UTC date when dashboard snapshot was created (ISO date-time format). | [optional] +**dashboard** | [**ApiDashboardSnapshotAllOfDashboard**](ApiDashboardSnapshotAllOfDashboard.md) | | [optional] +**widgets** | [**List[ApiWidget]**](ApiWidget.md) | | [optional] +**is_scheduled** | **bool** | Set `true` if dashboard snapshot was generated from a schedule, `false` otherwise. | [optional] +**time_span** | [**ApiReportSnapshotTimeSpan**](ApiReportSnapshotTimeSpan.md) | | [optional] +**snapshot_expiration_date** | **datetime** | Expiration date of the snapshot. If unspecified, the snapshot expires 1 year from its creation date. The expiration date must be set within 5 years from the current date and adhere to the ISO date-time format. | [optional] + +## Example + +```python +from dashboards_api.models.api_dashboard_snapshot import ApiDashboardSnapshot + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiDashboardSnapshot from a JSON string +api_dashboard_snapshot_instance = ApiDashboardSnapshot.from_json(json) +# print the JSON string representation of the object +print ApiDashboardSnapshot.to_json() + +# convert the object into a dict +api_dashboard_snapshot_dict = api_dashboard_snapshot_instance.to_dict() +# create an instance of ApiDashboardSnapshot from a dict +api_dashboard_snapshot_form_dict = api_dashboard_snapshot.from_dict(api_dashboard_snapshot_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiDashboardSnapshotAllOfDashboard.md b/dashboards_api/docs/ApiDashboardSnapshotAllOfDashboard.md new file mode 100644 index 00000000..7ae8ef96 --- /dev/null +++ b/dashboards_api/docs/ApiDashboardSnapshotAllOfDashboard.md @@ -0,0 +1,43 @@ +# ApiDashboardSnapshotAllOfDashboard + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dashboard_id** | **str** | Identifier of a dashboard. | [optional] [readonly] +**title** | **str** | Title of a dashboard. | [optional] +**is_built_in** | **bool** | Indicates if a dashboard is built-in. True for built-in dashboards, false for user-created dashboards. | [optional] [readonly] +**aid** | **str** | Identifier for the account group associated with a dashboard. | [optional] [readonly] +**dashboard_created_by** | **str** | Identifier for the user that created a dashboard. | [optional] [readonly] +**dashboard_modified_by** | **str** | Identifier for the user that last modified a dashboard. | [optional] [readonly] +**dashboard_modified_date** | **datetime** | UTC date/time when a dashboard was last modified (ISO date-time format). | [optional] [readonly] +**is_private** | **bool** | A dashboard can be viewed by other users in the account. If true, only the creator of the dashboard may view it. If false, all users in the same account may view it. | [optional] +**is_default_for_user** | **bool** | Indicates whether this dashboard is the user's default. True for default, false if not. | [optional] [readonly] +**is_default_for_account** | **bool** | Indicates whether this dashboard is the account group's default. True for default, false if not. | [optional] [readonly] +**widgets** | [**List[ApiWidget]**](ApiWidget.md) | | [optional] +**description** | **str** | A text description of the dashboard's purpose and functionality. This information assists users in understanding the dashboard but isn't displayed when viewing a dashboard. | [optional] +**default_timespan** | [**ApiDefaultTimespan**](ApiDefaultTimespan.md) | | [optional] +**is_global_override** | **bool** | When set to `true`, the defaultTimespan is used and overrides the widget's timespan. If set to `false`, the the widget's timespan is used. | [optional] +**is_migrated_report** | **bool** | True if this dashboard was previously a report. | [optional] [readonly] +**links** | [**DashboardLinksLinks**](DashboardLinksLinks.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_dashboard_snapshot_all_of_dashboard import ApiDashboardSnapshotAllOfDashboard + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiDashboardSnapshotAllOfDashboard from a JSON string +api_dashboard_snapshot_all_of_dashboard_instance = ApiDashboardSnapshotAllOfDashboard.from_json(json) +# print the JSON string representation of the object +print ApiDashboardSnapshotAllOfDashboard.to_json() + +# convert the object into a dict +api_dashboard_snapshot_all_of_dashboard_dict = api_dashboard_snapshot_all_of_dashboard_instance.to_dict() +# create an instance of ApiDashboardSnapshotAllOfDashboard from a dict +api_dashboard_snapshot_all_of_dashboard_form_dict = api_dashboard_snapshot_all_of_dashboard.from_dict(api_dashboard_snapshot_all_of_dashboard_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiDataPointGroup.md b/dashboards_api/docs/ApiDataPointGroup.md new file mode 100644 index 00000000..12fa9edc --- /dev/null +++ b/dashboards_api/docs/ApiDataPointGroup.md @@ -0,0 +1,30 @@ +# ApiDataPointGroup + +Group of data points. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group_property** | **str** | Defines the criterion used to aggregate data points under specific group values. | [optional] +**group_value** | **str** | The value of a group. | [optional] + +## Example + +```python +from dashboards_api.models.api_data_point_group import ApiDataPointGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiDataPointGroup from a JSON string +api_data_point_group_instance = ApiDataPointGroup.from_json(json) +# print the JSON string representation of the object +print ApiDataPointGroup.to_json() + +# convert the object into a dict +api_data_point_group_dict = api_data_point_group_instance.to_dict() +# create an instance of ApiDataPointGroup from a dict +api_data_point_group_form_dict = api_data_point_group.from_dict(api_data_point_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) + + diff --git a/dashboards_api/docs/ApiDefaultTimespan.md b/dashboards_api/docs/ApiDefaultTimespan.md new file mode 100644 index 00000000..707b59e2 --- /dev/null +++ b/dashboards_api/docs/ApiDefaultTimespan.md @@ -0,0 +1,30 @@ +# ApiDefaultTimespan + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**duration** | **int** | Relative timespan in seconds. | [optional] +**start** | **datetime** | UTC start date of the timespan range (ISO date-time format). | [optional] +**end** | **datetime** | UTC end date of the timespan range (ISO date-time format). | [optional] + +## Example + +```python +from dashboards_api.models.api_default_timespan import ApiDefaultTimespan + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiDefaultTimespan from a JSON string +api_default_timespan_instance = ApiDefaultTimespan.from_json(json) +# print the JSON string representation of the object +print ApiDefaultTimespan.to_json() + +# convert the object into a dict +api_default_timespan_dict = api_default_timespan_instance.to_dict() +# create an instance of ApiDefaultTimespan from a dict +api_default_timespan_form_dict = api_default_timespan.from_dict(api_default_timespan_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiDuration.md b/dashboards_api/docs/ApiDuration.md new file mode 100644 index 00000000..aa2ea107 --- /dev/null +++ b/dashboards_api/docs/ApiDuration.md @@ -0,0 +1,29 @@ +# ApiDuration + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | Timespan value. | [optional] +**unit** | [**DurationUnit**](DurationUnit.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_duration import ApiDuration + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiDuration from a JSON string +api_duration_instance = ApiDuration.from_json(json) +# print the JSON string representation of the object +print ApiDuration.to_json() + +# convert the object into a dict +api_duration_dict = api_duration_instance.to_dict() +# create an instance of ApiDuration from a dict +api_duration_form_dict = api_duration.from_dict(api_duration_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiGeoMapWidget.md b/dashboards_api/docs/ApiGeoMapWidget.md new file mode 100644 index 00000000..10451c03 --- /dev/null +++ b/dashboards_api/docs/ApiGeoMapWidget.md @@ -0,0 +1,51 @@ +# ApiGeoMapWidget + +Displays data on a geographic map, highlighting information across different regions. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**min_scale** | **float** | Mininum scale configured in the widget. | [optional] +**max_scale** | **float** | Maximum scale configured in the widget. | [optional] +**unit** | [**ApiWidgetFixedYScalePrefix**](ApiWidgetFixedYScalePrefix.md) | | [optional] +**group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**is_geo_map_per_test** | **bool** | Indicates whether a separate map is displayed for each test within the widget. When set to true, individual maps are generated. | [optional] +**sort_by** | [**WidgetSortProperty**](WidgetSortProperty.md) | | [optional] +**sort_direction** | [**WidgetSortDirection**](WidgetSortDirection.md) | | [optional] +**data_source** | [**GeoMapDatasource**](GeoMapDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_geo_map_widget import ApiGeoMapWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiGeoMapWidget from a JSON string +api_geo_map_widget_instance = ApiGeoMapWidget.from_json(json) +# print the JSON string representation of the object +print ApiGeoMapWidget.to_json() + +# convert the object into a dict +api_geo_map_widget_dict = api_geo_map_widget_instance.to_dict() +# create an instance of ApiGeoMapWidget from a dict +api_geo_map_widget_form_dict = api_geo_map_widget.from_dict(api_geo_map_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiGraphletPoint.md b/dashboards_api/docs/ApiGraphletPoint.md new file mode 100644 index 00000000..f13a16ae --- /dev/null +++ b/dashboards_api/docs/ApiGraphletPoint.md @@ -0,0 +1,30 @@ +# ApiGraphletPoint + +A data point on a graphlet. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**x** | **int** | Timestamp of the data point. | [optional] +**y** | **float** | Value of the data point. | [optional] + +## Example + +```python +from dashboards_api.models.api_graphlet_point import ApiGraphletPoint + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiGraphletPoint from a JSON string +api_graphlet_point_instance = ApiGraphletPoint.from_json(json) +# print the JSON string representation of the object +print ApiGraphletPoint.to_json() + +# convert the object into a dict +api_graphlet_point_dict = api_graphlet_point_instance.to_dict() +# create an instance of ApiGraphletPoint from a dict +api_graphlet_point_form_dict = api_graphlet_point.from_dict(api_graphlet_point_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiGroupedBarchartWidget.md b/dashboards_api/docs/ApiGroupedBarchartWidget.md new file mode 100644 index 00000000..b96f199e --- /dev/null +++ b/dashboards_api/docs/ApiGroupedBarchartWidget.md @@ -0,0 +1,51 @@ +# ApiGroupedBarchartWidget + +Displays grouped bars, each representing multiple data points. You can configure the bars to align horizontally or vertically. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**axis_group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**sort_by** | [**WidgetSortProperty**](WidgetSortProperty.md) | | [optional] +**sort_direction** | [**WidgetSortDirection**](WidgetSortDirection.md) | | [optional] +**limit** | **int** | Limit configured in the widget. | [optional] +**show_labels** | **bool** | Displays labels on each bar when set to `true`. | [optional] +**is_horizontal_bar_chart** | **bool** | | [optional] +**data_source** | [**GroupedBarChartDatasource**](GroupedBarChartDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_grouped_barchart_widget import ApiGroupedBarchartWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiGroupedBarchartWidget from a JSON string +api_grouped_barchart_widget_instance = ApiGroupedBarchartWidget.from_json(json) +# print the JSON string representation of the object +print ApiGroupedBarchartWidget.to_json() + +# convert the object into a dict +api_grouped_barchart_widget_dict = api_grouped_barchart_widget_instance.to_dict() +# create an instance of ApiGroupedBarchartWidget from a dict +api_grouped_barchart_widget_form_dict = api_grouped_barchart_widget.from_dict(api_grouped_barchart_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiMultiMetricColumn.md b/dashboards_api/docs/ApiMultiMetricColumn.md new file mode 100644 index 00000000..dd948409 --- /dev/null +++ b/dashboards_api/docs/ApiMultiMetricColumn.md @@ -0,0 +1,35 @@ +# ApiMultiMetricColumn + +Defines a column within a table that aggregates and displays various metrics (Multi-Metric table). + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**data_source** | [**MultiMetricsTableDatasource**](MultiMetricsTableDatasource.md) | | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_multi_metric_column import ApiMultiMetricColumn + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiMultiMetricColumn from a JSON string +api_multi_metric_column_instance = ApiMultiMetricColumn.from_json(json) +# print the JSON string representation of the object +print ApiMultiMetricColumn.to_json() + +# convert the object into a dict +api_multi_metric_column_dict = api_multi_metric_column_instance.to_dict() +# create an instance of ApiMultiMetricColumn from a dict +api_multi_metric_column_form_dict = api_multi_metric_column.from_dict(api_multi_metric_column_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiMultiMetricColumnData.md b/dashboards_api/docs/ApiMultiMetricColumnData.md new file mode 100644 index 00000000..b123389a --- /dev/null +++ b/dashboards_api/docs/ApiMultiMetricColumnData.md @@ -0,0 +1,33 @@ +# ApiMultiMetricColumnData + +The data presented within a single column of a Multi-Metric table. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**column_id** | **str** | Identifier of the column. | [optional] +**bin_size** | **int** | Duration of each bin. | [optional] +**points** | [**List[ApiWidgetDataPoint]**](ApiWidgetDataPoint.md) | | [optional] +**status** | **str** | Message for not fully configured card or no data. | [optional] +**alert_suppression_windows** | [**List[ApiDashboardAsw]**](ApiDashboardAsw.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_multi_metric_column_data import ApiMultiMetricColumnData + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiMultiMetricColumnData from a JSON string +api_multi_metric_column_data_instance = ApiMultiMetricColumnData.from_json(json) +# print the JSON string representation of the object +print ApiMultiMetricColumnData.to_json() + +# convert the object into a dict +api_multi_metric_column_data_dict = api_multi_metric_column_data_instance.to_dict() +# create an instance of ApiMultiMetricColumnData from a dict +api_multi_metric_column_data_form_dict = api_multi_metric_column_data.from_dict(api_multi_metric_column_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiMultiMetricTableWidget.md b/dashboards_api/docs/ApiMultiMetricTableWidget.md new file mode 100644 index 00000000..a5fe4234 --- /dev/null +++ b/dashboards_api/docs/ApiMultiMetricTableWidget.md @@ -0,0 +1,50 @@ +# ApiMultiMetricTableWidget + +A Multi-Metric table widget with columns, each representing a different metric, offering a comprehensive view rather than restricting to a single metric. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**compare_to_previous_value** | **bool** | Enables comparison of the current metric value with the previous value. | [optional] +**row_group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**sort_by** | [**WidgetSortProperty**](WidgetSortProperty.md) | | [optional] +**sort_direction** | [**WidgetSortDirection**](WidgetSortDirection.md) | | [optional] +**limit** | **int** | Limit configured in the widget. | [optional] +**multi_metric_columns** | [**List[ApiMultiMetricColumn]**](ApiMultiMetricColumn.md) | | [optional] +**data_source** | [**MultiMetricsTableDatasource**](MultiMetricsTableDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_multi_metric_table_widget import ApiMultiMetricTableWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiMultiMetricTableWidget from a JSON string +api_multi_metric_table_widget_instance = ApiMultiMetricTableWidget.from_json(json) +# print the JSON string representation of the object +print ApiMultiMetricTableWidget.to_json() + +# convert the object into a dict +api_multi_metric_table_widget_dict = api_multi_metric_table_widget_instance.to_dict() +# create an instance of ApiMultiMetricTableWidget from a dict +api_multi_metric_table_widget_form_dict = api_multi_metric_table_widget.from_dict(api_multi_metric_table_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiMultiSearchFilterApiTestTableFilterKey.md b/dashboards_api/docs/ApiMultiSearchFilterApiTestTableFilterKey.md new file mode 100644 index 00000000..e0264733 --- /dev/null +++ b/dashboards_api/docs/ApiMultiSearchFilterApiTestTableFilterKey.md @@ -0,0 +1,30 @@ +# ApiMultiSearchFilterApiTestTableFilterKey + +A multi search filter key within the Multi-Metric table widget. The key represents the filter name, and the value specifies the filter value. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | [**TestTableFilterKey**](TestTableFilterKey.md) | | [optional] +**value** | **str** | | [optional] + +## Example + +```python +from dashboards_api.models.api_multi_search_filter_api_test_table_filter_key import ApiMultiSearchFilterApiTestTableFilterKey + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiMultiSearchFilterApiTestTableFilterKey from a JSON string +api_multi_search_filter_api_test_table_filter_key_instance = ApiMultiSearchFilterApiTestTableFilterKey.from_json(json) +# print the JSON string representation of the object +print ApiMultiSearchFilterApiTestTableFilterKey.to_json() + +# convert the object into a dict +api_multi_search_filter_api_test_table_filter_key_dict = api_multi_search_filter_api_test_table_filter_key_instance.to_dict() +# create an instance of ApiMultiSearchFilterApiTestTableFilterKey from a dict +api_multi_search_filter_api_test_table_filter_key_form_dict = api_multi_search_filter_api_test_table_filter_key.from_dict(api_multi_search_filter_api_test_table_filter_key_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiNumbersCard.md b/dashboards_api/docs/ApiNumbersCard.md new file mode 100644 index 00000000..219116af --- /dev/null +++ b/dashboards_api/docs/ApiNumbersCard.md @@ -0,0 +1,42 @@ +# ApiNumbersCard + +An individual number card within the numbers card widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**min_scale** | **float** | Mininum scale configured in the widget. | [optional] +**max_scale** | **float** | Maximum scale configured in the widget. | [optional] +**unit** | [**ApiWidgetFixedYScalePrefix**](ApiWidgetFixedYScalePrefix.md) | | [optional] +**id** | **str** | Identifier of the widget. | [optional] +**description** | **str** | Description of the number card. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**compare_to_previous_value** | **bool** | | [optional] +**fixed_timespan** | [**ApiNumbersCardAllOfFixedTimespan**](ApiNumbersCardAllOfFixedTimespan.md) | | [optional] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression windows from the widget when set to `true`. | [optional] +**data_source** | [**NumbersCardDatasource**](NumbersCardDatasource.md) | | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | Filters to apply to the widget. | [optional] + +## Example + +```python +from dashboards_api.models.api_numbers_card import ApiNumbersCard + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiNumbersCard from a JSON string +api_numbers_card_instance = ApiNumbersCard.from_json(json) +# print the JSON string representation of the object +print ApiNumbersCard.to_json() + +# convert the object into a dict +api_numbers_card_dict = api_numbers_card_instance.to_dict() +# create an instance of ApiNumbersCard from a dict +api_numbers_card_form_dict = api_numbers_card.from_dict(api_numbers_card_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiNumbersCardAllOfFixedTimespan.md b/dashboards_api/docs/ApiNumbersCardAllOfFixedTimespan.md new file mode 100644 index 00000000..b30db568 --- /dev/null +++ b/dashboards_api/docs/ApiNumbersCardAllOfFixedTimespan.md @@ -0,0 +1,29 @@ +# ApiNumbersCardAllOfFixedTimespan + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | Timespan value. | [optional] +**unit** | [**DurationUnit**](DurationUnit.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_numbers_card_all_of_fixed_timespan import ApiNumbersCardAllOfFixedTimespan + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiNumbersCardAllOfFixedTimespan from a JSON string +api_numbers_card_all_of_fixed_timespan_instance = ApiNumbersCardAllOfFixedTimespan.from_json(json) +# print the JSON string representation of the object +print ApiNumbersCardAllOfFixedTimespan.to_json() + +# convert the object into a dict +api_numbers_card_all_of_fixed_timespan_dict = api_numbers_card_all_of_fixed_timespan_instance.to_dict() +# create an instance of ApiNumbersCardAllOfFixedTimespan from a dict +api_numbers_card_all_of_fixed_timespan_form_dict = api_numbers_card_all_of_fixed_timespan.from_dict(api_numbers_card_all_of_fixed_timespan_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiNumbersCardData.md b/dashboards_api/docs/ApiNumbersCardData.md new file mode 100644 index 00000000..faba9e7e --- /dev/null +++ b/dashboards_api/docs/ApiNumbersCardData.md @@ -0,0 +1,38 @@ +# ApiNumbersCardData + +The data displayed on a numbers card. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**card_id** | **str** | Identifier of the card. | [optional] +**start_date** | **datetime** | UTC start date of the data shown in the API output (ISO date-time format). | [optional] +**end_date** | **datetime** | UTC end date of the data shown in the API output (ISO date-time format). | [optional] +**previous_value** | **float** | Previous value if `compareToPreviousValue == true` in configuration. | [optional] +**bin_size** | **int** | Duration of each bin. | [optional] +**timestamp** | **int** | Timestamp of the aggregated data point. | [optional] +**number_of_data_points** | **int** | Number of points aggregated into the data point | [optional] +**value** | **float** | Aggregated value. | [optional] +**status** | **str** | Message for not fully configured card or no data. | [optional] +**alert_suppression_windows** | [**List[ApiDashboardAsw]**](ApiDashboardAsw.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_numbers_card_data import ApiNumbersCardData + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiNumbersCardData from a JSON string +api_numbers_card_data_instance = ApiNumbersCardData.from_json(json) +# print the JSON string representation of the object +print ApiNumbersCardData.to_json() + +# convert the object into a dict +api_numbers_card_data_dict = api_numbers_card_data_instance.to_dict() +# create an instance of ApiNumbersCardData from a dict +api_numbers_card_data_form_dict = api_numbers_card_data.from_dict(api_numbers_card_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiNumbersCardWidget.md b/dashboards_api/docs/ApiNumbersCardWidget.md new file mode 100644 index 00000000..37c6c1c9 --- /dev/null +++ b/dashboards_api/docs/ApiNumbersCardWidget.md @@ -0,0 +1,45 @@ +# ApiNumbersCardWidget + +A widget composed of multiple cards, each presenting a singular metric, such as average packet loss, page load time, or alert count. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**number_cards** | [**List[ApiNumbersCard]**](ApiNumbersCard.md) | | [optional] +**data_source** | [**NumbersCardDatasource**](NumbersCardDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_numbers_card_widget import ApiNumbersCardWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiNumbersCardWidget from a JSON string +api_numbers_card_widget_instance = ApiNumbersCardWidget.from_json(json) +# print the JSON string representation of the object +print ApiNumbersCardWidget.to_json() + +# convert the object into a dict +api_numbers_card_widget_dict = api_numbers_card_widget_instance.to_dict() +# create an instance of ApiNumbersCardWidget from a dict +api_numbers_card_widget_form_dict = api_numbers_card_widget.from_dict(api_numbers_card_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiPieChartWidget.md b/dashboards_api/docs/ApiPieChartWidget.md new file mode 100644 index 00000000..930446fb --- /dev/null +++ b/dashboards_api/docs/ApiPieChartWidget.md @@ -0,0 +1,45 @@ +# ApiPieChartWidget + +Displays data as segments of a pie, with each slice representing a portion of the total value. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**data_source** | [**PieChartDatasource**](PieChartDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_pie_chart_widget import ApiPieChartWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiPieChartWidget from a JSON string +api_pie_chart_widget_instance = ApiPieChartWidget.from_json(json) +# print the JSON string representation of the object +print ApiPieChartWidget.to_json() + +# convert the object into a dict +api_pie_chart_widget_dict = api_pie_chart_widget_instance.to_dict() +# create an instance of ApiPieChartWidget from a dict +api_pie_chart_widget_form_dict = api_pie_chart_widget.from_dict(api_pie_chart_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiReportDataComponentLabelMap.md b/dashboards_api/docs/ApiReportDataComponentLabelMap.md new file mode 100644 index 00000000..bbe721a4 --- /dev/null +++ b/dashboards_api/docs/ApiReportDataComponentLabelMap.md @@ -0,0 +1,30 @@ +# ApiReportDataComponentLabelMap + +Map of group labels. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group_property** | **str** | Defines the criterion used to aggregate data points under specific group values. | [optional] +**group_labels** | [**List[ApiReportDataComponentLabelMapEntry]**](ApiReportDataComponentLabelMapEntry.md) | List of group labels. | [optional] + +## Example + +```python +from dashboards_api.models.api_report_data_component_label_map import ApiReportDataComponentLabelMap + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiReportDataComponentLabelMap from a JSON string +api_report_data_component_label_map_instance = ApiReportDataComponentLabelMap.from_json(json) +# print the JSON string representation of the object +print ApiReportDataComponentLabelMap.to_json() + +# convert the object into a dict +api_report_data_component_label_map_dict = api_report_data_component_label_map_instance.to_dict() +# create an instance of ApiReportDataComponentLabelMap from a dict +api_report_data_component_label_map_form_dict = api_report_data_component_label_map.from_dict(api_report_data_component_label_map_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiReportDataComponentLabelMapEntry.md b/dashboards_api/docs/ApiReportDataComponentLabelMapEntry.md new file mode 100644 index 00000000..8036caca --- /dev/null +++ b/dashboards_api/docs/ApiReportDataComponentLabelMapEntry.md @@ -0,0 +1,30 @@ +# ApiReportDataComponentLabelMapEntry + +Represents a mapping entry of a group label. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group_id** | **str** | Identifier of the group. | [optional] +**group_label** | **str** | Label of the group. | [optional] + +## Example + +```python +from dashboards_api.models.api_report_data_component_label_map_entry import ApiReportDataComponentLabelMapEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiReportDataComponentLabelMapEntry from a JSON string +api_report_data_component_label_map_entry_instance = ApiReportDataComponentLabelMapEntry.from_json(json) +# print the JSON string representation of the object +print ApiReportDataComponentLabelMapEntry.to_json() + +# convert the object into a dict +api_report_data_component_label_map_entry_dict = api_report_data_component_label_map_entry_instance.to_dict() +# create an instance of ApiReportDataComponentLabelMapEntry from a dict +api_report_data_component_label_map_entry_form_dict = api_report_data_component_label_map_entry.from_dict(api_report_data_component_label_map_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiReportSnapshotTimeSpan.md b/dashboards_api/docs/ApiReportSnapshotTimeSpan.md new file mode 100644 index 00000000..fd33df93 --- /dev/null +++ b/dashboards_api/docs/ApiReportSnapshotTimeSpan.md @@ -0,0 +1,30 @@ +# ApiReportSnapshotTimeSpan + +Time span of the dashboard snapshot. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start** | **datetime** | UTC start date of dashboard snapshot (ISO date-time format). | [optional] +**duration** | **int** | Duration of dashboard snapshot in seconds. | [optional] + +## Example + +```python +from dashboards_api.models.api_report_snapshot_time_span import ApiReportSnapshotTimeSpan + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiReportSnapshotTimeSpan from a JSON string +api_report_snapshot_time_span_instance = ApiReportSnapshotTimeSpan.from_json(json) +# print the JSON string representation of the object +print ApiReportSnapshotTimeSpan.to_json() + +# convert the object into a dict +api_report_snapshot_time_span_dict = api_report_snapshot_time_span_instance.to_dict() +# create an instance of ApiReportSnapshotTimeSpan from a dict +api_report_snapshot_time_span_form_dict = api_report_snapshot_time_span.from_dict(api_report_snapshot_time_span_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiStackedAreaChartWidget.md b/dashboards_api/docs/ApiStackedAreaChartWidget.md new file mode 100644 index 00000000..2070f645 --- /dev/null +++ b/dashboards_api/docs/ApiStackedAreaChartWidget.md @@ -0,0 +1,48 @@ +# ApiStackedAreaChartWidget + +Displays line plots over time, stacking quantities vertically to showcase cumulative data trends, similar to stacked bar charts. Ideal for visualizing changes in response times, error counts, and other metrics, revealing the progression of values across a timeline. Use this chart to replace stacked bar charts for temporal data analysis. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**min_scale** | **float** | Mininum scale configured in the widget. | [optional] +**max_scale** | **float** | Maximum scale configured in the widget. | [optional] +**unit** | [**ApiWidgetFixedYScalePrefix**](ApiWidgetFixedYScalePrefix.md) | | [optional] +**group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**data_source** | [**StackedAreaChartDatasource**](StackedAreaChartDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_stacked_area_chart_widget import ApiStackedAreaChartWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiStackedAreaChartWidget from a JSON string +api_stacked_area_chart_widget_instance = ApiStackedAreaChartWidget.from_json(json) +# print the JSON string representation of the object +print ApiStackedAreaChartWidget.to_json() + +# convert the object into a dict +api_stacked_area_chart_widget_dict = api_stacked_area_chart_widget_instance.to_dict() +# create an instance of ApiStackedAreaChartWidget from a dict +api_stacked_area_chart_widget_form_dict = api_stacked_area_chart_widget.from_dict(api_stacked_area_chart_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiStackedBarchartWidget.md b/dashboards_api/docs/ApiStackedBarchartWidget.md new file mode 100644 index 00000000..abbb9a28 --- /dev/null +++ b/dashboards_api/docs/ApiStackedBarchartWidget.md @@ -0,0 +1,49 @@ +# ApiStackedBarchartWidget + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**axis_group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**sort_by** | [**WidgetSortProperty**](WidgetSortProperty.md) | | [optional] +**sort_direction** | [**WidgetSortDirection**](WidgetSortDirection.md) | | [optional] +**limit** | **int** | Limit configured in the widget. | [optional] +**show_labels** | **bool** | | [optional] +**is_horizontal_bar_chart** | **bool** | Set to `true` to display bars horizontally in the widget. | [optional] +**data_source** | [**StackedBarChartDatasource**](StackedBarChartDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_stacked_barchart_widget import ApiStackedBarchartWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiStackedBarchartWidget from a JSON string +api_stacked_barchart_widget_instance = ApiStackedBarchartWidget.from_json(json) +# print the JSON string representation of the object +print ApiStackedBarchartWidget.to_json() + +# convert the object into a dict +api_stacked_barchart_widget_dict = api_stacked_barchart_widget_instance.to_dict() +# create an instance of ApiStackedBarchartWidget from a dict +api_stacked_barchart_widget_form_dict = api_stacked_barchart_widget.from_dict(api_stacked_barchart_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiTableWidget.md b/dashboards_api/docs/ApiTableWidget.md new file mode 100644 index 00000000..61e23f15 --- /dev/null +++ b/dashboards_api/docs/ApiTableWidget.md @@ -0,0 +1,50 @@ +# ApiTableWidget + +Organizes data in rows and columns, with options to list by test, geographic location, data source, or aggregated categories. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**compare_to_previous_value** | **bool** | | [optional] +**row_group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**column_group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**sort_by** | [**WidgetSortProperty**](WidgetSortProperty.md) | | [optional] +**sort_direction** | [**WidgetSortDirection**](WidgetSortDirection.md) | | [optional] +**limit** | **int** | Limit configured in the widget. | [optional] +**data_source** | [**TableDatasource**](TableDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_table_widget import ApiTableWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiTableWidget from a JSON string +api_table_widget_instance = ApiTableWidget.from_json(json) +# print the JSON string representation of the object +print ApiTableWidget.to_json() + +# convert the object into a dict +api_table_widget_dict = api_table_widget_instance.to_dict() +# create an instance of ApiTableWidget from a dict +api_table_widget_form_dict = api_table_widget.from_dict(api_table_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiTestTableData.md b/dashboards_api/docs/ApiTestTableData.md new file mode 100644 index 00000000..496d7b01 --- /dev/null +++ b/dashboards_api/docs/ApiTestTableData.md @@ -0,0 +1,35 @@ +# ApiTestTableData + +Data shown in a test table widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**test_id** | **str** | Identifier of the test. | [optional] +**test_name** | **str** | Name of the test. | [optional] +**target** | **str** | Configured target of the test. | [optional] +**test_type** | **str** | Type of the test. | [optional] +**alert_count** | **int** | Number of active alerts of the test. | [optional] +**is_shared** | **bool** | Set to `true` if test is shared, `false` otherwise. | [optional] +**graphlets** | [**List[ApiTestTableGraphletsData]**](ApiTestTableGraphletsData.md) | List of time series points for test metrics in the last 12 hours. | [optional] + +## Example + +```python +from dashboards_api.models.api_test_table_data import ApiTestTableData + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiTestTableData from a JSON string +api_test_table_data_instance = ApiTestTableData.from_json(json) +# print the JSON string representation of the object +print ApiTestTableData.to_json() + +# convert the object into a dict +api_test_table_data_dict = api_test_table_data_instance.to_dict() +# create an instance of ApiTestTableData from a dict +api_test_table_data_form_dict = api_test_table_data.from_dict(api_test_table_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiTestTableGraphletsData.md b/dashboards_api/docs/ApiTestTableGraphletsData.md new file mode 100644 index 00000000..cf8cf87f --- /dev/null +++ b/dashboards_api/docs/ApiTestTableGraphletsData.md @@ -0,0 +1,31 @@ +# ApiTestTableGraphletsData + +Information displayed within a mini-graph associated with a specific test in a table. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metric** | **str** | Name of the metric. | [optional] +**test_id** | **str** | Identifier of the test. | [optional] +**points** | [**List[ApiGraphletPoint]**](ApiGraphletPoint.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_test_table_graphlets_data import ApiTestTableGraphletsData + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiTestTableGraphletsData from a JSON string +api_test_table_graphlets_data_instance = ApiTestTableGraphletsData.from_json(json) +# print the JSON string representation of the object +print ApiTestTableGraphletsData.to_json() + +# convert the object into a dict +api_test_table_graphlets_data_dict = api_test_table_graphlets_data_instance.to_dict() +# create an instance of ApiTestTableGraphletsData from a dict +api_test_table_graphlets_data_form_dict = api_test_table_graphlets_data.from_dict(api_test_table_graphlets_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiTestTableWidget.md b/dashboards_api/docs/ApiTestTableWidget.md new file mode 100644 index 00000000..2887eb8d --- /dev/null +++ b/dashboards_api/docs/ApiTestTableWidget.md @@ -0,0 +1,46 @@ +# ApiTestTableWidget + +Displays tests and statuses with options to sort and filter. It can be set to show only certain tests, like those with specific labels or failing tests. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**filter** | [**ApiWidgetFilterApiTestTableFilterKey**](ApiWidgetFilterApiTestTableFilterKey.md) | | [optional] +**exclude** | [**ApiWidgetFilterApiTestTableFilterKey**](ApiWidgetFilterApiTestTableFilterKey.md) | | [optional] +**data_source** | [**TestTableDatasource**](TestTableDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_test_table_widget import ApiTestTableWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiTestTableWidget from a JSON string +api_test_table_widget_instance = ApiTestTableWidget.from_json(json) +# print the JSON string representation of the object +print ApiTestTableWidget.to_json() + +# convert the object into a dict +api_test_table_widget_dict = api_test_table_widget_instance.to_dict() +# create an instance of ApiTestTableWidget from a dict +api_test_table_widget_form_dict = api_test_table_widget.from_dict(api_test_table_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiTimeseriesWidget.md b/dashboards_api/docs/ApiTimeseriesWidget.md new file mode 100644 index 00000000..3b09ef8c --- /dev/null +++ b/dashboards_api/docs/ApiTimeseriesWidget.md @@ -0,0 +1,50 @@ +# ApiTimeseriesWidget + +The Timeseries widget graphs data over time, with the chosen metric displayed on the vertical axis. vertical axis + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**min_scale** | **float** | Mininum scale configured in the widget. | [optional] +**max_scale** | **float** | Maximum scale configured in the widget. | [optional] +**unit** | [**ApiWidgetFixedYScalePrefix**](ApiWidgetFixedYScalePrefix.md) | | [optional] +**show_timeseries_overall_baseline** | **bool** | Displays the overall baseline if set to `true`. | [optional] +**group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**is_timeseries_one_chart_per_line** | **bool** | Displays a separate chart for each line if set to `true`. | [optional] +**data_source** | [**TimeseriesDatasource**](TimeseriesDatasource.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_timeseries_widget import ApiTimeseriesWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiTimeseriesWidget from a JSON string +api_timeseries_widget_instance = ApiTimeseriesWidget.from_json(json) +# print the JSON string representation of the object +print ApiTimeseriesWidget.to_json() + +# convert the object into a dict +api_timeseries_widget_dict = api_timeseries_widget_instance.to_dict() +# create an instance of ApiTimeseriesWidget from a dict +api_timeseries_widget_form_dict = api_timeseries_widget.from_dict(api_timeseries_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiWidget.md b/dashboards_api/docs/ApiWidget.md new file mode 100644 index 00000000..d7a27bd9 --- /dev/null +++ b/dashboards_api/docs/ApiWidget.md @@ -0,0 +1,71 @@ +# ApiWidget + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**agents** | [**AgentWidgetType**](AgentWidgetType.md) | | [optional] +**show** | [**AgentWidgetShow**](AgentWidgetShow.md) | | [optional] +**data_source** | [**TimeseriesDatasource**](TimeseriesDatasource.md) | | [optional] +**alert_types** | [**List[ApiAlertListAlertType]**](ApiAlertListAlertType.md) | List of alert types configured in the widget, an empty list means all alert types. | [optional] +**limit_to** | **int** | Limit the number of alerts displayed in the widget. | [optional] +**active_within** | [**ApiAlertListWidgetAllOfActiveWithin**](ApiAlertListWidgetAllOfActiveWithin.md) | | [optional] +**min_scale** | **float** | Mininum scale configured in the widget. | [optional] +**max_scale** | **float** | Maximum scale configured in the widget. | [optional] +**unit** | [**ApiWidgetFixedYScalePrefix**](ApiWidgetFixedYScalePrefix.md) | | [optional] +**group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**cards** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**group_cards_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**columns** | **int** | Number of columns: 1 or 2. | [optional] +**limit** | **int** | Limit configured in the widget. | [optional] +**sort_by** | [**WidgetSortProperty**](WidgetSortProperty.md) | | [optional] +**sort_direction** | [**WidgetSortDirection**](WidgetSortDirection.md) | | [optional] +**is_geo_map_per_test** | **bool** | Indicates whether a separate map is displayed for each test within the widget. When set to true, individual maps are generated. | [optional] +**axis_group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**show_labels** | **bool** | | [optional] +**is_horizontal_bar_chart** | **bool** | Set to `true` to display bars horizontally in the widget. | [optional] +**compare_to_previous_value** | **bool** | | [optional] +**row_group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**multi_metric_columns** | [**List[ApiMultiMetricColumn]**](ApiMultiMetricColumn.md) | | [optional] +**number_cards** | [**List[ApiNumbersCard]**](ApiNumbersCard.md) | | [optional] +**column_group_by** | [**ApiAggregateProperty**](ApiAggregateProperty.md) | | [optional] +**filter** | [**ApiWidgetFilterApiTestTableFilterKey**](ApiWidgetFilterApiTestTableFilterKey.md) | | [optional] +**exclude** | [**ApiWidgetFilterApiTestTableFilterKey**](ApiWidgetFilterApiTestTableFilterKey.md) | | [optional] +**show_timeseries_overall_baseline** | **bool** | Displays the overall baseline if set to `true`. | [optional] +**is_timeseries_one_chart_per_line** | **bool** | Displays a separate chart for each line if set to `true`. | [optional] + +## Example + +```python +from dashboards_api.models.api_widget import ApiWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiWidget from a JSON string +api_widget_instance = ApiWidget.from_json(json) +# print the JSON string representation of the object +print ApiWidget.to_json() + +# convert the object into a dict +api_widget_dict = api_widget_instance.to_dict() +# create an instance of ApiWidget from a dict +api_widget_form_dict = api_widget.from_dict(api_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiWidgetDataPoint.md b/dashboards_api/docs/ApiWidgetDataPoint.md new file mode 100644 index 00000000..2d473fab --- /dev/null +++ b/dashboards_api/docs/ApiWidgetDataPoint.md @@ -0,0 +1,32 @@ +# ApiWidgetDataPoint + +Data point of a widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Timestamp of the aggregated data point. | [optional] +**number_of_data_points** | **int** | Number of test data points aggregated into the widget data point. | [optional] +**value** | **float** | Aggregated value. | [optional] +**groups** | [**List[ApiDataPointGroup]**](ApiDataPointGroup.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_widget_data_point import ApiWidgetDataPoint + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiWidgetDataPoint from a JSON string +api_widget_data_point_instance = ApiWidgetDataPoint.from_json(json) +# print the JSON string representation of the object +print ApiWidgetDataPoint.to_json() + +# convert the object into a dict +api_widget_data_point_dict = api_widget_data_point_instance.to_dict() +# create an instance of ApiWidgetDataPoint from a dict +api_widget_data_point_form_dict = api_widget_data_point.from_dict(api_widget_data_point_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiWidgetDataResponse.md b/dashboards_api/docs/ApiWidgetDataResponse.md new file mode 100644 index 00000000..f30ed88d --- /dev/null +++ b/dashboards_api/docs/ApiWidgetDataResponse.md @@ -0,0 +1,31 @@ +# ApiWidgetDataResponse + +Response of a widget data request. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group_labels** | [**List[ApiReportDataComponentLabelMap]**](ApiReportDataComponentLabelMap.md) | | [optional] +**bin_size** | **int** | Duration of each bin. | [optional] +**data** | [**ApiWidgetsDataV2**](ApiWidgetsDataV2.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_widget_data_response import ApiWidgetDataResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiWidgetDataResponse from a JSON string +api_widget_data_response_instance = ApiWidgetDataResponse.from_json(json) +# print the JSON string representation of the object +print ApiWidgetDataResponse.to_json() + +# convert the object into a dict +api_widget_data_response_dict = api_widget_data_response_instance.to_dict() +# create an instance of ApiWidgetDataResponse from a dict +api_widget_data_response_form_dict = api_widget_data_response.from_dict(api_widget_data_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiWidgetFilterApiTestTableFilterKey.md b/dashboards_api/docs/ApiWidgetFilterApiTestTableFilterKey.md new file mode 100644 index 00000000..dc7ecb8b --- /dev/null +++ b/dashboards_api/docs/ApiWidgetFilterApiTestTableFilterKey.md @@ -0,0 +1,29 @@ +# ApiWidgetFilterApiTestTableFilterKey + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filters** | [**List[ApiMultiSearchFilterApiTestTableFilterKey]**](ApiMultiSearchFilterApiTestTableFilterKey.md) | | [optional] +**type** | [**TestTableFilterType**](TestTableFilterType.md) | | [optional] + +## Example + +```python +from dashboards_api.models.api_widget_filter_api_test_table_filter_key import ApiWidgetFilterApiTestTableFilterKey + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiWidgetFilterApiTestTableFilterKey from a JSON string +api_widget_filter_api_test_table_filter_key_instance = ApiWidgetFilterApiTestTableFilterKey.from_json(json) +# print the JSON string representation of the object +print ApiWidgetFilterApiTestTableFilterKey.to_json() + +# convert the object into a dict +api_widget_filter_api_test_table_filter_key_dict = api_widget_filter_api_test_table_filter_key_instance.to_dict() +# create an instance of ApiWidgetFilterApiTestTableFilterKey from a dict +api_widget_filter_api_test_table_filter_key_form_dict = api_widget_filter_api_test_table_filter_key.from_dict(api_widget_filter_api_test_table_filter_key_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiWidgetFixedYScalePrefix.md b/dashboards_api/docs/ApiWidgetFixedYScalePrefix.md new file mode 100644 index 00000000..7f02bca8 --- /dev/null +++ b/dashboards_api/docs/ApiWidgetFixedYScalePrefix.md @@ -0,0 +1,11 @@ +# ApiWidgetFixedYScalePrefix + +Prefix denoting the unit of measurement for the fixed Y-axis scale. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiWidgetMeasure.md b/dashboards_api/docs/ApiWidgetMeasure.md new file mode 100644 index 00000000..6ad2b6c9 --- /dev/null +++ b/dashboards_api/docs/ApiWidgetMeasure.md @@ -0,0 +1,30 @@ +# ApiWidgetMeasure + +Determines how to aggregate the the metric. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**WidgetMeasureType**](WidgetMeasureType.md) | | [optional] +**percentile_value** | **float** | The percentile value to use when `type == NTH_PERCENTILE`. | [optional] + +## Example + +```python +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiWidgetMeasure from a JSON string +api_widget_measure_instance = ApiWidgetMeasure.from_json(json) +# print the JSON string representation of the object +print ApiWidgetMeasure.to_json() + +# convert the object into a dict +api_widget_measure_dict = api_widget_measure_instance.to_dict() +# create an instance of ApiWidgetMeasure from a dict +api_widget_measure_form_dict = api_widget_measure.from_dict(api_widget_measure_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ApiWidgetsDataV2.md b/dashboards_api/docs/ApiWidgetsDataV2.md new file mode 100644 index 00000000..e375e7fb --- /dev/null +++ b/dashboards_api/docs/ApiWidgetsDataV2.md @@ -0,0 +1,40 @@ +# ApiWidgetsDataV2 + +Data of a widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cards** | [**List[ApiNumbersCardData]**](ApiNumbersCardData.md) | | [optional] +**columns** | [**List[ApiMultiMetricColumnData]**](ApiMultiMetricColumnData.md) | | [optional] +**points** | [**List[ApiWidgetDataPoint]**](ApiWidgetDataPoint.md) | | [optional] +**tests** | [**List[ApiTestTableData]**](ApiTestTableData.md) | | [optional] +**start_round** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] +**alert_suppression_windows** | [**List[ApiDashboardAsw]**](ApiDashboardAsw.md) | | [optional] +**total_alerts** | **int** | Total number of active alerts within configured timespan. | [optional] +**active_alerts** | **int** | Total number of currently active alerts. | [optional] +**alerts** | [**List[ApiAlertListAlert]**](ApiAlertListAlert.md) | | [optional] +**summary** | [**ApiAgentStatusSummary**](ApiAgentStatusSummary.md) | | [optional] +**agents** | [**List[ApiAgentStatusAgent]**](ApiAgentStatusAgent.md) | | [optional] +**status** | **str** | Message for not fully configured card or no data. | [optional] + +## Example + +```python +from dashboards_api.models.api_widgets_data_v2 import ApiWidgetsDataV2 + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiWidgetsDataV2 from a JSON string +api_widgets_data_v2_instance = ApiWidgetsDataV2.from_json(json) +# print the JSON string representation of the object +print ApiWidgetsDataV2.to_json() + +# convert the object into a dict +api_widgets_data_v2_dict = api_widgets_data_v2_instance.to_dict() +# create an instance of ApiWidgetsDataV2 from a dict +api_widgets_data_v2_form_dict = api_widgets_data_v2.from_dict(api_widgets_data_v2_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/AswRepeat.md b/dashboards_api/docs/AswRepeat.md new file mode 100644 index 00000000..9b64db4e --- /dev/null +++ b/dashboards_api/docs/AswRepeat.md @@ -0,0 +1,10 @@ +# AswRepeat + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/AswRepeatUnit.md b/dashboards_api/docs/AswRepeatUnit.md new file mode 100644 index 00000000..6e5d3dfe --- /dev/null +++ b/dashboards_api/docs/AswRepeatUnit.md @@ -0,0 +1,10 @@ +# AswRepeatUnit + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/BoxAndWhiskersDatasource.md b/dashboards_api/docs/BoxAndWhiskersDatasource.md new file mode 100644 index 00000000..6e2e6c6c --- /dev/null +++ b/dashboards_api/docs/BoxAndWhiskersDatasource.md @@ -0,0 +1,11 @@ +# BoxAndWhiskersDatasource + +Datasource of the box and whiskers widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ColorGridDatasource.md b/dashboards_api/docs/ColorGridDatasource.md new file mode 100644 index 00000000..40c06ada --- /dev/null +++ b/dashboards_api/docs/ColorGridDatasource.md @@ -0,0 +1,11 @@ +# ColorGridDatasource + +Datasource of the color grid widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/DashboardLinks.md b/dashboards_api/docs/DashboardLinks.md new file mode 100644 index 00000000..8bd46291 --- /dev/null +++ b/dashboards_api/docs/DashboardLinks.md @@ -0,0 +1,29 @@ +# DashboardLinks + +A links object containing the self and the snapshots links. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**DashboardLinksLinks**](DashboardLinksLinks.md) | | [optional] + +## Example + +```python +from dashboards_api.models.dashboard_links import DashboardLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of DashboardLinks from a JSON string +dashboard_links_instance = DashboardLinks.from_json(json) +# print the JSON string representation of the object +print DashboardLinks.to_json() + +# convert the object into a dict +dashboard_links_dict = dashboard_links_instance.to_dict() +# create an instance of DashboardLinks from a dict +dashboard_links_form_dict = dashboard_links.from_dict(dashboard_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/DashboardLinksLinks.md b/dashboards_api/docs/DashboardLinksLinks.md new file mode 100644 index 00000000..18da6dcd --- /dev/null +++ b/dashboards_api/docs/DashboardLinksLinks.md @@ -0,0 +1,29 @@ +# DashboardLinksLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] +**snapshots** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from dashboards_api.models.dashboard_links_links import DashboardLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of DashboardLinksLinks from a JSON string +dashboard_links_links_instance = DashboardLinksLinks.from_json(json) +# print the JSON string representation of the object +print DashboardLinksLinks.to_json() + +# convert the object into a dict +dashboard_links_links_dict = dashboard_links_links_instance.to_dict() +# create an instance of DashboardLinksLinks from a dict +dashboard_links_links_form_dict = dashboard_links_links.from_dict(dashboard_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/DashboardMetric.md b/dashboards_api/docs/DashboardMetric.md new file mode 100644 index 00000000..cbb0ca18 --- /dev/null +++ b/dashboards_api/docs/DashboardMetric.md @@ -0,0 +1,11 @@ +# DashboardMetric + +Indicates the specific metric in the report, determined by the layer, test type, and metric values. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/DashboardMetricDirection.md b/dashboards_api/docs/DashboardMetricDirection.md new file mode 100644 index 00000000..211b1c06 --- /dev/null +++ b/dashboards_api/docs/DashboardMetricDirection.md @@ -0,0 +1,11 @@ +# DashboardMetricDirection + +Direction of agent to agent metric. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/DashboardOrder.md b/dashboards_api/docs/DashboardOrder.md new file mode 100644 index 00000000..f48c1964 --- /dev/null +++ b/dashboards_api/docs/DashboardOrder.md @@ -0,0 +1,10 @@ +# DashboardOrder + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/DashboardSnapshotLinks.md b/dashboards_api/docs/DashboardSnapshotLinks.md new file mode 100644 index 00000000..d723de5d --- /dev/null +++ b/dashboards_api/docs/DashboardSnapshotLinks.md @@ -0,0 +1,29 @@ +# DashboardSnapshotLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**DashboardSnapshotLinksLinks**](DashboardSnapshotLinksLinks.md) | | [optional] + +## Example + +```python +from dashboards_api.models.dashboard_snapshot_links import DashboardSnapshotLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of DashboardSnapshotLinks from a JSON string +dashboard_snapshot_links_instance = DashboardSnapshotLinks.from_json(json) +# print the JSON string representation of the object +print DashboardSnapshotLinks.to_json() + +# convert the object into a dict +dashboard_snapshot_links_dict = dashboard_snapshot_links_instance.to_dict() +# create an instance of DashboardSnapshotLinks from a dict +dashboard_snapshot_links_form_dict = dashboard_snapshot_links.from_dict(dashboard_snapshot_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/DashboardSnapshotLinksLinks.md b/dashboards_api/docs/DashboardSnapshotLinksLinks.md new file mode 100644 index 00000000..063dccff --- /dev/null +++ b/dashboards_api/docs/DashboardSnapshotLinksLinks.md @@ -0,0 +1,29 @@ +# DashboardSnapshotLinksLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] +**app_link** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from dashboards_api.models.dashboard_snapshot_links_links import DashboardSnapshotLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of DashboardSnapshotLinksLinks from a JSON string +dashboard_snapshot_links_links_instance = DashboardSnapshotLinksLinks.from_json(json) +# print the JSON string representation of the object +print DashboardSnapshotLinksLinks.to_json() + +# convert the object into a dict +dashboard_snapshot_links_links_dict = dashboard_snapshot_links_links_instance.to_dict() +# create an instance of DashboardSnapshotLinksLinks from a dict +dashboard_snapshot_links_links_form_dict = dashboard_snapshot_links_links.from_dict(dashboard_snapshot_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/DashboardSnapshots200Response.md b/dashboards_api/docs/DashboardSnapshots200Response.md new file mode 100644 index 00000000..c075b6a8 --- /dev/null +++ b/dashboards_api/docs/DashboardSnapshots200Response.md @@ -0,0 +1,29 @@ +# DashboardSnapshots200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dashboard_snapshots** | [**List[ApiDashboardSnapshot]**](ApiDashboardSnapshot.md) | | [optional] +**links** | [**PaginationLinksLinks**](PaginationLinksLinks.md) | | [optional] + +## Example + +```python +from dashboards_api.models.dashboard_snapshots200_response import DashboardSnapshots200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of DashboardSnapshots200Response from a JSON string +dashboard_snapshots200_response_instance = DashboardSnapshots200Response.from_json(json) +# print the JSON string representation of the object +print DashboardSnapshots200Response.to_json() + +# convert the object into a dict +dashboard_snapshots200_response_dict = dashboard_snapshots200_response_instance.to_dict() +# create an instance of DashboardSnapshots200Response from a dict +dashboard_snapshots200_response_form_dict = dashboard_snapshots200_response.from_dict(dashboard_snapshots200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/DashboardSnapshotsApi.md b/dashboards_api/docs/DashboardSnapshotsApi.md new file mode 100644 index 00000000..315e26ad --- /dev/null +++ b/dashboards_api/docs/DashboardSnapshotsApi.md @@ -0,0 +1,526 @@ +# dashboards_api.DashboardSnapshotsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_dashboard_snapshot**](DashboardSnapshotsApi.md#create_dashboard_snapshot) | **POST** /v7/dashboard-snapshots | Create dashboard snapshot +[**dashboard_snapshot_by_id**](DashboardSnapshotsApi.md#dashboard_snapshot_by_id) | **GET** /v7/dashboard-snapshots/{snapshotId} | Retrieve dashboard snapshot +[**dashboard_snapshots**](DashboardSnapshotsApi.md#dashboard_snapshots) | **GET** /v7/dashboard-snapshots | List dashboard snapshots +[**delete_dashboard_snapshot**](DashboardSnapshotsApi.md#delete_dashboard_snapshot) | **DELETE** /v7/dashboard-snapshots/{snapshotId} | Delete dashboard snapshot +[**snapshot_data_by_widget**](DashboardSnapshotsApi.md#snapshot_data_by_widget) | **GET** /v7/dashboard-snapshots/{snapshotId}/widgets/{widgetId} | Retrieve dashboard snapshot data +[**update_snapshot_expiration_date**](DashboardSnapshotsApi.md#update_snapshot_expiration_date) | **PATCH** /v7/dashboard-snapshots/{snapshotId} | Update snapshot expiration + + +# **create_dashboard_snapshot** +> ApiDashboardSnapshot create_dashboard_snapshot(generate_dashboard_snapshot_request, aid=aid) + +Create dashboard snapshot + +Creates a new dashboard snapshot within your account group. The `Edit Snapshots` permission is required to use this endpoint. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import dashboards_api +from dashboards_api.models.api_dashboard_snapshot import ApiDashboardSnapshot +from dashboards_api.models.generate_dashboard_snapshot_request import GenerateDashboardSnapshotRequest +from dashboards_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 = dashboards_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 = dashboards_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with dashboards_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = dashboards_api.DashboardSnapshotsApi(api_client) + generate_dashboard_snapshot_request = dashboards_api.GenerateDashboardSnapshotRequest() # GenerateDashboardSnapshotRequest | Request body schema to create a dashboard snapshot. + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create dashboard snapshot + api_response = api_instance.create_dashboard_snapshot(generate_dashboard_snapshot_request, aid=aid) + print("The response of DashboardSnapshotsApi->create_dashboard_snapshot:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DashboardSnapshotsApi->create_dashboard_snapshot: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **generate_dashboard_snapshot_request** | [**GenerateDashboardSnapshotRequest**](GenerateDashboardSnapshotRequest.md)| Request body schema to create a dashboard snapshot. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiDashboardSnapshot**](ApiDashboardSnapshot.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 | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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 | - | + +[[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) + +# **dashboard_snapshot_by_id** +> ApiDashboardSnapshot dashboard_snapshot_by_id(snapshot_id, aid=aid) + +Retrieve dashboard snapshot + +This endpoint returns a list of widgets configured in dashboard snapshot configured in ThousandEyes. Seed this endpoint with a snapshotId found from the /dashboard-snapshots endpoint. This endpoint requires the `View Snapshots` permission be assigned to the role of the user accessing this endpoint. Returns a list of widgets configured within a dashboard snapshot. Use the `snapshotId` obtained from the `/dashboard-snapshots` endpoint. The `View Snapshots` permission is required to use this endpoint.\" + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import dashboards_api +from dashboards_api.models.api_dashboard_snapshot import ApiDashboardSnapshot +from dashboards_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 = dashboards_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 = dashboards_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with dashboards_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = dashboards_api.DashboardSnapshotsApi(api_client) + snapshot_id = 'd28bb71f-5a47-4783-8f12-d4b115e61b0c' # str | A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. + 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 dashboard snapshot + api_response = api_instance.dashboard_snapshot_by_id(snapshot_id, aid=aid) + print("The response of DashboardSnapshotsApi->dashboard_snapshot_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DashboardSnapshotsApi->dashboard_snapshot_by_id: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **snapshot_id** | **str**| A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiDashboardSnapshot**](ApiDashboardSnapshot.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 | - | +**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 | - | + +[[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) + +# **dashboard_snapshots** +> DashboardSnapshots200Response dashboard_snapshots(aid=aid, dashboard_id=dashboard_id, cursor=cursor) + +List dashboard snapshots + +Returns a list of dashboard snapshots within your account group. Use this data to identify a specific dashboard snapshot, which can be used in other endpoints to access aggregated data. The `View Snapshots` permission is required to use this endpoint.\" + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import dashboards_api +from dashboards_api.models.dashboard_snapshots200_response import DashboardSnapshots200Response +from dashboards_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 = dashboards_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 = dashboards_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with dashboards_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = dashboards_api.DashboardSnapshotsApi(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) + dashboard_id = '646f4d2ce3c99b0536c3821e' # str | (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # List dashboard snapshots + api_response = api_instance.dashboard_snapshots(aid=aid, dashboard_id=dashboard_id, cursor=cursor) + print("The response of DashboardSnapshotsApi->dashboard_snapshots:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DashboardSnapshotsApi->dashboard_snapshots: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **dashboard_id** | **str**| | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**DashboardSnapshots200Response**](DashboardSnapshots200Response.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 | - | +**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 | - | + +[[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) + +# **delete_dashboard_snapshot** +> delete_dashboard_snapshot(snapshot_id, aid=aid) + +Delete dashboard snapshot + +Deletes a dashboard snapshot using the `snapshotId` provided in the request. Users with the `Edit reports for all users in account group` permission (Account Admin) can delete any dashboard snapshot. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import dashboards_api +from dashboards_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 = dashboards_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 = dashboards_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with dashboards_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = dashboards_api.DashboardSnapshotsApi(api_client) + snapshot_id = 'd28bb71f-5a47-4783-8f12-d4b115e61b0c' # str | A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. + 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 dashboard snapshot + api_instance.delete_dashboard_snapshot(snapshot_id, aid=aid) + except Exception as e: + print("Exception when calling DashboardSnapshotsApi->delete_dashboard_snapshot: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **snapshot_id** | **str**| A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | - | +**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 | - | + +[[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) + +# **snapshot_data_by_widget** +> SnapshotDataByWidget200Response snapshot_data_by_widget(snapshot_id, widget_id, aid=aid) + +Retrieve dashboard snapshot data + +Returns actual metrics used in the generation of a dashboard snapshot. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import dashboards_api +from dashboards_api.models.snapshot_data_by_widget200_response import SnapshotDataByWidget200Response +from dashboards_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 = dashboards_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 = dashboards_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with dashboards_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = dashboards_api.DashboardSnapshotsApi(api_client) + snapshot_id = 'd28bb71f-5a47-4783-8f12-d4b115e61b0c' # str | A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. + widget_id = 'unpmg' # str | A Identifier for a widget. + 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 dashboard snapshot data + api_response = api_instance.snapshot_data_by_widget(snapshot_id, widget_id, aid=aid) + print("The response of DashboardSnapshotsApi->snapshot_data_by_widget:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DashboardSnapshotsApi->snapshot_data_by_widget: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **snapshot_id** | **str**| A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. | + **widget_id** | **str**| A Identifier for a widget. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**SnapshotDataByWidget200Response**](SnapshotDataByWidget200Response.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 | - | +**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 | - | + +[[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_snapshot_expiration_date** +> update_snapshot_expiration_date(snapshot_id, update_snapshot_expiration_date_api_request, aid=aid) + +Update snapshot expiration + +Updates the expiration date of a dashboard snapshot. The `Edit snapshots` permission is required to access this endpoint. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import dashboards_api +from dashboards_api.models.update_snapshot_expiration_date_api_request import UpdateSnapshotExpirationDateApiRequest +from dashboards_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 = dashboards_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 = dashboards_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with dashboards_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = dashboards_api.DashboardSnapshotsApi(api_client) + snapshot_id = 'd28bb71f-5a47-4783-8f12-d4b115e61b0c' # str | A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. + update_snapshot_expiration_date_api_request = dashboards_api.UpdateSnapshotExpirationDateApiRequest() # UpdateSnapshotExpirationDateApiRequest | Request body schema to update a snapshot expiration. + 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: + # Update snapshot expiration + api_instance.update_snapshot_expiration_date(snapshot_id, update_snapshot_expiration_date_api_request, aid=aid) + except Exception as e: + print("Exception when calling DashboardSnapshotsApi->update_snapshot_expiration_date: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **snapshot_id** | **str**| A Identifier for a dashboard snapshot which can be obtained from the `/dashboards-snapshots` endpoint. | + **update_snapshot_expiration_date_api_request** | [**UpdateSnapshotExpirationDateApiRequest**](UpdateSnapshotExpirationDateApiRequest.md)| Request body schema to update a snapshot expiration. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/hal+json + - **Accept**: application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/dashboards_api/docs/DashboardSnapshotsPage.md b/dashboards_api/docs/DashboardSnapshotsPage.md new file mode 100644 index 00000000..bd59d371 --- /dev/null +++ b/dashboards_api/docs/DashboardSnapshotsPage.md @@ -0,0 +1,29 @@ +# DashboardSnapshotsPage + +Dashboard snapshots page. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dashboard_snapshots** | [**List[ApiDashboardSnapshot]**](ApiDashboardSnapshot.md) | | [optional] + +## Example + +```python +from dashboards_api.models.dashboard_snapshots_page import DashboardSnapshotsPage + +# TODO update the JSON string below +json = "{}" +# create an instance of DashboardSnapshotsPage from a JSON string +dashboard_snapshots_page_instance = DashboardSnapshotsPage.from_json(json) +# print the JSON string representation of the object +print DashboardSnapshotsPage.to_json() + +# convert the object into a dict +dashboard_snapshots_page_dict = dashboard_snapshots_page_instance.to_dict() +# create an instance of DashboardSnapshotsPage from a dict +dashboard_snapshots_page_form_dict = dashboard_snapshots_page.from_dict(dashboard_snapshots_page_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/DashboardsApi.md b/dashboards_api/docs/DashboardsApi.md new file mode 100644 index 00000000..bb4fd6d1 --- /dev/null +++ b/dashboards_api/docs/DashboardsApi.md @@ -0,0 +1,538 @@ +# dashboards_api.DashboardsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_dashboard**](DashboardsApi.md#create_dashboard) | **POST** /v7/dashboards | Create dashboard +[**delete_dashboard**](DashboardsApi.md#delete_dashboard) | **DELETE** /v7/dashboards/{dashboardId} | Delete dashboard +[**get_dashboard_by_id**](DashboardsApi.md#get_dashboard_by_id) | **GET** /v7/dashboards/{dashboardId} | Retrieve dashboard +[**get_dashboard_data**](DashboardsApi.md#get_dashboard_data) | **GET** /v7/dashboards/{dashboardId}/widgets/{widgetId} | Retrieve dashboard widget data +[**get_dashboards_for_user**](DashboardsApi.md#get_dashboards_for_user) | **GET** /v7/dashboards | List dashboards +[**update_dashboard**](DashboardsApi.md#update_dashboard) | **PUT** /v7/dashboards/{dashboardId} | Update dashboard + + +# **create_dashboard** +> ApiDashboard create_dashboard(api_dashboard, aid=aid) + +Create dashboard + +Creates a new dashboard in your account group. To create a dashboard, you must have one of the following permissions: * `Edit dashboard templates for all users in account group` permission (Account Admin). * `Edit own dashboard templates` premission (Regular User). + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import dashboards_api +from dashboards_api.models.api_dashboard import ApiDashboard +from dashboards_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 = dashboards_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 = dashboards_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with dashboards_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = dashboards_api.DashboardsApi(api_client) + api_dashboard = dashboards_api.ApiDashboard() # ApiDashboard | Request body schema to create a dashboard. + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create dashboard + api_response = api_instance.create_dashboard(api_dashboard, aid=aid) + print("The response of DashboardsApi->create_dashboard:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DashboardsApi->create_dashboard: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **api_dashboard** | [**ApiDashboard**](ApiDashboard.md)| Request body schema to create a dashboard. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiDashboard**](ApiDashboard.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 | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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 | - | + +[[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) + +# **delete_dashboard** +> delete_dashboard(dashboard_id, aid=aid) + +Delete dashboard + +Deletes a dashboard using the `dashboardId` provided in the request. **Note**: * Users with the `Edit dashboard templates for all users in account group` permission (Account Admin) can delete any dashboard. * Users with the `Edit own dashboard templates` permission (Regular User) can only delete the dashboards they have created themselves. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import dashboards_api +from dashboards_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 = dashboards_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 = dashboards_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with dashboards_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = dashboards_api.DashboardsApi(api_client) + dashboard_id = '646f4d2ce3c99b0536c3821e' # str | A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. + 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 dashboard + api_instance.delete_dashboard(dashboard_id, aid=aid) + except Exception as e: + print("Exception when calling DashboardsApi->delete_dashboard: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dashboard_id** | **str**| A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | - | +**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 | - | + +[[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_dashboard_by_id** +> ApiDashboard get_dashboard_by_id(dashboard_id, aid=aid) + +Retrieve dashboard + +Returns a list of widgets within a dashboard, along with the dashboard's metadata. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import dashboards_api +from dashboards_api.models.api_dashboard import ApiDashboard +from dashboards_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 = dashboards_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 = dashboards_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with dashboards_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = dashboards_api.DashboardsApi(api_client) + dashboard_id = '646f4d2ce3c99b0536c3821e' # str | A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. + 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 dashboard + api_response = api_instance.get_dashboard_by_id(dashboard_id, aid=aid) + print("The response of DashboardsApi->get_dashboard_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DashboardsApi->get_dashboard_by_id: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dashboard_id** | **str**| A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiDashboard**](ApiDashboard.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 | - | +**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 | - | + +[[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_dashboard_data** +> GetDashboardData200Response get_dashboard_data(dashboard_id, widget_id, aid=aid, window=window, start_date=start_date, end_date=end_date, max=max, cursor=cursor, sort=sort, order=order) + +Retrieve dashboard widget data + +Returns the raw data displayed within a widget in the dashboard. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import dashboards_api +from dashboards_api.models.dashboard_order import DashboardOrder +from dashboards_api.models.get_dashboard_data200_response import GetDashboardData200Response +from dashboards_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 = dashboards_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 = dashboards_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with dashboards_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = dashboards_api.DashboardsApi(api_client) + dashboard_id = '646f4d2ce3c99b0536c3821e' # str | A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. + widget_id = 'unpmg' # str | A Identifier for a widget. + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + max = 10 # float | Optionally specify the maximum number of objects to retrieve. This only applies to the **Alert List** and **Test Table** Widgets. * The default for the **Alert List** widget is set by its limitBy configuration. * The default value for the **Test Table** widget is 10. (optional) + cursor = 'bGFzdFJvdW5kSWQ9MTY4MTQxMDQ4MA' # str | An optional pagination cursor. This parameter should not not be used directly. Instead, use the `_links` returned by the API. This feature is only available in the **Test Table** widget. (optional) + sort = 'alertStatus' # str | Optional sorting parameter with attributes listed comma-separated. This only applies to the **Alert List** and **Test Table** Widgets. * For the **Alert List** widget, you can sort by `alertStatus` or `startTime`. The default is `alertStatus`. * For the **Test Table** widget, you can sort by `alertStatus`, `testName`, or `testType`. The sequence might vary from the web application. The default sort attribute is `alertStatus`. (optional) + order = dashboards_api.DashboardOrder() # DashboardOrder | Optional sorting order parameter that accepts either `asc` (ascending) or `desc` (descending) values. This only applies to the **Alert List** and **Test Table** Widgets. (optional) + + try: + # Retrieve dashboard widget data + api_response = api_instance.get_dashboard_data(dashboard_id, widget_id, aid=aid, window=window, start_date=start_date, end_date=end_date, max=max, cursor=cursor, sort=sort, order=order) + print("The response of DashboardsApi->get_dashboard_data:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DashboardsApi->get_dashboard_data: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dashboard_id** | **str**| A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. | + **widget_id** | **str**| A Identifier for a widget. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **max** | **float**| Optionally specify the maximum number of objects to retrieve. This only applies to the **Alert List** and **Test Table** Widgets. * The default for the **Alert List** widget is set by its limitBy configuration. * The default value for the **Test Table** widget is 10. | [optional] + **cursor** | **str**| An optional pagination cursor. This parameter should not not be used directly. Instead, use the `_links` returned by the API. This feature is only available in the **Test Table** widget. | [optional] + **sort** | **str**| Optional sorting parameter with attributes listed comma-separated. This only applies to the **Alert List** and **Test Table** Widgets. * For the **Alert List** widget, you can sort by `alertStatus` or `startTime`. The default is `alertStatus`. * For the **Test Table** widget, you can sort by `alertStatus`, `testName`, or `testType`. The sequence might vary from the web application. The default sort attribute is `alertStatus`. | [optional] + **order** | [**DashboardOrder**](.md)| Optional sorting order parameter that accepts either `asc` (ascending) or `desc` (descending) values. This only applies to the **Alert List** and **Test Table** Widgets. | [optional] + +### Return type + +[**GetDashboardData200Response**](GetDashboardData200Response.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 | - | +**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 | - | + +[[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_dashboards_for_user** +> List[ApiDashboard] get_dashboards_for_user(aid=aid) + +List dashboards + +Returns a list of dashboards and their settings within your account group. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import dashboards_api +from dashboards_api.models.api_dashboard import ApiDashboard +from dashboards_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 = dashboards_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 = dashboards_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with dashboards_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = dashboards_api.DashboardsApi(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 dashboards + api_response = api_instance.get_dashboards_for_user(aid=aid) + print("The response of DashboardsApi->get_dashboards_for_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DashboardsApi->get_dashboards_for_user: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**List[ApiDashboard]**](ApiDashboard.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 | - | +**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 | - | + +[[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_dashboard** +> ApiDashboard update_dashboard(dashboard_id, api_dashboard, aid=aid) + +Update dashboard + +Updates an existing dashboard in your account group. **Note**: * Users with the `Edit dashboard templates for all users in account group` permission (Account Admin) can update any dashboard. * Users with the `Edit own dashboard templates` permission (Regular User) can only update the dashboards they have created themselves. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import dashboards_api +from dashboards_api.models.api_dashboard import ApiDashboard +from dashboards_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 = dashboards_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 = dashboards_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with dashboards_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = dashboards_api.DashboardsApi(api_client) + dashboard_id = '646f4d2ce3c99b0536c3821e' # str | A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. + api_dashboard = dashboards_api.ApiDashboard() # ApiDashboard | Request body schema to update a dashboard. + 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: + # Update dashboard + api_response = api_instance.update_dashboard(dashboard_id, api_dashboard, aid=aid) + print("The response of DashboardsApi->update_dashboard:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DashboardsApi->update_dashboard: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dashboard_id** | **str**| A Identifier for a dashboard which can be obtained from the `/dashboards` endpoint. | + **api_dashboard** | [**ApiDashboard**](ApiDashboard.md)| Request body schema to update a dashboard. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiDashboard**](ApiDashboard.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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/dashboards_api/docs/DurationUnit.md b/dashboards_api/docs/DurationUnit.md new file mode 100644 index 00000000..2664e06f --- /dev/null +++ b/dashboards_api/docs/DurationUnit.md @@ -0,0 +1,11 @@ +# DurationUnit + +Timespan unit. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/EnterpriseAgentState.md b/dashboards_api/docs/EnterpriseAgentState.md new file mode 100644 index 00000000..a9ec4b61 --- /dev/null +++ b/dashboards_api/docs/EnterpriseAgentState.md @@ -0,0 +1,11 @@ +# EnterpriseAgentState + +State of the agent. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/Error.md b/dashboards_api/docs/Error.md new file mode 100644 index 00000000..104fce5a --- /dev/null +++ b/dashboards_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from dashboards_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/GenerateDashboardSnapshotRequest.md b/dashboards_api/docs/GenerateDashboardSnapshotRequest.md new file mode 100644 index 00000000..dbb4dadb --- /dev/null +++ b/dashboards_api/docs/GenerateDashboardSnapshotRequest.md @@ -0,0 +1,35 @@ +# GenerateDashboardSnapshotRequest + +Request to generate a snapshot from a dashboard. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | Date and time to start aggregating data (ISO date-time format). | [optional] +**end_date** | **datetime** | Date and time to end aggregating data (ISO date-time format). | [optional] +**display_name** | **str** | The name of the snapshot, does not have to be unique. | [optional] +**dashboard_id** | **str** | TheIdentifierof the dashboard to generate a snapshot from | [optional] +**anonymize_data** | **bool** | Set to `true` to anonymize the data in the snapshot. | [optional] +**timezone** | **str** | Specifies the timezone used for date and time fields. | [optional] +**expiration_date** | **datetime** | Expiration date of the snapshot. If unspecified, the snapshot expires 1 year from its creation date. The expiration date must be set within 5 years from the current date and adhere to the ISO date-time format. | [optional] + +## Example + +```python +from dashboards_api.models.generate_dashboard_snapshot_request import GenerateDashboardSnapshotRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of GenerateDashboardSnapshotRequest from a JSON string +generate_dashboard_snapshot_request_instance = GenerateDashboardSnapshotRequest.from_json(json) +# print the JSON string representation of the object +print GenerateDashboardSnapshotRequest.to_json() + +# convert the object into a dict +generate_dashboard_snapshot_request_dict = generate_dashboard_snapshot_request_instance.to_dict() +# create an instance of GenerateDashboardSnapshotRequest from a dict +generate_dashboard_snapshot_request_form_dict = generate_dashboard_snapshot_request.from_dict(generate_dashboard_snapshot_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) + + diff --git a/dashboards_api/docs/GeoMapDatasource.md b/dashboards_api/docs/GeoMapDatasource.md new file mode 100644 index 00000000..9ebf6b11 --- /dev/null +++ b/dashboards_api/docs/GeoMapDatasource.md @@ -0,0 +1,11 @@ +# GeoMapDatasource + +Datasource of the geo map widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/GetDashboardData200Response.md b/dashboards_api/docs/GetDashboardData200Response.md new file mode 100644 index 00000000..93832298 --- /dev/null +++ b/dashboards_api/docs/GetDashboardData200Response.md @@ -0,0 +1,33 @@ +# GetDashboardData200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**group_labels** | [**List[ApiReportDataComponentLabelMap]**](ApiReportDataComponentLabelMap.md) | | [optional] +**bin_size** | **int** | Duration of each bin. | [optional] +**data** | [**ApiWidgetsDataV2**](ApiWidgetsDataV2.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from dashboards_api.models.get_dashboard_data200_response import GetDashboardData200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDashboardData200Response from a JSON string +get_dashboard_data200_response_instance = GetDashboardData200Response.from_json(json) +# print the JSON string representation of the object +print GetDashboardData200Response.to_json() + +# convert the object into a dict +get_dashboard_data200_response_dict = get_dashboard_data200_response_instance.to_dict() +# create an instance of GetDashboardData200Response from a dict +get_dashboard_data200_response_form_dict = get_dashboard_data200_response.from_dict(get_dashboard_data200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/GroupedBarChartDatasource.md b/dashboards_api/docs/GroupedBarChartDatasource.md new file mode 100644 index 00000000..72eb4e3d --- /dev/null +++ b/dashboards_api/docs/GroupedBarChartDatasource.md @@ -0,0 +1,11 @@ +# GroupedBarChartDatasource + +Datasource of the grouped bar chart widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/Link.md b/dashboards_api/docs/Link.md new file mode 100644 index 00000000..ae5285be --- /dev/null +++ b/dashboards_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from dashboards_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/MetricGroup.md b/dashboards_api/docs/MetricGroup.md new file mode 100644 index 00000000..8642e9b7 --- /dev/null +++ b/dashboards_api/docs/MetricGroup.md @@ -0,0 +1,11 @@ +# MetricGroup + +Metric group of widget as it appears in the UI. Note: may not be required in some cases. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/MultiMetricsTableDatasource.md b/dashboards_api/docs/MultiMetricsTableDatasource.md new file mode 100644 index 00000000..53d2a7e4 --- /dev/null +++ b/dashboards_api/docs/MultiMetricsTableDatasource.md @@ -0,0 +1,11 @@ +# MultiMetricsTableDatasource + +Datasource of the Multi-Metrics table widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/NumbersCardDatasource.md b/dashboards_api/docs/NumbersCardDatasource.md new file mode 100644 index 00000000..ba8fe7db --- /dev/null +++ b/dashboards_api/docs/NumbersCardDatasource.md @@ -0,0 +1,11 @@ +# NumbersCardDatasource + +Datasource of the numbers card widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/PaginationLinks.md b/dashboards_api/docs/PaginationLinks.md new file mode 100644 index 00000000..c25719a9 --- /dev/null +++ b/dashboards_api/docs/PaginationLinks.md @@ -0,0 +1,29 @@ +# PaginationLinks + +A links object containing pagination related link(s). + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**PaginationLinksLinks**](PaginationLinksLinks.md) | | [optional] + +## Example + +```python +from dashboards_api.models.pagination_links import PaginationLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationLinks from a JSON string +pagination_links_instance = PaginationLinks.from_json(json) +# print the JSON string representation of the object +print PaginationLinks.to_json() + +# convert the object into a dict +pagination_links_dict = pagination_links_instance.to_dict() +# create an instance of PaginationLinks from a dict +pagination_links_form_dict = pagination_links.from_dict(pagination_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/PaginationLinksLinks.md b/dashboards_api/docs/PaginationLinksLinks.md new file mode 100644 index 00000000..ae195131 --- /dev/null +++ b/dashboards_api/docs/PaginationLinksLinks.md @@ -0,0 +1,29 @@ +# PaginationLinksLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**previous** | [**Link**](Link.md) | | [optional] +**next** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from dashboards_api.models.pagination_links_links import PaginationLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationLinksLinks from a JSON string +pagination_links_links_instance = PaginationLinksLinks.from_json(json) +# print the JSON string representation of the object +print PaginationLinksLinks.to_json() + +# convert the object into a dict +pagination_links_links_dict = pagination_links_links_instance.to_dict() +# create an instance of PaginationLinksLinks from a dict +pagination_links_links_form_dict = pagination_links_links.from_dict(pagination_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/PieChartDatasource.md b/dashboards_api/docs/PieChartDatasource.md new file mode 100644 index 00000000..ff19a93b --- /dev/null +++ b/dashboards_api/docs/PieChartDatasource.md @@ -0,0 +1,11 @@ +# PieChartDatasource + +Datasource of the pie chart widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/QueryWindow.md b/dashboards_api/docs/QueryWindow.md new file mode 100644 index 00000000..b1b66646 --- /dev/null +++ b/dashboards_api/docs/QueryWindow.md @@ -0,0 +1,29 @@ +# QueryWindow + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] + +## Example + +```python +from dashboards_api.models.query_window import QueryWindow + +# TODO update the JSON string below +json = "{}" +# create an instance of QueryWindow from a JSON string +query_window_instance = QueryWindow.from_json(json) +# print the JSON string representation of the object +print QueryWindow.to_json() + +# convert the object into a dict +query_window_dict = query_window_instance.to_dict() +# create an instance of QueryWindow from a dict +query_window_form_dict = query_window.from_dict(query_window_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/ScalableWidget.md b/dashboards_api/docs/ScalableWidget.md new file mode 100644 index 00000000..8eb397af --- /dev/null +++ b/dashboards_api/docs/ScalableWidget.md @@ -0,0 +1,30 @@ +# ScalableWidget + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**min_scale** | **float** | Mininum scale configured in the widget. | [optional] +**max_scale** | **float** | Maximum scale configured in the widget. | [optional] +**unit** | [**ApiWidgetFixedYScalePrefix**](ApiWidgetFixedYScalePrefix.md) | | [optional] + +## Example + +```python +from dashboards_api.models.scalable_widget import ScalableWidget + +# TODO update the JSON string below +json = "{}" +# create an instance of ScalableWidget from a JSON string +scalable_widget_instance = ScalableWidget.from_json(json) +# print the JSON string representation of the object +print ScalableWidget.to_json() + +# convert the object into a dict +scalable_widget_dict = scalable_widget_instance.to_dict() +# create an instance of ScalableWidget from a dict +scalable_widget_form_dict = scalable_widget.from_dict(scalable_widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/SelfLinks.md b/dashboards_api/docs/SelfLinks.md new file mode 100644 index 00000000..4081cb23 --- /dev/null +++ b/dashboards_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from dashboards_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/SelfLinksLinks.md b/dashboards_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..6c0ec51e --- /dev/null +++ b/dashboards_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from dashboards_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/SnapshotDataByWidget200Response.md b/dashboards_api/docs/SnapshotDataByWidget200Response.md new file mode 100644 index 00000000..e908df5e --- /dev/null +++ b/dashboards_api/docs/SnapshotDataByWidget200Response.md @@ -0,0 +1,31 @@ +# SnapshotDataByWidget200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group_labels** | [**List[ApiReportDataComponentLabelMap]**](ApiReportDataComponentLabelMap.md) | | [optional] +**bin_size** | **int** | Duration of each bin. | [optional] +**data** | [**ApiWidgetsDataV2**](ApiWidgetsDataV2.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from dashboards_api.models.snapshot_data_by_widget200_response import SnapshotDataByWidget200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of SnapshotDataByWidget200Response from a JSON string +snapshot_data_by_widget200_response_instance = SnapshotDataByWidget200Response.from_json(json) +# print the JSON string representation of the object +print SnapshotDataByWidget200Response.to_json() + +# convert the object into a dict +snapshot_data_by_widget200_response_dict = snapshot_data_by_widget200_response_instance.to_dict() +# create an instance of SnapshotDataByWidget200Response from a dict +snapshot_data_by_widget200_response_form_dict = snapshot_data_by_widget200_response.from_dict(snapshot_data_by_widget200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/StackedAreaChartDatasource.md b/dashboards_api/docs/StackedAreaChartDatasource.md new file mode 100644 index 00000000..3e67f815 --- /dev/null +++ b/dashboards_api/docs/StackedAreaChartDatasource.md @@ -0,0 +1,11 @@ +# StackedAreaChartDatasource + +Datasource of the stacked area chart widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/StackedBarChartDatasource.md b/dashboards_api/docs/StackedBarChartDatasource.md new file mode 100644 index 00000000..28553e3a --- /dev/null +++ b/dashboards_api/docs/StackedBarChartDatasource.md @@ -0,0 +1,11 @@ +# StackedBarChartDatasource + +Datasource of the stacked bar chart widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/TableDatasource.md b/dashboards_api/docs/TableDatasource.md new file mode 100644 index 00000000..134e4b04 --- /dev/null +++ b/dashboards_api/docs/TableDatasource.md @@ -0,0 +1,11 @@ +# TableDatasource + +Datasource of the table widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/TestTableDatasource.md b/dashboards_api/docs/TestTableDatasource.md new file mode 100644 index 00000000..de2f787a --- /dev/null +++ b/dashboards_api/docs/TestTableDatasource.md @@ -0,0 +1,11 @@ +# TestTableDatasource + +Datasource of the test table widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/TestTableFilterKey.md b/dashboards_api/docs/TestTableFilterKey.md new file mode 100644 index 00000000..342a3be9 --- /dev/null +++ b/dashboards_api/docs/TestTableFilterKey.md @@ -0,0 +1,10 @@ +# TestTableFilterKey + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/TestTableFilterType.md b/dashboards_api/docs/TestTableFilterType.md new file mode 100644 index 00000000..193d53b4 --- /dev/null +++ b/dashboards_api/docs/TestTableFilterType.md @@ -0,0 +1,10 @@ +# TestTableFilterType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/TimeseriesDatasource.md b/dashboards_api/docs/TimeseriesDatasource.md new file mode 100644 index 00000000..baa1ef6c --- /dev/null +++ b/dashboards_api/docs/TimeseriesDatasource.md @@ -0,0 +1,11 @@ +# TimeseriesDatasource + +Datasource of the Timeseries widget. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/UnauthorizedError.md b/dashboards_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..6487f257 --- /dev/null +++ b/dashboards_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from dashboards_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/UpdateSnapshotExpirationDateApiRequest.md b/dashboards_api/docs/UpdateSnapshotExpirationDateApiRequest.md new file mode 100644 index 00000000..b8380c2c --- /dev/null +++ b/dashboards_api/docs/UpdateSnapshotExpirationDateApiRequest.md @@ -0,0 +1,29 @@ +# UpdateSnapshotExpirationDateApiRequest + +Request to update the expiration date of a snapshot. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**snapshot_expiration_date** | **datetime** | Expiration date of the snapshot. If unspecified, the snapshot expires 1 year from its creation date. The expiration date must be set within 5 years from the current date and adhere to the ISO date-time format. | [optional] + +## Example + +```python +from dashboards_api.models.update_snapshot_expiration_date_api_request import UpdateSnapshotExpirationDateApiRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateSnapshotExpirationDateApiRequest from a JSON string +update_snapshot_expiration_date_api_request_instance = UpdateSnapshotExpirationDateApiRequest.from_json(json) +# print the JSON string representation of the object +print UpdateSnapshotExpirationDateApiRequest.to_json() + +# convert the object into a dict +update_snapshot_expiration_date_api_request_dict = update_snapshot_expiration_date_api_request_instance.to_dict() +# create an instance of UpdateSnapshotExpirationDateApiRequest from a dict +update_snapshot_expiration_date_api_request_form_dict = update_snapshot_expiration_date_api_request.from_dict(update_snapshot_expiration_date_api_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) + + diff --git a/dashboards_api/docs/VisualMode.md b/dashboards_api/docs/VisualMode.md new file mode 100644 index 00000000..70cb7c16 --- /dev/null +++ b/dashboards_api/docs/VisualMode.md @@ -0,0 +1,11 @@ +# VisualMode + +Visual mode in the UI. Either full or half the width of the window. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/Widget.md b/dashboards_api/docs/Widget.md new file mode 100644 index 00000000..e7971fca --- /dev/null +++ b/dashboards_api/docs/Widget.md @@ -0,0 +1,42 @@ +# Widget + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**id** | **str** | Identifier of the widget. | [optional] +**type** | [**WidgetType**](WidgetType.md) | | [optional] +**title** | **str** | Title of the widget | [optional] +**visual_mode** | [**VisualMode**](VisualMode.md) | | [optional] +**embed_url** | **str** | When `isEmbedded` is set to `true`, an `embedUrl` is provided. | [optional] [readonly] +**is_embedded** | **bool** | Set to `true` if widget is marked as embedded; otherwise, set to `false`. | [optional] +**metric_group** | [**MetricGroup**](MetricGroup.md) | | [optional] +**direction** | [**DashboardMetricDirection**](DashboardMetricDirection.md) | | [optional] +**metric** | [**DashboardMetric**](DashboardMetric.md) | | [optional] +**filters** | **Dict[str, List[object]]** | (Optional) Specifies the filters applied to the widget. When present, the `filters` property displays. Each filter object has two properties: `filterProperty` and `filterValue`. The `filterProperty` can be values like Agents, Agent Groups, Tests, Monitors, etc. The `filterValue` represents theIdentifierof the selected property. | [optional] +**measure** | [**ApiWidgetMeasure**](ApiWidgetMeasure.md) | | [optional] +**fixed_timespan** | [**ApiDuration**](ApiDuration.md) | | [optional] +**api_link** | **str** | | [optional] [readonly] +**should_exclude_alert_suppression_windows** | **bool** | Excludes alert suppression window data if set to `true`. | [optional] + +## Example + +```python +from dashboards_api.models.widget import Widget + +# TODO update the JSON string below +json = "{}" +# create an instance of Widget from a JSON string +widget_instance = Widget.from_json(json) +# print the JSON string representation of the object +print Widget.to_json() + +# convert the object into a dict +widget_dict = widget_instance.to_dict() +# create an instance of Widget from a dict +widget_form_dict = widget.from_dict(widget_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/WidgetMeasureType.md b/dashboards_api/docs/WidgetMeasureType.md new file mode 100644 index 00000000..3a0add14 --- /dev/null +++ b/dashboards_api/docs/WidgetMeasureType.md @@ -0,0 +1,11 @@ +# WidgetMeasureType + +Determines how to aggregate the the metric. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/WidgetSortDirection.md b/dashboards_api/docs/WidgetSortDirection.md new file mode 100644 index 00000000..16c31cab --- /dev/null +++ b/dashboards_api/docs/WidgetSortDirection.md @@ -0,0 +1,11 @@ +# WidgetSortDirection + +Specifies the order in which cards are sorted. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/WidgetSortProperty.md b/dashboards_api/docs/WidgetSortProperty.md new file mode 100644 index 00000000..c3dc41d9 --- /dev/null +++ b/dashboards_api/docs/WidgetSortProperty.md @@ -0,0 +1,11 @@ +# WidgetSortProperty + +Determines the card sorting criterion. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/docs/WidgetType.md b/dashboards_api/docs/WidgetType.md new file mode 100644 index 00000000..5eedae42 --- /dev/null +++ b/dashboards_api/docs/WidgetType.md @@ -0,0 +1,11 @@ +# WidgetType + +Type of the Widget + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/dashboards_api/git_push.sh b/dashboards_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/dashboards_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/dashboards_api/pyproject.toml b/dashboards_api/pyproject.toml new file mode 100644 index 00000000..de103c62 --- /dev/null +++ b/dashboards_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "dashboards_api" +version = "1.0.0" +description = "Dashboards API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Dashboards API"] +include = ["dashboards_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/dashboards_api/requirements.txt b/dashboards_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/dashboards_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/dashboards_api/setup.cfg b/dashboards_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/dashboards_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/dashboards_api/setup.py b/dashboards_api/setup.py new file mode 100644 index 00000000..7d684d32 --- /dev/null +++ b/dashboards_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "dashboards-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Dashboards API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Dashboards API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + Manage ThousandEyes Dashboards + """, # noqa: E501 + package_data={"dashboards_api": ["py.typed"]}, +) diff --git a/dashboards_api/test-requirements.txt b/dashboards_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/dashboards_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/dashboards_api/test/__init__.py b/dashboards_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/dashboards_api/test/test_agent_status_datasource.py b/dashboards_api/test/test_agent_status_datasource.py new file mode 100644 index 00000000..02d8e6bc --- /dev/null +++ b/dashboards_api/test/test_agent_status_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.agent_status_datasource import AgentStatusDatasource + +class TestAgentStatusDatasource(unittest.TestCase): + """AgentStatusDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAgentStatusDatasource(self): + """Test AgentStatusDatasource""" + # inst = AgentStatusDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_agent_widget_show.py b/dashboards_api/test/test_agent_widget_show.py new file mode 100644 index 00000000..dcec15b7 --- /dev/null +++ b/dashboards_api/test/test_agent_widget_show.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.agent_widget_show import AgentWidgetShow + +class TestAgentWidgetShow(unittest.TestCase): + """AgentWidgetShow unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAgentWidgetShow(self): + """Test AgentWidgetShow""" + # inst = AgentWidgetShow() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_agent_widget_type.py b/dashboards_api/test/test_agent_widget_type.py new file mode 100644 index 00000000..9f085189 --- /dev/null +++ b/dashboards_api/test/test_agent_widget_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.agent_widget_type import AgentWidgetType + +class TestAgentWidgetType(unittest.TestCase): + """AgentWidgetType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAgentWidgetType(self): + """Test AgentWidgetType""" + # inst = AgentWidgetType() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_alert_list_datasource.py b/dashboards_api/test/test_alert_list_datasource.py new file mode 100644 index 00000000..9a1d4bb1 --- /dev/null +++ b/dashboards_api/test/test_alert_list_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.alert_list_datasource import AlertListDatasource + +class TestAlertListDatasource(unittest.TestCase): + """AlertListDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAlertListDatasource(self): + """Test AlertListDatasource""" + # inst = AlertListDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_agent_location.py b/dashboards_api/test/test_api_agent_location.py new file mode 100644 index 00000000..cd21b857 --- /dev/null +++ b/dashboards_api/test/test_api_agent_location.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_agent_location import ApiAgentLocation + +class TestApiAgentLocation(unittest.TestCase): + """ApiAgentLocation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiAgentLocation: + """Test ApiAgentLocation + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiAgentLocation` + """ + model = ApiAgentLocation() + if include_optional: + return ApiAgentLocation( + latitude = 37.77493, + longitude = -122.41942, + location_name = 'San Francisco, California, US' + ) + else: + return ApiAgentLocation( + ) + """ + + def testApiAgentLocation(self): + """Test ApiAgentLocation""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_agent_status_agent.py b/dashboards_api/test/test_api_agent_status_agent.py new file mode 100644 index 00000000..20a16d0f --- /dev/null +++ b/dashboards_api/test/test_api_agent_status_agent.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_agent_status_agent import ApiAgentStatusAgent + +class TestApiAgentStatusAgent(unittest.TestCase): + """ApiAgentStatusAgent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiAgentStatusAgent: + """Test ApiAgentStatusAgent + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiAgentStatusAgent` + """ + model = ApiAgentStatusAgent() + if include_optional: + return ApiAgentStatusAgent( + agent_id = '6522', + status = 'online', + ip_info = dashboards_api.models.api_agent_status_ip_info.ApiAgentStatusIpInfo( + public_ip = '172.58.92.31', + private_ip = '172.58.92.31', + ipv6 = '', + operative_system_version = '', ), + agent_name = '0c3898000117', + location = dashboards_api.models.api_agent_location.ApiAgentLocation( + latitude = 37.77493, + longitude = -122.41942, + location_name = 'San Francisco, California, US', ) + ) + else: + return ApiAgentStatusAgent( + ) + """ + + def testApiAgentStatusAgent(self): + """Test ApiAgentStatusAgent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_agent_status_ip_info.py b/dashboards_api/test/test_api_agent_status_ip_info.py new file mode 100644 index 00000000..d20f326f --- /dev/null +++ b/dashboards_api/test/test_api_agent_status_ip_info.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_agent_status_ip_info import ApiAgentStatusIpInfo + +class TestApiAgentStatusIpInfo(unittest.TestCase): + """ApiAgentStatusIpInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiAgentStatusIpInfo: + """Test ApiAgentStatusIpInfo + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiAgentStatusIpInfo` + """ + model = ApiAgentStatusIpInfo() + if include_optional: + return ApiAgentStatusIpInfo( + public_ip = '172.58.92.31', + private_ip = '172.58.92.31', + ipv6 = '', + operative_system_version = '' + ) + else: + return ApiAgentStatusIpInfo( + ) + """ + + def testApiAgentStatusIpInfo(self): + """Test ApiAgentStatusIpInfo""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_agent_status_summary.py b/dashboards_api/test/test_api_agent_status_summary.py new file mode 100644 index 00000000..71557a3a --- /dev/null +++ b/dashboards_api/test/test_api_agent_status_summary.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_agent_status_summary import ApiAgentStatusSummary + +class TestApiAgentStatusSummary(unittest.TestCase): + """ApiAgentStatusSummary unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiAgentStatusSummary: + """Test ApiAgentStatusSummary + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiAgentStatusSummary` + """ + model = ApiAgentStatusSummary() + if include_optional: + return ApiAgentStatusSummary( + online = 10, + offline = 2, + disabled = 3 + ) + else: + return ApiAgentStatusSummary( + ) + """ + + def testApiAgentStatusSummary(self): + """Test ApiAgentStatusSummary""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_agent_status_widget.py b/dashboards_api/test/test_api_agent_status_widget.py new file mode 100644 index 00000000..b46e9286 --- /dev/null +++ b/dashboards_api/test/test_api_agent_status_widget.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_agent_status_widget import ApiAgentStatusWidget + +class TestApiAgentStatusWidget(unittest.TestCase): + """ApiAgentStatusWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiAgentStatusWidget: + """Test ApiAgentStatusWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiAgentStatusWidget` + """ + model = ApiAgentStatusWidget() + if include_optional: + return ApiAgentStatusWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + agents = 'endpoint', + show = 'owned', + data_source = 'ENDPOINT_AST_TEST' + ) + else: + return ApiAgentStatusWidget( + ) + """ + + def testApiAgentStatusWidget(self): + """Test ApiAgentStatusWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_aggregate_property.py b/dashboards_api/test/test_api_aggregate_property.py new file mode 100644 index 00000000..9b40ac46 --- /dev/null +++ b/dashboards_api/test/test_api_aggregate_property.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_aggregate_property import ApiAggregateProperty + +class TestApiAggregateProperty(unittest.TestCase): + """ApiAggregateProperty unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiAggregateProperty(self): + """Test ApiAggregateProperty""" + # inst = ApiAggregateProperty() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_alert_list_alert.py b/dashboards_api/test/test_api_alert_list_alert.py new file mode 100644 index 00000000..da60fbac --- /dev/null +++ b/dashboards_api/test/test_api_alert_list_alert.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_alert_list_alert import ApiAlertListAlert + +class TestApiAlertListAlert(unittest.TestCase): + """ApiAlertListAlert unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiAlertListAlert: + """Test ApiAlertListAlert + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiAlertListAlert` + """ + model = ApiAlertListAlert() + if include_optional: + return ApiAlertListAlert( + alert_id = '2004945', + test_id = '56512', + rule_id = '281724', + alert_source = 'Http Test', + alert_rule = 'Http Test Rule', + alert_type = 'Network - End-to-End (Server)', + start_time = '2023-06-02T08:54Z', + duration_in_seconds = 25, + active = True + ) + else: + return ApiAlertListAlert( + ) + """ + + def testApiAlertListAlert(self): + """Test ApiAlertListAlert""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_alert_list_alert_type.py b/dashboards_api/test/test_api_alert_list_alert_type.py new file mode 100644 index 00000000..61296734 --- /dev/null +++ b/dashboards_api/test/test_api_alert_list_alert_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_alert_list_alert_type import ApiAlertListAlertType + +class TestApiAlertListAlertType(unittest.TestCase): + """ApiAlertListAlertType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiAlertListAlertType(self): + """Test ApiAlertListAlertType""" + # inst = ApiAlertListAlertType() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_alert_list_widget.py b/dashboards_api/test/test_api_alert_list_widget.py new file mode 100644 index 00000000..eb40a163 --- /dev/null +++ b/dashboards_api/test/test_api_alert_list_widget.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_alert_list_widget import ApiAlertListWidget + +class TestApiAlertListWidget(unittest.TestCase): + """ApiAlertListWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiAlertListWidget: + """Test ApiAlertListWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiAlertListWidget` + """ + model = ApiAlertListWidget() + if include_optional: + return ApiAlertListWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + alert_types = [ + 'Network - End-to-End (Server)' + ], + limit_to = 15, + active_within = None, + data_source = 'ENDPOINT_AST_TEST' + ) + else: + return ApiAlertListWidget( + ) + """ + + def testApiAlertListWidget(self): + """Test ApiAlertListWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_alert_list_widget_all_of_active_within.py b/dashboards_api/test/test_api_alert_list_widget_all_of_active_within.py new file mode 100644 index 00000000..a16b9a2a --- /dev/null +++ b/dashboards_api/test/test_api_alert_list_widget_all_of_active_within.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_alert_list_widget_all_of_active_within import ApiAlertListWidgetAllOfActiveWithin + +class TestApiAlertListWidgetAllOfActiveWithin(unittest.TestCase): + """ApiAlertListWidgetAllOfActiveWithin unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiAlertListWidgetAllOfActiveWithin: + """Test ApiAlertListWidgetAllOfActiveWithin + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiAlertListWidgetAllOfActiveWithin` + """ + model = ApiAlertListWidgetAllOfActiveWithin() + if include_optional: + return ApiAlertListWidgetAllOfActiveWithin( + value = 10, + unit = 'hour' + ) + else: + return ApiAlertListWidgetAllOfActiveWithin( + ) + """ + + def testApiAlertListWidgetAllOfActiveWithin(self): + """Test ApiAlertListWidgetAllOfActiveWithin""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_box_and_whiskers_widget.py b/dashboards_api/test/test_api_box_and_whiskers_widget.py new file mode 100644 index 00000000..a00a4beb --- /dev/null +++ b/dashboards_api/test/test_api_box_and_whiskers_widget.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_box_and_whiskers_widget import ApiBoxAndWhiskersWidget + +class TestApiBoxAndWhiskersWidget(unittest.TestCase): + """ApiBoxAndWhiskersWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiBoxAndWhiskersWidget: + """Test ApiBoxAndWhiskersWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiBoxAndWhiskersWidget` + """ + model = ApiBoxAndWhiskersWidget() + if include_optional: + return ApiBoxAndWhiskersWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + min_scale = 1.0, + max_scale = 100.0, + unit = 'Mbps', + group_by = 'ALL', + data_source = 'INTERNET_INSIGHTS' + ) + else: + return ApiBoxAndWhiskersWidget( + ) + """ + + def testApiBoxAndWhiskersWidget(self): + """Test ApiBoxAndWhiskersWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_color_grid_widget.py b/dashboards_api/test/test_api_color_grid_widget.py new file mode 100644 index 00000000..d8c10c4f --- /dev/null +++ b/dashboards_api/test/test_api_color_grid_widget.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_color_grid_widget import ApiColorGridWidget + +class TestApiColorGridWidget(unittest.TestCase): + """ApiColorGridWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiColorGridWidget: + """Test ApiColorGridWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiColorGridWidget` + """ + model = ApiColorGridWidget() + if include_optional: + return ApiColorGridWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + min_scale = 1.0, + max_scale = 100.0, + unit = 'Mbps', + cards = 'ALL', + group_cards_by = 'ALL', + columns = 1, + limit = 10, + sort_by = 'alphabetical', + sort_direction = 'ascending', + data_source = 'INTERNET_INSIGHTS' + ) + else: + return ApiColorGridWidget( + ) + """ + + def testApiColorGridWidget(self): + """Test ApiColorGridWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_dashboard.py b/dashboards_api/test/test_api_dashboard.py new file mode 100644 index 00000000..78d966d3 --- /dev/null +++ b/dashboards_api/test/test_api_dashboard.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_dashboard import ApiDashboard + +class TestApiDashboard(unittest.TestCase): + """ApiDashboard unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiDashboard: + """Test ApiDashboard + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiDashboard` + """ + model = ApiDashboard() + if include_optional: + return ApiDashboard( + links = dashboards_api.models.dashboard_links__links.DashboardLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + snapshots = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + dashboard_id = '5e1f7a99143ae6004fdc3bb4', + title = 'HTTP Server Widgets', + is_built_in = True, + aid = '75', + dashboard_created_by = '1', + dashboard_modified_by = '1', + dashboard_modified_date = '2023-05-16T10:14:28Z', + is_private = True, + is_default_for_user = True, + is_default_for_account = False, + widgets = [ + null + ], + description = 'HTTP Server Widgets', + default_timespan = dashboards_api.models.api_default_timespan.ApiDefaultTimespan( + duration = 7200, + start = '2023-05-16T10:14:28Z', + end = '2023-05-16T11:14:28Z', ), + is_global_override = True, + is_migrated_report = False + ) + else: + return ApiDashboard( + ) + """ + + def testApiDashboard(self): + """Test ApiDashboard""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_dashboard_asw.py b/dashboards_api/test/test_api_dashboard_asw.py new file mode 100644 index 00000000..475eb913 --- /dev/null +++ b/dashboards_api/test/test_api_dashboard_asw.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_dashboard_asw import ApiDashboardAsw + +class TestApiDashboardAsw(unittest.TestCase): + """ApiDashboardAsw unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiDashboardAsw: + """Test ApiDashboardAsw + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiDashboardAsw` + """ + model = ApiDashboardAsw() + if include_optional: + return ApiDashboardAsw( + id = '281474976710662', + name = 'Test dashboards', + test_ids = ["281474976710661"], + start_times = ["2023-05-16T10:14:28Z"], + duration_in_seconds = 7200, + repeat = 'custom', + repeat_every = 5, + repeat_unit = 'week' + ) + else: + return ApiDashboardAsw( + ) + """ + + def testApiDashboardAsw(self): + """Test ApiDashboardAsw""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_dashboard_snapshot.py b/dashboards_api/test/test_api_dashboard_snapshot.py new file mode 100644 index 00000000..b28d6629 --- /dev/null +++ b/dashboards_api/test/test_api_dashboard_snapshot.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_dashboard_snapshot import ApiDashboardSnapshot + +class TestApiDashboardSnapshot(unittest.TestCase): + """ApiDashboardSnapshot unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiDashboardSnapshot: + """Test ApiDashboardSnapshot + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiDashboardSnapshot` + """ + model = ApiDashboardSnapshot() + if include_optional: + return ApiDashboardSnapshot( + links = dashboards_api.models.dashboard_snapshot_links__links.DashboardSnapshotLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + app_link = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + snapshot_id = 'd28bb71f-5a47-4783-8f12-d4b115e61b0c', + snapshot_name = 'HTTP Server Dashboard Snapshot', + aid = '10', + is_shared = True, + snapshot_created_date = '2023-05-16T10:14:28Z', + dashboard = None, + widgets = [ + null + ], + is_scheduled = True, + time_span = dashboards_api.models.api_report_snapshot_time_span.ApiReportSnapshotTimeSpan( + start = '2023-05-16T10:14:28Z', + duration = 60, ), + snapshot_expiration_date = '2023-05-16T10:14:28Z' + ) + else: + return ApiDashboardSnapshot( + ) + """ + + def testApiDashboardSnapshot(self): + """Test ApiDashboardSnapshot""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_dashboard_snapshot_all_of_dashboard.py b/dashboards_api/test/test_api_dashboard_snapshot_all_of_dashboard.py new file mode 100644 index 00000000..1704c909 --- /dev/null +++ b/dashboards_api/test/test_api_dashboard_snapshot_all_of_dashboard.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_dashboard_snapshot_all_of_dashboard import ApiDashboardSnapshotAllOfDashboard + +class TestApiDashboardSnapshotAllOfDashboard(unittest.TestCase): + """ApiDashboardSnapshotAllOfDashboard unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiDashboardSnapshotAllOfDashboard: + """Test ApiDashboardSnapshotAllOfDashboard + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiDashboardSnapshotAllOfDashboard` + """ + model = ApiDashboardSnapshotAllOfDashboard() + if include_optional: + return ApiDashboardSnapshotAllOfDashboard( + dashboard_id = '5e1f7a99143ae6004fdc3bb4', + title = 'HTTP Server Widgets', + is_built_in = True, + aid = '75', + dashboard_created_by = '1', + dashboard_modified_by = '1', + dashboard_modified_date = '2023-05-16T10:14:28Z', + is_private = True, + is_default_for_user = True, + is_default_for_account = False, + widgets = [ + null + ], + description = 'HTTP Server Widgets', + default_timespan = dashboards_api.models.api_default_timespan.ApiDefaultTimespan( + duration = 7200, + start = '2023-05-16T10:14:28Z', + end = '2023-05-16T11:14:28Z', ), + is_global_override = True, + is_migrated_report = False, + links = dashboards_api.models.dashboard_links__links.DashboardLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + snapshots = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return ApiDashboardSnapshotAllOfDashboard( + ) + """ + + def testApiDashboardSnapshotAllOfDashboard(self): + """Test ApiDashboardSnapshotAllOfDashboard""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_data_point_group.py b/dashboards_api/test/test_api_data_point_group.py new file mode 100644 index 00000000..684b03e8 --- /dev/null +++ b/dashboards_api/test/test_api_data_point_group.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_data_point_group import ApiDataPointGroup + +class TestApiDataPointGroup(unittest.TestCase): + """ApiDataPointGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiDataPointGroup: + """Test ApiDataPointGroup + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiDataPointGroup` + """ + model = ApiDataPointGroup() + if include_optional: + return ApiDataPointGroup( + group_property = 'COUNTRY', + group_value = 'US' + ) + else: + return ApiDataPointGroup( + ) + """ + + def testApiDataPointGroup(self): + """Test ApiDataPointGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_default_timespan.py b/dashboards_api/test/test_api_default_timespan.py new file mode 100644 index 00000000..b88fdbe7 --- /dev/null +++ b/dashboards_api/test/test_api_default_timespan.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_default_timespan import ApiDefaultTimespan + +class TestApiDefaultTimespan(unittest.TestCase): + """ApiDefaultTimespan unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiDefaultTimespan: + """Test ApiDefaultTimespan + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiDefaultTimespan` + """ + model = ApiDefaultTimespan() + if include_optional: + return ApiDefaultTimespan( + duration = 7200, + start = '2023-05-16T10:14:28Z', + end = '2023-05-16T11:14:28Z' + ) + else: + return ApiDefaultTimespan( + ) + """ + + def testApiDefaultTimespan(self): + """Test ApiDefaultTimespan""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_duration.py b/dashboards_api/test/test_api_duration.py new file mode 100644 index 00000000..9082cb9d --- /dev/null +++ b/dashboards_api/test/test_api_duration.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_duration import ApiDuration + +class TestApiDuration(unittest.TestCase): + """ApiDuration unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiDuration: + """Test ApiDuration + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiDuration` + """ + model = ApiDuration() + if include_optional: + return ApiDuration( + value = 10, + unit = 'hour' + ) + else: + return ApiDuration( + ) + """ + + def testApiDuration(self): + """Test ApiDuration""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_geo_map_widget.py b/dashboards_api/test/test_api_geo_map_widget.py new file mode 100644 index 00000000..3e2ae4c9 --- /dev/null +++ b/dashboards_api/test/test_api_geo_map_widget.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_geo_map_widget import ApiGeoMapWidget + +class TestApiGeoMapWidget(unittest.TestCase): + """ApiGeoMapWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiGeoMapWidget: + """Test ApiGeoMapWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiGeoMapWidget` + """ + model = ApiGeoMapWidget() + if include_optional: + return ApiGeoMapWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + min_scale = 1.0, + max_scale = 100.0, + unit = 'Mbps', + group_by = 'ALL', + is_geo_map_per_test = True, + sort_by = 'alphabetical', + sort_direction = 'ascending', + data_source = 'INTERNET_INSIGHTS' + ) + else: + return ApiGeoMapWidget( + ) + """ + + def testApiGeoMapWidget(self): + """Test ApiGeoMapWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_graphlet_point.py b/dashboards_api/test/test_api_graphlet_point.py new file mode 100644 index 00000000..49162209 --- /dev/null +++ b/dashboards_api/test/test_api_graphlet_point.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_graphlet_point import ApiGraphletPoint + +class TestApiGraphletPoint(unittest.TestCase): + """ApiGraphletPoint unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiGraphletPoint: + """Test ApiGraphletPoint + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiGraphletPoint` + """ + model = ApiGraphletPoint() + if include_optional: + return ApiGraphletPoint( + x = 1580403900, + y = 128.249 + ) + else: + return ApiGraphletPoint( + ) + """ + + def testApiGraphletPoint(self): + """Test ApiGraphletPoint""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_grouped_barchart_widget.py b/dashboards_api/test/test_api_grouped_barchart_widget.py new file mode 100644 index 00000000..025218ef --- /dev/null +++ b/dashboards_api/test/test_api_grouped_barchart_widget.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_grouped_barchart_widget import ApiGroupedBarchartWidget + +class TestApiGroupedBarchartWidget(unittest.TestCase): + """ApiGroupedBarchartWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiGroupedBarchartWidget: + """Test ApiGroupedBarchartWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiGroupedBarchartWidget` + """ + model = ApiGroupedBarchartWidget() + if include_optional: + return ApiGroupedBarchartWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + group_by = 'ALL', + axis_group_by = 'ALL', + sort_by = 'alphabetical', + sort_direction = 'ascending', + limit = 10, + show_labels = True, + is_horizontal_bar_chart = True, + data_source = 'ENDPOINT_SCHEDULED_TEST' + ) + else: + return ApiGroupedBarchartWidget( + ) + """ + + def testApiGroupedBarchartWidget(self): + """Test ApiGroupedBarchartWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_multi_metric_column.py b/dashboards_api/test/test_api_multi_metric_column.py new file mode 100644 index 00000000..8d9cf488 --- /dev/null +++ b/dashboards_api/test/test_api_multi_metric_column.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_multi_metric_column import ApiMultiMetricColumn + +class TestApiMultiMetricColumn(unittest.TestCase): + """ApiMultiMetricColumn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiMultiMetricColumn: + """Test ApiMultiMetricColumn + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiMultiMetricColumn` + """ + model = ApiMultiMetricColumn() + if include_optional: + return ApiMultiMetricColumn( + id = '', + data_source = 'ENDPOINT_SCHEDULED_TEST', + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = { + 'key' : [ + None + ] + }, + measure = MEAN + ) + else: + return ApiMultiMetricColumn( + ) + """ + + def testApiMultiMetricColumn(self): + """Test ApiMultiMetricColumn""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_multi_metric_column_data.py b/dashboards_api/test/test_api_multi_metric_column_data.py new file mode 100644 index 00000000..6380d85a --- /dev/null +++ b/dashboards_api/test/test_api_multi_metric_column_data.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_multi_metric_column_data import ApiMultiMetricColumnData + +class TestApiMultiMetricColumnData(unittest.TestCase): + """ApiMultiMetricColumnData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiMultiMetricColumnData: + """Test ApiMultiMetricColumnData + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiMultiMetricColumnData` + """ + model = ApiMultiMetricColumnData() + if include_optional: + return ApiMultiMetricColumnData( + column_id = '938to', + bin_size = 3600, + points = [ + dashboards_api.models.api_widget_data_point.ApiWidgetDataPoint( + timestamp = 1567620000, + number_of_data_points = 23304, + value = 100.0, + groups = [ + dashboards_api.models.api_data_point_group.ApiDataPointGroup( + group_property = 'COUNTRY', + group_value = 'US', ) + ], ) + ], + status = 'No data', + alert_suppression_windows = [ + dashboards_api.models.api_dashboard_asw.ApiDashboardAsw( + id = '281474976710662', + name = 'Test dashboards', + test_ids = ["281474976710661"], + start_times = ["2023-05-16T10:14:28Z"], + duration_in_seconds = 7200, + repeat = 'custom', + repeat_every = 5, + repeat_unit = 'week', ) + ] + ) + else: + return ApiMultiMetricColumnData( + ) + """ + + def testApiMultiMetricColumnData(self): + """Test ApiMultiMetricColumnData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_multi_metric_table_widget.py b/dashboards_api/test/test_api_multi_metric_table_widget.py new file mode 100644 index 00000000..e6b17d18 --- /dev/null +++ b/dashboards_api/test/test_api_multi_metric_table_widget.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_multi_metric_table_widget import ApiMultiMetricTableWidget + +class TestApiMultiMetricTableWidget(unittest.TestCase): + """ApiMultiMetricTableWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiMultiMetricTableWidget: + """Test ApiMultiMetricTableWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiMultiMetricTableWidget` + """ + model = ApiMultiMetricTableWidget() + if include_optional: + return ApiMultiMetricTableWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + compare_to_previous_value = True, + row_group_by = 'ALL', + sort_by = 'alphabetical', + sort_direction = 'ascending', + limit = 10, + multi_metric_columns = [ + dashboards_api.models.api_multi_metric_column.ApiMultiMetricColumn( + id = '', + data_source = 'ENDPOINT_SCHEDULED_TEST', + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = { + 'key' : [ + None + ] + }, + measure = MEAN, ) + ], + data_source = 'ENDPOINT_SCHEDULED_TEST' + ) + else: + return ApiMultiMetricTableWidget( + ) + """ + + def testApiMultiMetricTableWidget(self): + """Test ApiMultiMetricTableWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_multi_search_filter_api_test_table_filter_key.py b/dashboards_api/test/test_api_multi_search_filter_api_test_table_filter_key.py new file mode 100644 index 00000000..06e88274 --- /dev/null +++ b/dashboards_api/test/test_api_multi_search_filter_api_test_table_filter_key.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_multi_search_filter_api_test_table_filter_key import ApiMultiSearchFilterApiTestTableFilterKey + +class TestApiMultiSearchFilterApiTestTableFilterKey(unittest.TestCase): + """ApiMultiSearchFilterApiTestTableFilterKey unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiMultiSearchFilterApiTestTableFilterKey: + """Test ApiMultiSearchFilterApiTestTableFilterKey + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiMultiSearchFilterApiTestTableFilterKey` + """ + model = ApiMultiSearchFilterApiTestTableFilterKey() + if include_optional: + return ApiMultiSearchFilterApiTestTableFilterKey( + key = 'Target', + value = '' + ) + else: + return ApiMultiSearchFilterApiTestTableFilterKey( + ) + """ + + def testApiMultiSearchFilterApiTestTableFilterKey(self): + """Test ApiMultiSearchFilterApiTestTableFilterKey""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_numbers_card.py b/dashboards_api/test/test_api_numbers_card.py new file mode 100644 index 00000000..5f9a99c4 --- /dev/null +++ b/dashboards_api/test/test_api_numbers_card.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_numbers_card import ApiNumbersCard + +class TestApiNumbersCard(unittest.TestCase): + """ApiNumbersCard unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiNumbersCard: + """Test ApiNumbersCard + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiNumbersCard` + """ + model = ApiNumbersCard() + if include_optional: + return ApiNumbersCard( + min_scale = 1.0, + max_scale = 100.0, + unit = 'Mbps', + id = '1234', + description = 'Widget Title', + measure = MEAN, + compare_to_previous_value = True, + fixed_timespan = None, + should_exclude_alert_suppression_windows = True, + data_source = 'ENDPOINT_BROWSER_SESSION', + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = { + 'key' : [ + None + ] + } + ) + else: + return ApiNumbersCard( + ) + """ + + def testApiNumbersCard(self): + """Test ApiNumbersCard""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_numbers_card_all_of_fixed_timespan.py b/dashboards_api/test/test_api_numbers_card_all_of_fixed_timespan.py new file mode 100644 index 00000000..f5a299a0 --- /dev/null +++ b/dashboards_api/test/test_api_numbers_card_all_of_fixed_timespan.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_numbers_card_all_of_fixed_timespan import ApiNumbersCardAllOfFixedTimespan + +class TestApiNumbersCardAllOfFixedTimespan(unittest.TestCase): + """ApiNumbersCardAllOfFixedTimespan unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiNumbersCardAllOfFixedTimespan: + """Test ApiNumbersCardAllOfFixedTimespan + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiNumbersCardAllOfFixedTimespan` + """ + model = ApiNumbersCardAllOfFixedTimespan() + if include_optional: + return ApiNumbersCardAllOfFixedTimespan( + value = 10, + unit = 'hour' + ) + else: + return ApiNumbersCardAllOfFixedTimespan( + ) + """ + + def testApiNumbersCardAllOfFixedTimespan(self): + """Test ApiNumbersCardAllOfFixedTimespan""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_numbers_card_data.py b/dashboards_api/test/test_api_numbers_card_data.py new file mode 100644 index 00000000..279c22d7 --- /dev/null +++ b/dashboards_api/test/test_api_numbers_card_data.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_numbers_card_data import ApiNumbersCardData + +class TestApiNumbersCardData(unittest.TestCase): + """ApiNumbersCardData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiNumbersCardData: + """Test ApiNumbersCardData + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiNumbersCardData` + """ + model = ApiNumbersCardData() + if include_optional: + return ApiNumbersCardData( + card_id = 'lrxxr', + start_date = '2023-05-16T10:14:28Z', + end_date = '2023-05-16T10:14:28Z', + previous_value = 500.0, + bin_size = 3600, + timestamp = 1567620000, + number_of_data_points = 24192, + value = 100.0, + status = 'No data', + alert_suppression_windows = [ + dashboards_api.models.api_dashboard_asw.ApiDashboardAsw( + id = '281474976710662', + name = 'Test dashboards', + test_ids = ["281474976710661"], + start_times = ["2023-05-16T10:14:28Z"], + duration_in_seconds = 7200, + repeat = 'custom', + repeat_every = 5, + repeat_unit = 'week', ) + ] + ) + else: + return ApiNumbersCardData( + ) + """ + + def testApiNumbersCardData(self): + """Test ApiNumbersCardData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_numbers_card_widget.py b/dashboards_api/test/test_api_numbers_card_widget.py new file mode 100644 index 00000000..8878915e --- /dev/null +++ b/dashboards_api/test/test_api_numbers_card_widget.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_numbers_card_widget import ApiNumbersCardWidget + +class TestApiNumbersCardWidget(unittest.TestCase): + """ApiNumbersCardWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiNumbersCardWidget: + """Test ApiNumbersCardWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiNumbersCardWidget` + """ + model = ApiNumbersCardWidget() + if include_optional: + return ApiNumbersCardWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + number_cards = [ + dashboards_api.models.api_numbers_card.ApiNumbersCard() + ], + data_source = 'ENDPOINT_BROWSER_SESSION' + ) + else: + return ApiNumbersCardWidget( + ) + """ + + def testApiNumbersCardWidget(self): + """Test ApiNumbersCardWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_pie_chart_widget.py b/dashboards_api/test/test_api_pie_chart_widget.py new file mode 100644 index 00000000..df1c80a7 --- /dev/null +++ b/dashboards_api/test/test_api_pie_chart_widget.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_pie_chart_widget import ApiPieChartWidget + +class TestApiPieChartWidget(unittest.TestCase): + """ApiPieChartWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiPieChartWidget: + """Test ApiPieChartWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiPieChartWidget` + """ + model = ApiPieChartWidget() + if include_optional: + return ApiPieChartWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + group_by = 'ALL', + data_source = 'ENDPOINT_BROWSER_SESSION' + ) + else: + return ApiPieChartWidget( + ) + """ + + def testApiPieChartWidget(self): + """Test ApiPieChartWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_report_data_component_label_map.py b/dashboards_api/test/test_api_report_data_component_label_map.py new file mode 100644 index 00000000..9df101a2 --- /dev/null +++ b/dashboards_api/test/test_api_report_data_component_label_map.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_report_data_component_label_map import ApiReportDataComponentLabelMap + +class TestApiReportDataComponentLabelMap(unittest.TestCase): + """ApiReportDataComponentLabelMap unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiReportDataComponentLabelMap: + """Test ApiReportDataComponentLabelMap + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiReportDataComponentLabelMap` + """ + model = ApiReportDataComponentLabelMap() + if include_optional: + return ApiReportDataComponentLabelMap( + group_property = 'AGENT', + group_labels = [ + dashboards_api.models.api_report_data_component_label_map_entry.ApiReportDataComponentLabelMapEntry( + group_id = '2565', + group_label = 'San Francisco, CA', ) + ] + ) + else: + return ApiReportDataComponentLabelMap( + ) + """ + + def testApiReportDataComponentLabelMap(self): + """Test ApiReportDataComponentLabelMap""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_report_data_component_label_map_entry.py b/dashboards_api/test/test_api_report_data_component_label_map_entry.py new file mode 100644 index 00000000..e62d673c --- /dev/null +++ b/dashboards_api/test/test_api_report_data_component_label_map_entry.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_report_data_component_label_map_entry import ApiReportDataComponentLabelMapEntry + +class TestApiReportDataComponentLabelMapEntry(unittest.TestCase): + """ApiReportDataComponentLabelMapEntry unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiReportDataComponentLabelMapEntry: + """Test ApiReportDataComponentLabelMapEntry + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiReportDataComponentLabelMapEntry` + """ + model = ApiReportDataComponentLabelMapEntry() + if include_optional: + return ApiReportDataComponentLabelMapEntry( + group_id = '2565', + group_label = 'San Francisco, CA' + ) + else: + return ApiReportDataComponentLabelMapEntry( + ) + """ + + def testApiReportDataComponentLabelMapEntry(self): + """Test ApiReportDataComponentLabelMapEntry""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_report_snapshot_time_span.py b/dashboards_api/test/test_api_report_snapshot_time_span.py new file mode 100644 index 00000000..8a8fc6ff --- /dev/null +++ b/dashboards_api/test/test_api_report_snapshot_time_span.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_report_snapshot_time_span import ApiReportSnapshotTimeSpan + +class TestApiReportSnapshotTimeSpan(unittest.TestCase): + """ApiReportSnapshotTimeSpan unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiReportSnapshotTimeSpan: + """Test ApiReportSnapshotTimeSpan + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiReportSnapshotTimeSpan` + """ + model = ApiReportSnapshotTimeSpan() + if include_optional: + return ApiReportSnapshotTimeSpan( + start = '2023-05-16T10:14:28Z', + duration = 60 + ) + else: + return ApiReportSnapshotTimeSpan( + ) + """ + + def testApiReportSnapshotTimeSpan(self): + """Test ApiReportSnapshotTimeSpan""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_stacked_area_chart_widget.py b/dashboards_api/test/test_api_stacked_area_chart_widget.py new file mode 100644 index 00000000..dc67b7e1 --- /dev/null +++ b/dashboards_api/test/test_api_stacked_area_chart_widget.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_stacked_area_chart_widget import ApiStackedAreaChartWidget + +class TestApiStackedAreaChartWidget(unittest.TestCase): + """ApiStackedAreaChartWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiStackedAreaChartWidget: + """Test ApiStackedAreaChartWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiStackedAreaChartWidget` + """ + model = ApiStackedAreaChartWidget() + if include_optional: + return ApiStackedAreaChartWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + min_scale = 1.0, + max_scale = 100.0, + unit = 'Mbps', + group_by = 'ALL', + data_source = 'ENDPOINT_BROWSER_SESSION' + ) + else: + return ApiStackedAreaChartWidget( + ) + """ + + def testApiStackedAreaChartWidget(self): + """Test ApiStackedAreaChartWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_stacked_barchart_widget.py b/dashboards_api/test/test_api_stacked_barchart_widget.py new file mode 100644 index 00000000..55e414d7 --- /dev/null +++ b/dashboards_api/test/test_api_stacked_barchart_widget.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_stacked_barchart_widget import ApiStackedBarchartWidget + +class TestApiStackedBarchartWidget(unittest.TestCase): + """ApiStackedBarchartWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiStackedBarchartWidget: + """Test ApiStackedBarchartWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiStackedBarchartWidget` + """ + model = ApiStackedBarchartWidget() + if include_optional: + return ApiStackedBarchartWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + axis_group_by = 'ALL', + sort_by = 'alphabetical', + sort_direction = 'ascending', + limit = 10, + show_labels = True, + is_horizontal_bar_chart = True, + data_source = 'ENDPOINT_BROWSER_SESSION' + ) + else: + return ApiStackedBarchartWidget( + ) + """ + + def testApiStackedBarchartWidget(self): + """Test ApiStackedBarchartWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_table_widget.py b/dashboards_api/test/test_api_table_widget.py new file mode 100644 index 00000000..8b2791dc --- /dev/null +++ b/dashboards_api/test/test_api_table_widget.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_table_widget import ApiTableWidget + +class TestApiTableWidget(unittest.TestCase): + """ApiTableWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiTableWidget: + """Test ApiTableWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiTableWidget` + """ + model = ApiTableWidget() + if include_optional: + return ApiTableWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + compare_to_previous_value = True, + row_group_by = 'ALL', + column_group_by = 'ALL', + sort_by = 'alphabetical', + sort_direction = 'ascending', + limit = 10, + data_source = 'ENDPOINT_LOCAL_NETWORK' + ) + else: + return ApiTableWidget( + ) + """ + + def testApiTableWidget(self): + """Test ApiTableWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_test_table_data.py b/dashboards_api/test/test_api_test_table_data.py new file mode 100644 index 00000000..a2cb7c2b --- /dev/null +++ b/dashboards_api/test/test_api_test_table_data.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_test_table_data import ApiTestTableData + +class TestApiTestTableData(unittest.TestCase): + """ApiTestTableData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiTestTableData: + """Test ApiTestTableData + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiTestTableData` + """ + model = ApiTestTableData() + if include_optional: + return ApiTestTableData( + test_id = '68256', + test_name = 'Http Test Name', + target = 'www.google.com', + test_type = 'Web - HTTP Server', + alert_count = 398, + is_shared = True, + graphlets = [ + dashboards_api.models.api_test_table_graphlets_data.ApiTestTableGraphletsData( + metric = 'Availability', + test_id = '68257', + points = [ + dashboards_api.models.api_graphlet_point.ApiGraphletPoint( + x = 1580403900, + y = 128.249, ) + ], ) + ] + ) + else: + return ApiTestTableData( + ) + """ + + def testApiTestTableData(self): + """Test ApiTestTableData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_test_table_graphlets_data.py b/dashboards_api/test/test_api_test_table_graphlets_data.py new file mode 100644 index 00000000..0791d951 --- /dev/null +++ b/dashboards_api/test/test_api_test_table_graphlets_data.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_test_table_graphlets_data import ApiTestTableGraphletsData + +class TestApiTestTableGraphletsData(unittest.TestCase): + """ApiTestTableGraphletsData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiTestTableGraphletsData: + """Test ApiTestTableGraphletsData + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiTestTableGraphletsData` + """ + model = ApiTestTableGraphletsData() + if include_optional: + return ApiTestTableGraphletsData( + metric = 'Availability', + test_id = '68257', + points = [ + dashboards_api.models.api_graphlet_point.ApiGraphletPoint( + x = 1580403900, + y = 128.249, ) + ] + ) + else: + return ApiTestTableGraphletsData( + ) + """ + + def testApiTestTableGraphletsData(self): + """Test ApiTestTableGraphletsData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_test_table_widget.py b/dashboards_api/test/test_api_test_table_widget.py new file mode 100644 index 00000000..c5fb28cc --- /dev/null +++ b/dashboards_api/test/test_api_test_table_widget.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_test_table_widget import ApiTestTableWidget + +class TestApiTestTableWidget(unittest.TestCase): + """ApiTestTableWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiTestTableWidget: + """Test ApiTestTableWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiTestTableWidget` + """ + model = ApiTestTableWidget() + if include_optional: + return ApiTestTableWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + filter = dashboards_api.models.api_widget_filter_api_test_table_filter_key.ApiWidgetFilterApiTestTableFilterKey( + filters = [ + dashboards_api.models.api_multi_search_filter_api_test_table_filter_key.ApiMultiSearchFilterApiTestTableFilterKey( + key = 'Target', + value = '', ) + ], + type = 'all', ), + exclude = dashboards_api.models.api_widget_filter_api_test_table_filter_key.ApiWidgetFilterApiTestTableFilterKey( + filters = [ + dashboards_api.models.api_multi_search_filter_api_test_table_filter_key.ApiMultiSearchFilterApiTestTableFilterKey( + key = 'Target', + value = '', ) + ], + type = 'all', ), + data_source = 'ENDPOINT_BROWSER_SESSION' + ) + else: + return ApiTestTableWidget( + ) + """ + + def testApiTestTableWidget(self): + """Test ApiTestTableWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_timeseries_widget.py b/dashboards_api/test/test_api_timeseries_widget.py new file mode 100644 index 00000000..e43284ab --- /dev/null +++ b/dashboards_api/test/test_api_timeseries_widget.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_timeseries_widget import ApiTimeseriesWidget + +class TestApiTimeseriesWidget(unittest.TestCase): + """ApiTimeseriesWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiTimeseriesWidget: + """Test ApiTimeseriesWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiTimeseriesWidget` + """ + model = ApiTimeseriesWidget() + if include_optional: + return ApiTimeseriesWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + min_scale = 1.0, + max_scale = 100.0, + unit = 'Mbps', + show_timeseries_overall_baseline = True, + group_by = 'ALL', + is_timeseries_one_chart_per_line = True, + data_source = 'CLOUD_AND_ENTERPRISE_AGENTS' + ) + else: + return ApiTimeseriesWidget( + ) + """ + + def testApiTimeseriesWidget(self): + """Test ApiTimeseriesWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_widget.py b/dashboards_api/test/test_api_widget.py new file mode 100644 index 00000000..aa3a7f1e --- /dev/null +++ b/dashboards_api/test/test_api_widget.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_widget import ApiWidget + +class TestApiWidget(unittest.TestCase): + """ApiWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiWidget: + """Test ApiWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiWidget` + """ + model = ApiWidget() + if include_optional: + return ApiWidget( + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {Tests=[5187]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True, + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + agents = 'endpoint', + show = 'owned', + data_source = 'CLOUD_AND_ENTERPRISE_AGENTS', + alert_types = [ + 'Network - End-to-End (Server)' + ], + limit_to = 15, + active_within = None, + min_scale = 1.0, + max_scale = 100.0, + unit = 'Mbps', + group_by = 'ALL', + cards = 'ALL', + group_cards_by = 'ALL', + columns = 1, + limit = 10, + sort_by = 'alphabetical', + sort_direction = 'ascending', + is_geo_map_per_test = True, + axis_group_by = 'ALL', + show_labels = True, + is_horizontal_bar_chart = True, + compare_to_previous_value = True, + row_group_by = 'ALL', + multi_metric_columns = [ + dashboards_api.models.api_multi_metric_column.ApiMultiMetricColumn( + id = '', + data_source = 'ENDPOINT_SCHEDULED_TEST', + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = { + 'key' : [ + None + ] + }, + measure = MEAN, ) + ], + number_cards = [ + dashboards_api.models.api_numbers_card.ApiNumbersCard() + ], + column_group_by = 'ALL', + filter = dashboards_api.models.api_widget_filter_api_test_table_filter_key.ApiWidgetFilterApiTestTableFilterKey( + filters = [ + dashboards_api.models.api_multi_search_filter_api_test_table_filter_key.ApiMultiSearchFilterApiTestTableFilterKey( + key = 'Target', + value = '', ) + ], + type = 'all', ), + exclude = dashboards_api.models.api_widget_filter_api_test_table_filter_key.ApiWidgetFilterApiTestTableFilterKey( + filters = [ + dashboards_api.models.api_multi_search_filter_api_test_table_filter_key.ApiMultiSearchFilterApiTestTableFilterKey( + key = 'Target', + value = '', ) + ], + type = 'all', ), + show_timeseries_overall_baseline = True, + is_timeseries_one_chart_per_line = True + ) + else: + return ApiWidget( + ) + """ + + def testApiWidget(self): + """Test ApiWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_widget_data_point.py b/dashboards_api/test/test_api_widget_data_point.py new file mode 100644 index 00000000..93939a17 --- /dev/null +++ b/dashboards_api/test/test_api_widget_data_point.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_widget_data_point import ApiWidgetDataPoint + +class TestApiWidgetDataPoint(unittest.TestCase): + """ApiWidgetDataPoint unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiWidgetDataPoint: + """Test ApiWidgetDataPoint + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiWidgetDataPoint` + """ + model = ApiWidgetDataPoint() + if include_optional: + return ApiWidgetDataPoint( + timestamp = 1567620000, + number_of_data_points = 23304, + value = 100.0, + groups = [ + dashboards_api.models.api_data_point_group.ApiDataPointGroup( + group_property = 'COUNTRY', + group_value = 'US', ) + ] + ) + else: + return ApiWidgetDataPoint( + ) + """ + + def testApiWidgetDataPoint(self): + """Test ApiWidgetDataPoint""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_widget_data_response.py b/dashboards_api/test/test_api_widget_data_response.py new file mode 100644 index 00000000..d307df93 --- /dev/null +++ b/dashboards_api/test/test_api_widget_data_response.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_widget_data_response import ApiWidgetDataResponse + +class TestApiWidgetDataResponse(unittest.TestCase): + """ApiWidgetDataResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiWidgetDataResponse: + """Test ApiWidgetDataResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiWidgetDataResponse` + """ + model = ApiWidgetDataResponse() + if include_optional: + return ApiWidgetDataResponse( + group_labels = [ + dashboards_api.models.api_report_data_component_label_map.ApiReportDataComponentLabelMap( + group_property = 'AGENT', + group_labels = [ + dashboards_api.models.api_report_data_component_label_map_entry.ApiReportDataComponentLabelMapEntry( + group_id = '2565', + group_label = 'San Francisco, CA', ) + ], ) + ], + bin_size = 3600, + data = dashboards_api.models.api_widgets_data_v2.ApiWidgetsDataV2( + cards = [ + dashboards_api.models.api_numbers_card_data.ApiNumbersCardData( + card_id = 'lrxxr', + start_date = '2023-05-16T10:14:28Z', + end_date = '2023-05-16T10:14:28Z', + previous_value = 500.0, + bin_size = 3600, + timestamp = 1567620000, + number_of_data_points = 24192, + value = 100.0, + status = 'No data', + alert_suppression_windows = [ + dashboards_api.models.api_dashboard_asw.ApiDashboardAsw( + id = '281474976710662', + name = 'Test dashboards', + test_ids = ["281474976710661"], + start_times = ["2023-05-16T10:14:28Z"], + duration_in_seconds = 7200, + repeat = 'custom', + repeat_every = 5, + repeat_unit = 'week', ) + ], ) + ], + columns = [ + dashboards_api.models.api_multi_metric_column_data.ApiMultiMetricColumnData( + column_id = '938to', + bin_size = 3600, + points = [ + dashboards_api.models.api_widget_data_point.ApiWidgetDataPoint( + timestamp = 1567620000, + number_of_data_points = 23304, + value = 100.0, + groups = [ + dashboards_api.models.api_data_point_group.ApiDataPointGroup( + group_property = 'COUNTRY', + group_value = 'US', ) + ], ) + ], + status = 'No data', ) + ], + points = [ + dashboards_api.models.api_widget_data_point.ApiWidgetDataPoint( + timestamp = 1567620000, + number_of_data_points = 23304, + value = 100.0, ) + ], + tests = [ + dashboards_api.models.api_test_table_data.ApiTestTableData( + test_id = '68256', + test_name = 'Http Test Name', + target = 'www.google.com', + test_type = 'Web - HTTP Server', + alert_count = 398, + is_shared = True, + graphlets = [ + dashboards_api.models.api_test_table_graphlets_data.ApiTestTableGraphletsData( + metric = 'Availability', + test_id = '68257', ) + ], ) + ], + start_round = 1384309800, + alert_suppression_windows = [ + dashboards_api.models.api_dashboard_asw.ApiDashboardAsw( + id = '281474976710662', + name = 'Test dashboards', + test_ids = ["281474976710661"], + start_times = ["2023-05-16T10:14:28Z"], + duration_in_seconds = 7200, + repeat_every = 5, ) + ], + total_alerts = 500, + active_alerts = 483, + alerts = [ + dashboards_api.models.api_alert_list_alert.ApiAlertListAlert( + alert_id = '2004945', + test_id = '56512', + rule_id = '281724', + alert_source = 'Http Test', + alert_rule = 'Http Test Rule', + alert_type = 'Network - End-to-End (Server)', + start_time = '2023-06-02T08:54Z', + duration_in_seconds = 25, + active = True, ) + ], + summary = dashboards_api.models.api_agent_status_summary.ApiAgentStatusSummary( + online = 10, + offline = 2, + disabled = 3, ), + agents = [ + dashboards_api.models.api_agent_status_agent.ApiAgentStatusAgent( + agent_id = '6522', + status = 'online', + ip_info = dashboards_api.models.api_agent_status_ip_info.ApiAgentStatusIpInfo( + public_ip = '172.58.92.31', + private_ip = '172.58.92.31', + ipv6 = '', + operative_system_version = '', ), + agent_name = '0c3898000117', + location = dashboards_api.models.api_agent_location.ApiAgentLocation( + latitude = 37.77493, + longitude = -122.41942, + location_name = 'San Francisco, California, US', ), ) + ], + status = 'No data', ) + ) + else: + return ApiWidgetDataResponse( + ) + """ + + def testApiWidgetDataResponse(self): + """Test ApiWidgetDataResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_widget_filter_api_test_table_filter_key.py b/dashboards_api/test/test_api_widget_filter_api_test_table_filter_key.py new file mode 100644 index 00000000..543452fb --- /dev/null +++ b/dashboards_api/test/test_api_widget_filter_api_test_table_filter_key.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_widget_filter_api_test_table_filter_key import ApiWidgetFilterApiTestTableFilterKey + +class TestApiWidgetFilterApiTestTableFilterKey(unittest.TestCase): + """ApiWidgetFilterApiTestTableFilterKey unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiWidgetFilterApiTestTableFilterKey: + """Test ApiWidgetFilterApiTestTableFilterKey + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiWidgetFilterApiTestTableFilterKey` + """ + model = ApiWidgetFilterApiTestTableFilterKey() + if include_optional: + return ApiWidgetFilterApiTestTableFilterKey( + filters = [ + dashboards_api.models.api_multi_search_filter_api_test_table_filter_key.ApiMultiSearchFilterApiTestTableFilterKey( + key = 'Target', + value = '', ) + ], + type = 'all' + ) + else: + return ApiWidgetFilterApiTestTableFilterKey( + ) + """ + + def testApiWidgetFilterApiTestTableFilterKey(self): + """Test ApiWidgetFilterApiTestTableFilterKey""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_widget_fixed_y_scale_prefix.py b/dashboards_api/test/test_api_widget_fixed_y_scale_prefix.py new file mode 100644 index 00000000..a5412ad5 --- /dev/null +++ b/dashboards_api/test/test_api_widget_fixed_y_scale_prefix.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_widget_fixed_y_scale_prefix import ApiWidgetFixedYScalePrefix + +class TestApiWidgetFixedYScalePrefix(unittest.TestCase): + """ApiWidgetFixedYScalePrefix unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiWidgetFixedYScalePrefix(self): + """Test ApiWidgetFixedYScalePrefix""" + # inst = ApiWidgetFixedYScalePrefix() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_widget_measure.py b/dashboards_api/test/test_api_widget_measure.py new file mode 100644 index 00000000..0063fe4a --- /dev/null +++ b/dashboards_api/test/test_api_widget_measure.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_widget_measure import ApiWidgetMeasure + +class TestApiWidgetMeasure(unittest.TestCase): + """ApiWidgetMeasure unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiWidgetMeasure: + """Test ApiWidgetMeasure + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiWidgetMeasure` + """ + model = ApiWidgetMeasure() + if include_optional: + return ApiWidgetMeasure( + type = 'MEAN', + percentile_value = 95.0 + ) + else: + return ApiWidgetMeasure( + ) + """ + + def testApiWidgetMeasure(self): + """Test ApiWidgetMeasure""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_api_widgets_data_v2.py b/dashboards_api/test/test_api_widgets_data_v2.py new file mode 100644 index 00000000..80f20a06 --- /dev/null +++ b/dashboards_api/test/test_api_widgets_data_v2.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.api_widgets_data_v2 import ApiWidgetsDataV2 + +class TestApiWidgetsDataV2(unittest.TestCase): + """ApiWidgetsDataV2 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiWidgetsDataV2: + """Test ApiWidgetsDataV2 + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiWidgetsDataV2` + """ + model = ApiWidgetsDataV2() + if include_optional: + return ApiWidgetsDataV2( + cards = [ + dashboards_api.models.api_numbers_card_data.ApiNumbersCardData( + card_id = 'lrxxr', + start_date = '2023-05-16T10:14:28Z', + end_date = '2023-05-16T10:14:28Z', + previous_value = 500.0, + bin_size = 3600, + timestamp = 1567620000, + number_of_data_points = 24192, + value = 100.0, + status = 'No data', + alert_suppression_windows = [ + dashboards_api.models.api_dashboard_asw.ApiDashboardAsw( + id = '281474976710662', + name = 'Test dashboards', + test_ids = ["281474976710661"], + start_times = ["2023-05-16T10:14:28Z"], + duration_in_seconds = 7200, + repeat = 'custom', + repeat_every = 5, + repeat_unit = 'week', ) + ], ) + ], + columns = [ + dashboards_api.models.api_multi_metric_column_data.ApiMultiMetricColumnData( + column_id = '938to', + bin_size = 3600, + points = [ + dashboards_api.models.api_widget_data_point.ApiWidgetDataPoint( + timestamp = 1567620000, + number_of_data_points = 23304, + value = 100.0, + groups = [ + dashboards_api.models.api_data_point_group.ApiDataPointGroup( + group_property = 'COUNTRY', + group_value = 'US', ) + ], ) + ], + status = 'No data', + alert_suppression_windows = [ + dashboards_api.models.api_dashboard_asw.ApiDashboardAsw( + id = '281474976710662', + name = 'Test dashboards', + test_ids = ["281474976710661"], + start_times = ["2023-05-16T10:14:28Z"], + duration_in_seconds = 7200, + repeat = 'custom', + repeat_every = 5, + repeat_unit = 'week', ) + ], ) + ], + points = [ + dashboards_api.models.api_widget_data_point.ApiWidgetDataPoint( + timestamp = 1567620000, + number_of_data_points = 23304, + value = 100.0, + groups = [ + dashboards_api.models.api_data_point_group.ApiDataPointGroup( + group_property = 'COUNTRY', + group_value = 'US', ) + ], ) + ], + tests = [ + dashboards_api.models.api_test_table_data.ApiTestTableData( + test_id = '68256', + test_name = 'Http Test Name', + target = 'www.google.com', + test_type = 'Web - HTTP Server', + alert_count = 398, + is_shared = True, + graphlets = [ + dashboards_api.models.api_test_table_graphlets_data.ApiTestTableGraphletsData( + metric = 'Availability', + test_id = '68257', + points = [ + dashboards_api.models.api_graphlet_point.ApiGraphletPoint( + x = 1580403900, + y = 128.249, ) + ], ) + ], ) + ], + start_round = 1384309800, + alert_suppression_windows = [ + dashboards_api.models.api_dashboard_asw.ApiDashboardAsw( + id = '281474976710662', + name = 'Test dashboards', + test_ids = ["281474976710661"], + start_times = ["2023-05-16T10:14:28Z"], + duration_in_seconds = 7200, + repeat = 'custom', + repeat_every = 5, + repeat_unit = 'week', ) + ], + total_alerts = 500, + active_alerts = 483, + alerts = [ + dashboards_api.models.api_alert_list_alert.ApiAlertListAlert( + alert_id = '2004945', + test_id = '56512', + rule_id = '281724', + alert_source = 'Http Test', + alert_rule = 'Http Test Rule', + alert_type = 'Network - End-to-End (Server)', + start_time = '2023-06-02T08:54Z', + duration_in_seconds = 25, + active = True, ) + ], + summary = dashboards_api.models.api_agent_status_summary.ApiAgentStatusSummary( + online = 10, + offline = 2, + disabled = 3, ), + agents = [ + dashboards_api.models.api_agent_status_agent.ApiAgentStatusAgent( + agent_id = '6522', + status = 'online', + ip_info = dashboards_api.models.api_agent_status_ip_info.ApiAgentStatusIpInfo( + public_ip = '172.58.92.31', + private_ip = '172.58.92.31', + ipv6 = '', + operative_system_version = '', ), + agent_name = '0c3898000117', + location = dashboards_api.models.api_agent_location.ApiAgentLocation( + latitude = 37.77493, + longitude = -122.41942, + location_name = 'San Francisco, California, US', ), ) + ], + status = 'No data' + ) + else: + return ApiWidgetsDataV2( + ) + """ + + def testApiWidgetsDataV2(self): + """Test ApiWidgetsDataV2""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_asw_repeat.py b/dashboards_api/test/test_asw_repeat.py new file mode 100644 index 00000000..6d1deaf9 --- /dev/null +++ b/dashboards_api/test/test_asw_repeat.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.asw_repeat import AswRepeat + +class TestAswRepeat(unittest.TestCase): + """AswRepeat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAswRepeat(self): + """Test AswRepeat""" + # inst = AswRepeat() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_asw_repeat_unit.py b/dashboards_api/test/test_asw_repeat_unit.py new file mode 100644 index 00000000..53fb0c74 --- /dev/null +++ b/dashboards_api/test/test_asw_repeat_unit.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.asw_repeat_unit import AswRepeatUnit + +class TestAswRepeatUnit(unittest.TestCase): + """AswRepeatUnit unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAswRepeatUnit(self): + """Test AswRepeatUnit""" + # inst = AswRepeatUnit() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_box_and_whiskers_datasource.py b/dashboards_api/test/test_box_and_whiskers_datasource.py new file mode 100644 index 00000000..1970c226 --- /dev/null +++ b/dashboards_api/test/test_box_and_whiskers_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.box_and_whiskers_datasource import BoxAndWhiskersDatasource + +class TestBoxAndWhiskersDatasource(unittest.TestCase): + """BoxAndWhiskersDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBoxAndWhiskersDatasource(self): + """Test BoxAndWhiskersDatasource""" + # inst = BoxAndWhiskersDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_color_grid_datasource.py b/dashboards_api/test/test_color_grid_datasource.py new file mode 100644 index 00000000..74ed578a --- /dev/null +++ b/dashboards_api/test/test_color_grid_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.color_grid_datasource import ColorGridDatasource + +class TestColorGridDatasource(unittest.TestCase): + """ColorGridDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testColorGridDatasource(self): + """Test ColorGridDatasource""" + # inst = ColorGridDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_dashboard_links.py b/dashboards_api/test/test_dashboard_links.py new file mode 100644 index 00000000..ef71ac6b --- /dev/null +++ b/dashboards_api/test/test_dashboard_links.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.dashboard_links import DashboardLinks + +class TestDashboardLinks(unittest.TestCase): + """DashboardLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DashboardLinks: + """Test DashboardLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DashboardLinks` + """ + model = DashboardLinks() + if include_optional: + return DashboardLinks( + links = dashboards_api.models.dashboard_links__links.DashboardLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + snapshots = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return DashboardLinks( + ) + """ + + def testDashboardLinks(self): + """Test DashboardLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_dashboard_links_links.py b/dashboards_api/test/test_dashboard_links_links.py new file mode 100644 index 00000000..17bee187 --- /dev/null +++ b/dashboards_api/test/test_dashboard_links_links.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.dashboard_links_links import DashboardLinksLinks + +class TestDashboardLinksLinks(unittest.TestCase): + """DashboardLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DashboardLinksLinks: + """Test DashboardLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DashboardLinksLinks` + """ + model = DashboardLinksLinks() + if include_optional: + return DashboardLinksLinks( + var_self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + snapshots = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return DashboardLinksLinks( + ) + """ + + def testDashboardLinksLinks(self): + """Test DashboardLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_dashboard_metric.py b/dashboards_api/test/test_dashboard_metric.py new file mode 100644 index 00000000..72d1ad2e --- /dev/null +++ b/dashboards_api/test/test_dashboard_metric.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.dashboard_metric import DashboardMetric + +class TestDashboardMetric(unittest.TestCase): + """DashboardMetric unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDashboardMetric(self): + """Test DashboardMetric""" + # inst = DashboardMetric() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_dashboard_metric_direction.py b/dashboards_api/test/test_dashboard_metric_direction.py new file mode 100644 index 00000000..bd5aa6d5 --- /dev/null +++ b/dashboards_api/test/test_dashboard_metric_direction.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.dashboard_metric_direction import DashboardMetricDirection + +class TestDashboardMetricDirection(unittest.TestCase): + """DashboardMetricDirection unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDashboardMetricDirection(self): + """Test DashboardMetricDirection""" + # inst = DashboardMetricDirection() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_dashboard_order.py b/dashboards_api/test/test_dashboard_order.py new file mode 100644 index 00000000..01c7db51 --- /dev/null +++ b/dashboards_api/test/test_dashboard_order.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.dashboard_order import DashboardOrder + +class TestDashboardOrder(unittest.TestCase): + """DashboardOrder unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDashboardOrder(self): + """Test DashboardOrder""" + # inst = DashboardOrder() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_dashboard_snapshot_links.py b/dashboards_api/test/test_dashboard_snapshot_links.py new file mode 100644 index 00000000..2474ebeb --- /dev/null +++ b/dashboards_api/test/test_dashboard_snapshot_links.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.dashboard_snapshot_links import DashboardSnapshotLinks + +class TestDashboardSnapshotLinks(unittest.TestCase): + """DashboardSnapshotLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DashboardSnapshotLinks: + """Test DashboardSnapshotLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DashboardSnapshotLinks` + """ + model = DashboardSnapshotLinks() + if include_optional: + return DashboardSnapshotLinks( + links = dashboards_api.models.dashboard_snapshot_links__links.DashboardSnapshotLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + app_link = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return DashboardSnapshotLinks( + ) + """ + + def testDashboardSnapshotLinks(self): + """Test DashboardSnapshotLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_dashboard_snapshot_links_links.py b/dashboards_api/test/test_dashboard_snapshot_links_links.py new file mode 100644 index 00000000..68479487 --- /dev/null +++ b/dashboards_api/test/test_dashboard_snapshot_links_links.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.dashboard_snapshot_links_links import DashboardSnapshotLinksLinks + +class TestDashboardSnapshotLinksLinks(unittest.TestCase): + """DashboardSnapshotLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DashboardSnapshotLinksLinks: + """Test DashboardSnapshotLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DashboardSnapshotLinksLinks` + """ + model = DashboardSnapshotLinksLinks() + if include_optional: + return DashboardSnapshotLinksLinks( + var_self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + app_link = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return DashboardSnapshotLinksLinks( + ) + """ + + def testDashboardSnapshotLinksLinks(self): + """Test DashboardSnapshotLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_dashboard_snapshots200_response.py b/dashboards_api/test/test_dashboard_snapshots200_response.py new file mode 100644 index 00000000..251067d4 --- /dev/null +++ b/dashboards_api/test/test_dashboard_snapshots200_response.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.dashboard_snapshots200_response import DashboardSnapshots200Response + +class TestDashboardSnapshots200Response(unittest.TestCase): + """DashboardSnapshots200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DashboardSnapshots200Response: + """Test DashboardSnapshots200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DashboardSnapshots200Response` + """ + model = DashboardSnapshots200Response() + if include_optional: + return DashboardSnapshots200Response( + dashboard_snapshots = [ + null + ], + links = dashboards_api.models.pagination_links__links.PaginationLinks__links( + previous = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + next = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return DashboardSnapshots200Response( + ) + """ + + def testDashboardSnapshots200Response(self): + """Test DashboardSnapshots200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_dashboard_snapshots_api.py b/dashboards_api/test/test_dashboard_snapshots_api.py new file mode 100644 index 00000000..939d6835 --- /dev/null +++ b/dashboards_api/test/test_dashboard_snapshots_api.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest + +from dashboards_api.api.dashboard_snapshots_api import DashboardSnapshotsApi + + +class TestDashboardSnapshotsApi(unittest.TestCase): + """DashboardSnapshotsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DashboardSnapshotsApi() + + def tearDown(self) -> None: + pass + + def test_create_dashboard_snapshot(self) -> None: + """Test case for create_dashboard_snapshot + + Create dashboard snapshot + """ + pass + + def test_dashboard_snapshot_by_id(self) -> None: + """Test case for dashboard_snapshot_by_id + + Retrieve dashboard snapshot + """ + pass + + def test_dashboard_snapshots(self) -> None: + """Test case for dashboard_snapshots + + List dashboard snapshots + """ + pass + + def test_delete_dashboard_snapshot(self) -> None: + """Test case for delete_dashboard_snapshot + + Delete dashboard snapshot + """ + pass + + def test_snapshot_data_by_widget(self) -> None: + """Test case for snapshot_data_by_widget + + Retrieve dashboard snapshot data + """ + pass + + def test_update_snapshot_expiration_date(self) -> None: + """Test case for update_snapshot_expiration_date + + Update snapshot expiration + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_dashboard_snapshots_page.py b/dashboards_api/test/test_dashboard_snapshots_page.py new file mode 100644 index 00000000..a0e9bf15 --- /dev/null +++ b/dashboards_api/test/test_dashboard_snapshots_page.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.dashboard_snapshots_page import DashboardSnapshotsPage + +class TestDashboardSnapshotsPage(unittest.TestCase): + """DashboardSnapshotsPage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DashboardSnapshotsPage: + """Test DashboardSnapshotsPage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DashboardSnapshotsPage` + """ + model = DashboardSnapshotsPage() + if include_optional: + return DashboardSnapshotsPage( + dashboard_snapshots = [ + null + ] + ) + else: + return DashboardSnapshotsPage( + ) + """ + + def testDashboardSnapshotsPage(self): + """Test DashboardSnapshotsPage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_dashboards_api.py b/dashboards_api/test/test_dashboards_api.py new file mode 100644 index 00000000..6aa61195 --- /dev/null +++ b/dashboards_api/test/test_dashboards_api.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest + +from dashboards_api.api.dashboards_api import DashboardsApi + + +class TestDashboardsApi(unittest.TestCase): + """DashboardsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DashboardsApi() + + def tearDown(self) -> None: + pass + + def test_create_dashboard(self) -> None: + """Test case for create_dashboard + + Create dashboard + """ + pass + + def test_delete_dashboard(self) -> None: + """Test case for delete_dashboard + + Delete dashboard + """ + pass + + def test_get_dashboard_by_id(self) -> None: + """Test case for get_dashboard_by_id + + Retrieve dashboard + """ + pass + + def test_get_dashboard_data(self) -> None: + """Test case for get_dashboard_data + + Retrieve dashboard widget data + """ + pass + + def test_get_dashboards_for_user(self) -> None: + """Test case for get_dashboards_for_user + + List dashboards + """ + pass + + def test_update_dashboard(self) -> None: + """Test case for update_dashboard + + Update dashboard + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_duration_unit.py b/dashboards_api/test/test_duration_unit.py new file mode 100644 index 00000000..c76c3440 --- /dev/null +++ b/dashboards_api/test/test_duration_unit.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.duration_unit import DurationUnit + +class TestDurationUnit(unittest.TestCase): + """DurationUnit unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDurationUnit(self): + """Test DurationUnit""" + # inst = DurationUnit() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_enterprise_agent_state.py b/dashboards_api/test/test_enterprise_agent_state.py new file mode 100644 index 00000000..7e978cd1 --- /dev/null +++ b/dashboards_api/test/test_enterprise_agent_state.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.enterprise_agent_state import EnterpriseAgentState + +class TestEnterpriseAgentState(unittest.TestCase): + """EnterpriseAgentState unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnterpriseAgentState(self): + """Test EnterpriseAgentState""" + # inst = EnterpriseAgentState() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_error.py b/dashboards_api/test/test_error.py new file mode 100644 index 00000000..1b7642c8 --- /dev/null +++ b/dashboards_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_generate_dashboard_snapshot_request.py b/dashboards_api/test/test_generate_dashboard_snapshot_request.py new file mode 100644 index 00000000..7b8fac1b --- /dev/null +++ b/dashboards_api/test/test_generate_dashboard_snapshot_request.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.generate_dashboard_snapshot_request import GenerateDashboardSnapshotRequest + +class TestGenerateDashboardSnapshotRequest(unittest.TestCase): + """GenerateDashboardSnapshotRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GenerateDashboardSnapshotRequest: + """Test GenerateDashboardSnapshotRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GenerateDashboardSnapshotRequest` + """ + model = GenerateDashboardSnapshotRequest() + if include_optional: + return GenerateDashboardSnapshotRequest( + start_date = '2023-05-16T10:14:28Z', + end_date = '2023-05-16T10:14:28Z', + display_name = 'snapshot from API', + dashboard_id = '646f4d2ce3c99b0536c3821e', + anonymize_data = True, + timezone = 'PST', + expiration_date = '2023-05-16T10:14:28Z' + ) + else: + return GenerateDashboardSnapshotRequest( + ) + """ + + def testGenerateDashboardSnapshotRequest(self): + """Test GenerateDashboardSnapshotRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_geo_map_datasource.py b/dashboards_api/test/test_geo_map_datasource.py new file mode 100644 index 00000000..866ff8b6 --- /dev/null +++ b/dashboards_api/test/test_geo_map_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.geo_map_datasource import GeoMapDatasource + +class TestGeoMapDatasource(unittest.TestCase): + """GeoMapDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGeoMapDatasource(self): + """Test GeoMapDatasource""" + # inst = GeoMapDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_get_dashboard_data200_response.py b/dashboards_api/test/test_get_dashboard_data200_response.py new file mode 100644 index 00000000..8c08148f --- /dev/null +++ b/dashboards_api/test/test_get_dashboard_data200_response.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.get_dashboard_data200_response import GetDashboardData200Response + +class TestGetDashboardData200Response(unittest.TestCase): + """GetDashboardData200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDashboardData200Response: + """Test GetDashboardData200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetDashboardData200Response` + """ + model = GetDashboardData200Response() + if include_optional: + return GetDashboardData200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + group_labels = [ + dashboards_api.models.api_report_data_component_label_map.ApiReportDataComponentLabelMap( + group_property = 'AGENT', ) + ], + bin_size = 3600, + data = dashboards_api.models.api_widgets_data_v2.ApiWidgetsDataV2( + cards = [ + dashboards_api.models.api_numbers_card_data.ApiNumbersCardData( + card_id = 'lrxxr', + start_date = '2023-05-16T10:14:28Z', + end_date = '2023-05-16T10:14:28Z', + previous_value = 500.0, + bin_size = 3600, + timestamp = 1567620000, + number_of_data_points = 24192, + value = 100.0, + status = 'No data', + alert_suppression_windows = [ + dashboards_api.models.api_dashboard_asw.ApiDashboardAsw( + id = '281474976710662', + name = 'Test dashboards', + test_ids = ["281474976710661"], + start_times = ["2023-05-16T10:14:28Z"], + duration_in_seconds = 7200, + repeat = 'custom', + repeat_every = 5, + repeat_unit = 'week', ) + ], ) + ], + columns = [ + dashboards_api.models.api_multi_metric_column_data.ApiMultiMetricColumnData( + column_id = '938to', + bin_size = 3600, + points = [ + dashboards_api.models.api_widget_data_point.ApiWidgetDataPoint( + timestamp = 1567620000, + number_of_data_points = 23304, + value = 100.0, + groups = [ + dashboards_api.models.api_data_point_group.ApiDataPointGroup( + group_property = 'COUNTRY', + group_value = 'US', ) + ], ) + ], + status = 'No data', ) + ], + points = [ + dashboards_api.models.api_widget_data_point.ApiWidgetDataPoint( + timestamp = 1567620000, + number_of_data_points = 23304, + value = 100.0, ) + ], + tests = [ + dashboards_api.models.api_test_table_data.ApiTestTableData( + test_id = '68256', + test_name = 'Http Test Name', + target = 'www.google.com', + test_type = 'Web - HTTP Server', + alert_count = 398, + is_shared = True, + graphlets = [ + dashboards_api.models.api_test_table_graphlets_data.ApiTestTableGraphletsData( + metric = 'Availability', + test_id = '68257', ) + ], ) + ], + start_round = 1384309800, + alert_suppression_windows = [ + dashboards_api.models.api_dashboard_asw.ApiDashboardAsw( + id = '281474976710662', + name = 'Test dashboards', + test_ids = ["281474976710661"], + start_times = ["2023-05-16T10:14:28Z"], + duration_in_seconds = 7200, + repeat_every = 5, ) + ], + total_alerts = 500, + active_alerts = 483, + alerts = [ + dashboards_api.models.api_alert_list_alert.ApiAlertListAlert( + alert_id = '2004945', + test_id = '56512', + rule_id = '281724', + alert_source = 'Http Test', + alert_rule = 'Http Test Rule', + alert_type = 'Network - End-to-End (Server)', + start_time = '2023-06-02T08:54Z', + duration_in_seconds = 25, + active = True, ) + ], + summary = dashboards_api.models.api_agent_status_summary.ApiAgentStatusSummary( + online = 10, + offline = 2, + disabled = 3, ), + agents = [ + dashboards_api.models.api_agent_status_agent.ApiAgentStatusAgent( + agent_id = '6522', + status = 'online', + ip_info = dashboards_api.models.api_agent_status_ip_info.ApiAgentStatusIpInfo( + public_ip = '172.58.92.31', + private_ip = '172.58.92.31', + ipv6 = '', + operative_system_version = '', ), + agent_name = '0c3898000117', + location = dashboards_api.models.api_agent_location.ApiAgentLocation( + latitude = 37.77493, + longitude = -122.41942, + location_name = 'San Francisco, California, US', ), ) + ], + status = 'No data', ), + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetDashboardData200Response( + ) + """ + + def testGetDashboardData200Response(self): + """Test GetDashboardData200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_grouped_bar_chart_datasource.py b/dashboards_api/test/test_grouped_bar_chart_datasource.py new file mode 100644 index 00000000..5a5aa414 --- /dev/null +++ b/dashboards_api/test/test_grouped_bar_chart_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.grouped_bar_chart_datasource import GroupedBarChartDatasource + +class TestGroupedBarChartDatasource(unittest.TestCase): + """GroupedBarChartDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGroupedBarChartDatasource(self): + """Test GroupedBarChartDatasource""" + # inst = GroupedBarChartDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_link.py b/dashboards_api/test/test_link.py new file mode 100644 index 00000000..26c6a732 --- /dev/null +++ b/dashboards_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_metric_group.py b/dashboards_api/test/test_metric_group.py new file mode 100644 index 00000000..cdff6c8c --- /dev/null +++ b/dashboards_api/test/test_metric_group.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.metric_group import MetricGroup + +class TestMetricGroup(unittest.TestCase): + """MetricGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMetricGroup(self): + """Test MetricGroup""" + # inst = MetricGroup() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_multi_metrics_table_datasource.py b/dashboards_api/test/test_multi_metrics_table_datasource.py new file mode 100644 index 00000000..928d9963 --- /dev/null +++ b/dashboards_api/test/test_multi_metrics_table_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.multi_metrics_table_datasource import MultiMetricsTableDatasource + +class TestMultiMetricsTableDatasource(unittest.TestCase): + """MultiMetricsTableDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMultiMetricsTableDatasource(self): + """Test MultiMetricsTableDatasource""" + # inst = MultiMetricsTableDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_numbers_card_datasource.py b/dashboards_api/test/test_numbers_card_datasource.py new file mode 100644 index 00000000..3e8c03a2 --- /dev/null +++ b/dashboards_api/test/test_numbers_card_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.numbers_card_datasource import NumbersCardDatasource + +class TestNumbersCardDatasource(unittest.TestCase): + """NumbersCardDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumbersCardDatasource(self): + """Test NumbersCardDatasource""" + # inst = NumbersCardDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_pagination_links.py b/dashboards_api/test/test_pagination_links.py new file mode 100644 index 00000000..522519a2 --- /dev/null +++ b/dashboards_api/test/test_pagination_links.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.pagination_links import PaginationLinks + +class TestPaginationLinks(unittest.TestCase): + """PaginationLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationLinks: + """Test PaginationLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationLinks` + """ + model = PaginationLinks() + if include_optional: + return PaginationLinks( + links = dashboards_api.models.pagination_links__links.PaginationLinks__links( + previous = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + next = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return PaginationLinks( + ) + """ + + def testPaginationLinks(self): + """Test PaginationLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_pagination_links_links.py b/dashboards_api/test/test_pagination_links_links.py new file mode 100644 index 00000000..2816e576 --- /dev/null +++ b/dashboards_api/test/test_pagination_links_links.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.pagination_links_links import PaginationLinksLinks + +class TestPaginationLinksLinks(unittest.TestCase): + """PaginationLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationLinksLinks: + """Test PaginationLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationLinksLinks` + """ + model = PaginationLinksLinks() + if include_optional: + return PaginationLinksLinks( + previous = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + next = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return PaginationLinksLinks( + ) + """ + + def testPaginationLinksLinks(self): + """Test PaginationLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_pie_chart_datasource.py b/dashboards_api/test/test_pie_chart_datasource.py new file mode 100644 index 00000000..e60651c6 --- /dev/null +++ b/dashboards_api/test/test_pie_chart_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.pie_chart_datasource import PieChartDatasource + +class TestPieChartDatasource(unittest.TestCase): + """PieChartDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPieChartDatasource(self): + """Test PieChartDatasource""" + # inst = PieChartDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_query_window.py b/dashboards_api/test/test_query_window.py new file mode 100644 index 00000000..b6294573 --- /dev/null +++ b/dashboards_api/test/test_query_window.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.query_window import QueryWindow + +class TestQueryWindow(unittest.TestCase): + """QueryWindow unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> QueryWindow: + """Test QueryWindow + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `QueryWindow` + """ + model = QueryWindow() + if include_optional: + return QueryWindow( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z' + ) + else: + return QueryWindow( + ) + """ + + def testQueryWindow(self): + """Test QueryWindow""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_scalable_widget.py b/dashboards_api/test/test_scalable_widget.py new file mode 100644 index 00000000..b5f60eec --- /dev/null +++ b/dashboards_api/test/test_scalable_widget.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.scalable_widget import ScalableWidget + +class TestScalableWidget(unittest.TestCase): + """ScalableWidget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScalableWidget: + """Test ScalableWidget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScalableWidget` + """ + model = ScalableWidget() + if include_optional: + return ScalableWidget( + min_scale = 1.0, + max_scale = 100.0, + unit = 'Mbps' + ) + else: + return ScalableWidget( + ) + """ + + def testScalableWidget(self): + """Test ScalableWidget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_self_links.py b/dashboards_api/test/test_self_links.py new file mode 100644 index 00000000..7679e88a --- /dev/null +++ b/dashboards_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_self_links_links.py b/dashboards_api/test/test_self_links_links.py new file mode 100644 index 00000000..e63764b7 --- /dev/null +++ b/dashboards_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_snapshot_data_by_widget200_response.py b/dashboards_api/test/test_snapshot_data_by_widget200_response.py new file mode 100644 index 00000000..da5e7084 --- /dev/null +++ b/dashboards_api/test/test_snapshot_data_by_widget200_response.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.snapshot_data_by_widget200_response import SnapshotDataByWidget200Response + +class TestSnapshotDataByWidget200Response(unittest.TestCase): + """SnapshotDataByWidget200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SnapshotDataByWidget200Response: + """Test SnapshotDataByWidget200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SnapshotDataByWidget200Response` + """ + model = SnapshotDataByWidget200Response() + if include_optional: + return SnapshotDataByWidget200Response( + group_labels = [ + dashboards_api.models.api_report_data_component_label_map.ApiReportDataComponentLabelMap( + group_property = 'AGENT', ) + ], + bin_size = 3600, + data = dashboards_api.models.api_widgets_data_v2.ApiWidgetsDataV2( + cards = [ + dashboards_api.models.api_numbers_card_data.ApiNumbersCardData( + card_id = 'lrxxr', + start_date = '2023-05-16T10:14:28Z', + end_date = '2023-05-16T10:14:28Z', + previous_value = 500.0, + bin_size = 3600, + timestamp = 1567620000, + number_of_data_points = 24192, + value = 100.0, + status = 'No data', + alert_suppression_windows = [ + dashboards_api.models.api_dashboard_asw.ApiDashboardAsw( + id = '281474976710662', + name = 'Test dashboards', + test_ids = ["281474976710661"], + start_times = ["2023-05-16T10:14:28Z"], + duration_in_seconds = 7200, + repeat = 'custom', + repeat_every = 5, + repeat_unit = 'week', ) + ], ) + ], + columns = [ + dashboards_api.models.api_multi_metric_column_data.ApiMultiMetricColumnData( + column_id = '938to', + bin_size = 3600, + points = [ + dashboards_api.models.api_widget_data_point.ApiWidgetDataPoint( + timestamp = 1567620000, + number_of_data_points = 23304, + value = 100.0, + groups = [ + dashboards_api.models.api_data_point_group.ApiDataPointGroup( + group_property = 'COUNTRY', + group_value = 'US', ) + ], ) + ], + status = 'No data', ) + ], + points = [ + dashboards_api.models.api_widget_data_point.ApiWidgetDataPoint( + timestamp = 1567620000, + number_of_data_points = 23304, + value = 100.0, ) + ], + tests = [ + dashboards_api.models.api_test_table_data.ApiTestTableData( + test_id = '68256', + test_name = 'Http Test Name', + target = 'www.google.com', + test_type = 'Web - HTTP Server', + alert_count = 398, + is_shared = True, + graphlets = [ + dashboards_api.models.api_test_table_graphlets_data.ApiTestTableGraphletsData( + metric = 'Availability', + test_id = '68257', ) + ], ) + ], + start_round = 1384309800, + alert_suppression_windows = [ + dashboards_api.models.api_dashboard_asw.ApiDashboardAsw( + id = '281474976710662', + name = 'Test dashboards', + test_ids = ["281474976710661"], + start_times = ["2023-05-16T10:14:28Z"], + duration_in_seconds = 7200, + repeat_every = 5, ) + ], + total_alerts = 500, + active_alerts = 483, + alerts = [ + dashboards_api.models.api_alert_list_alert.ApiAlertListAlert( + alert_id = '2004945', + test_id = '56512', + rule_id = '281724', + alert_source = 'Http Test', + alert_rule = 'Http Test Rule', + alert_type = 'Network - End-to-End (Server)', + start_time = '2023-06-02T08:54Z', + duration_in_seconds = 25, + active = True, ) + ], + summary = dashboards_api.models.api_agent_status_summary.ApiAgentStatusSummary( + online = 10, + offline = 2, + disabled = 3, ), + agents = [ + dashboards_api.models.api_agent_status_agent.ApiAgentStatusAgent( + agent_id = '6522', + status = 'online', + ip_info = dashboards_api.models.api_agent_status_ip_info.ApiAgentStatusIpInfo( + public_ip = '172.58.92.31', + private_ip = '172.58.92.31', + ipv6 = '', + operative_system_version = '', ), + agent_name = '0c3898000117', + location = dashboards_api.models.api_agent_location.ApiAgentLocation( + latitude = 37.77493, + longitude = -122.41942, + location_name = 'San Francisco, California, US', ), ) + ], + status = 'No data', ), + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SnapshotDataByWidget200Response( + ) + """ + + def testSnapshotDataByWidget200Response(self): + """Test SnapshotDataByWidget200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_stacked_area_chart_datasource.py b/dashboards_api/test/test_stacked_area_chart_datasource.py new file mode 100644 index 00000000..1f21ee44 --- /dev/null +++ b/dashboards_api/test/test_stacked_area_chart_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.stacked_area_chart_datasource import StackedAreaChartDatasource + +class TestStackedAreaChartDatasource(unittest.TestCase): + """StackedAreaChartDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStackedAreaChartDatasource(self): + """Test StackedAreaChartDatasource""" + # inst = StackedAreaChartDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_stacked_bar_chart_datasource.py b/dashboards_api/test/test_stacked_bar_chart_datasource.py new file mode 100644 index 00000000..4a73f4af --- /dev/null +++ b/dashboards_api/test/test_stacked_bar_chart_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.stacked_bar_chart_datasource import StackedBarChartDatasource + +class TestStackedBarChartDatasource(unittest.TestCase): + """StackedBarChartDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStackedBarChartDatasource(self): + """Test StackedBarChartDatasource""" + # inst = StackedBarChartDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_table_datasource.py b/dashboards_api/test/test_table_datasource.py new file mode 100644 index 00000000..3ce0d9c6 --- /dev/null +++ b/dashboards_api/test/test_table_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.table_datasource import TableDatasource + +class TestTableDatasource(unittest.TestCase): + """TableDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTableDatasource(self): + """Test TableDatasource""" + # inst = TableDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_test_table_datasource.py b/dashboards_api/test/test_test_table_datasource.py new file mode 100644 index 00000000..35d88261 --- /dev/null +++ b/dashboards_api/test/test_test_table_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.test_table_datasource import TestTableDatasource + +class TestTestTableDatasource(unittest.TestCase): + """TestTableDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestTableDatasource(self): + """Test TestTableDatasource""" + # inst = TestTableDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_test_table_filter_key.py b/dashboards_api/test/test_test_table_filter_key.py new file mode 100644 index 00000000..00d31b18 --- /dev/null +++ b/dashboards_api/test/test_test_table_filter_key.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.test_table_filter_key import TestTableFilterKey + +class TestTestTableFilterKey(unittest.TestCase): + """TestTableFilterKey unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestTableFilterKey(self): + """Test TestTableFilterKey""" + # inst = TestTableFilterKey() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_test_table_filter_type.py b/dashboards_api/test/test_test_table_filter_type.py new file mode 100644 index 00000000..0f8a1fd5 --- /dev/null +++ b/dashboards_api/test/test_test_table_filter_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.test_table_filter_type import TestTableFilterType + +class TestTestTableFilterType(unittest.TestCase): + """TestTableFilterType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestTableFilterType(self): + """Test TestTableFilterType""" + # inst = TestTableFilterType() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_timeseries_datasource.py b/dashboards_api/test/test_timeseries_datasource.py new file mode 100644 index 00000000..6b78ef85 --- /dev/null +++ b/dashboards_api/test/test_timeseries_datasource.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.timeseries_datasource import TimeseriesDatasource + +class TestTimeseriesDatasource(unittest.TestCase): + """TimeseriesDatasource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTimeseriesDatasource(self): + """Test TimeseriesDatasource""" + # inst = TimeseriesDatasource() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_unauthorized_error.py b/dashboards_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..2c7a4abf --- /dev/null +++ b/dashboards_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_update_snapshot_expiration_date_api_request.py b/dashboards_api/test/test_update_snapshot_expiration_date_api_request.py new file mode 100644 index 00000000..caa6d396 --- /dev/null +++ b/dashboards_api/test/test_update_snapshot_expiration_date_api_request.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.update_snapshot_expiration_date_api_request import UpdateSnapshotExpirationDateApiRequest + +class TestUpdateSnapshotExpirationDateApiRequest(unittest.TestCase): + """UpdateSnapshotExpirationDateApiRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateSnapshotExpirationDateApiRequest: + """Test UpdateSnapshotExpirationDateApiRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateSnapshotExpirationDateApiRequest` + """ + model = UpdateSnapshotExpirationDateApiRequest() + if include_optional: + return UpdateSnapshotExpirationDateApiRequest( + snapshot_expiration_date = '2023-05-16T10:14:28Z' + ) + else: + return UpdateSnapshotExpirationDateApiRequest( + ) + """ + + def testUpdateSnapshotExpirationDateApiRequest(self): + """Test UpdateSnapshotExpirationDateApiRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_visual_mode.py b/dashboards_api/test/test_visual_mode.py new file mode 100644 index 00000000..1c2bd056 --- /dev/null +++ b/dashboards_api/test/test_visual_mode.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.visual_mode import VisualMode + +class TestVisualMode(unittest.TestCase): + """VisualMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVisualMode(self): + """Test VisualMode""" + # inst = VisualMode() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_widget.py b/dashboards_api/test/test_widget.py new file mode 100644 index 00000000..67acb485 --- /dev/null +++ b/dashboards_api/test/test_widget.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.widget import Widget + +class TestWidget(unittest.TestCase): + """Widget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Widget: + """Test Widget + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Widget` + """ + model = Widget() + if include_optional: + return Widget( + links = dashboards_api.models.self_links__links.SelfLinks__links( + self = dashboards_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + id = '1234', + type = 'Pie Chart', + title = 'Widget Title', + visual_mode = 'Full', + embed_url = 'https://embed.thousandeyes.com/e/00aa:3039802d-5c76-42d2-9a93-c6e5f9d3122f', + is_embedded = True, + metric_group = 'BGP', + direction = 'FROM_TARGET', + metric = 'ENDPOINT_GATEWAY_CPU_LOAD_PERCENT', + filters = {"Tests":["5187"]}, + measure = MEAN, + fixed_timespan = dashboards_api.models.api_duration.ApiDuration( + value = 10, + unit = 'hour', ), + api_link = '', + should_exclude_alert_suppression_windows = True + ) + else: + return Widget( + ) + """ + + def testWidget(self): + """Test Widget""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_widget_measure_type.py b/dashboards_api/test/test_widget_measure_type.py new file mode 100644 index 00000000..27c54d68 --- /dev/null +++ b/dashboards_api/test/test_widget_measure_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.widget_measure_type import WidgetMeasureType + +class TestWidgetMeasureType(unittest.TestCase): + """WidgetMeasureType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testWidgetMeasureType(self): + """Test WidgetMeasureType""" + # inst = WidgetMeasureType() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_widget_sort_direction.py b/dashboards_api/test/test_widget_sort_direction.py new file mode 100644 index 00000000..708b7f63 --- /dev/null +++ b/dashboards_api/test/test_widget_sort_direction.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.widget_sort_direction import WidgetSortDirection + +class TestWidgetSortDirection(unittest.TestCase): + """WidgetSortDirection unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testWidgetSortDirection(self): + """Test WidgetSortDirection""" + # inst = WidgetSortDirection() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_widget_sort_property.py b/dashboards_api/test/test_widget_sort_property.py new file mode 100644 index 00000000..3f843da0 --- /dev/null +++ b/dashboards_api/test/test_widget_sort_property.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.widget_sort_property import WidgetSortProperty + +class TestWidgetSortProperty(unittest.TestCase): + """WidgetSortProperty unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testWidgetSortProperty(self): + """Test WidgetSortProperty""" + # inst = WidgetSortProperty() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/test/test_widget_type.py b/dashboards_api/test/test_widget_type.py new file mode 100644 index 00000000..40e014b3 --- /dev/null +++ b/dashboards_api/test/test_widget_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Dashboards API + + Manage ThousandEyes Dashboards + + 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 unittest +import datetime + +from dashboards_api.models.widget_type import WidgetType + +class TestWidgetType(unittest.TestCase): + """WidgetType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testWidgetType(self): + """Test WidgetType""" + # inst = WidgetType() + +if __name__ == '__main__': + unittest.main() diff --git a/dashboards_api/tox.ini b/dashboards_api/tox.ini new file mode 100644 index 00000000..36415774 --- /dev/null +++ b/dashboards_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=dashboards_api diff --git a/endpoint/agents_api/.github/workflows/python.yml b/endpoint/agents_api/.github/workflows/python.yml new file mode 100644 index 00000000..129fc497 --- /dev/null +++ b/endpoint/agents_api/.github/workflows/python.yml @@ -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 diff --git a/endpoint/agents_api/.gitignore b/endpoint/agents_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/endpoint/agents_api/.gitignore @@ -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 diff --git a/endpoint/agents_api/.gitlab-ci.yml b/endpoint/agents_api/.gitlab-ci.yml new file mode 100644 index 00000000..337432fd --- /dev/null +++ b/endpoint/agents_api/.gitlab-ci.yml @@ -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 diff --git a/endpoint/agents_api/.openapi-generator-ignore b/endpoint/agents_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/endpoint/agents_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/endpoint/agents_api/.openapi-generator/FILES b/endpoint/agents_api/.openapi-generator/FILES new file mode 100644 index 00000000..257a9366 --- /dev/null +++ b/endpoint/agents_api/.openapi-generator/FILES @@ -0,0 +1,158 @@ +.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/administrative_endpoints_api.py +agents_api/api/manage_agents_api.py +agents_api/api/transfer_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_id.py +agents_api/models/address_profile.py +agents_api/models/address_type.py +agents_api/models/agent_license_type.py +agents_api/models/agent_search_request.py +agents_api/models/agent_search_request_search_filters.py +agents_api/models/agent_transfer.py +agents_api/models/agent_transfer_request.py +agents_api/models/browser_type.py +agents_api/models/endpoint_agent.py +agents_api/models/endpoint_agent_aid.py +agents_api/models/endpoint_agent_bulk_transfer207_response.py +agents_api/models/endpoint_agent_bulk_transfer207_response_items_inner.py +agents_api/models/endpoint_agent_bulk_transfer_request.py +agents_api/models/endpoint_agent_get200_response.py +agents_api/models/endpoint_agent_location.py +agents_api/models/endpoint_agent_update.py +agents_api/models/endpoint_agents.py +agents_api/models/endpoint_agents_agents_inner.py +agents_api/models/endpoint_agents_connection_string200_response.py +agents_api/models/endpoint_agents_list200_response.py +agents_api/models/endpoint_agents_search200_response.py +agents_api/models/endpoint_asn_details.py +agents_api/models/endpoint_browser_extension.py +agents_api/models/endpoint_client.py +agents_api/models/endpoint_user_profile.py +agents_api/models/endpoint_vpn_profile.py +agents_api/models/error.py +agents_api/models/ethernet_profile.py +agents_api/models/expand.py +agents_api/models/interface_hardware_type.py +agents_api/models/interface_profile.py +agents_api/models/link.py +agents_api/models/pagination_next_link.py +agents_api/models/pagination_next_link_links.py +agents_api/models/platform.py +agents_api/models/self_links.py +agents_api/models/self_links_links.py +agents_api/models/status.py +agents_api/models/unauthorized_error.py +agents_api/models/vpn_type.py +agents_api/models/wireless_profile.py +agents_api/py.typed +agents_api/rest.py +docs/AccountGroupId.md +docs/AddressProfile.md +docs/AddressType.md +docs/AdministrativeEndpointsApi.md +docs/AgentLicenseType.md +docs/AgentSearchRequest.md +docs/AgentSearchRequestSearchFilters.md +docs/AgentTransfer.md +docs/AgentTransferRequest.md +docs/BrowserType.md +docs/EndpointAgent.md +docs/EndpointAgentAid.md +docs/EndpointAgentBulkTransfer207Response.md +docs/EndpointAgentBulkTransfer207ResponseItemsInner.md +docs/EndpointAgentBulkTransferRequest.md +docs/EndpointAgentGet200Response.md +docs/EndpointAgentLocation.md +docs/EndpointAgentUpdate.md +docs/EndpointAgents.md +docs/EndpointAgentsAgentsInner.md +docs/EndpointAgentsConnectionString200Response.md +docs/EndpointAgentsList200Response.md +docs/EndpointAgentsSearch200Response.md +docs/EndpointAsnDetails.md +docs/EndpointBrowserExtension.md +docs/EndpointClient.md +docs/EndpointUserProfile.md +docs/EndpointVpnProfile.md +docs/Error.md +docs/EthernetProfile.md +docs/Expand.md +docs/InterfaceHardwareType.md +docs/InterfaceProfile.md +docs/Link.md +docs/ManageAgentsApi.md +docs/PaginationNextLink.md +docs/PaginationNextLinkLinks.md +docs/Platform.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/Status.md +docs/TransferApi.md +docs/UnauthorizedError.md +docs/VpnType.md +docs/WirelessProfile.md +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_account_group_id.py +test/test_address_profile.py +test/test_address_type.py +test/test_administrative_endpoints_api.py +test/test_agent_license_type.py +test/test_agent_search_request.py +test/test_agent_search_request_search_filters.py +test/test_agent_transfer.py +test/test_agent_transfer_request.py +test/test_browser_type.py +test/test_endpoint_agent.py +test/test_endpoint_agent_aid.py +test/test_endpoint_agent_bulk_transfer207_response.py +test/test_endpoint_agent_bulk_transfer207_response_items_inner.py +test/test_endpoint_agent_bulk_transfer_request.py +test/test_endpoint_agent_get200_response.py +test/test_endpoint_agent_location.py +test/test_endpoint_agent_update.py +test/test_endpoint_agents.py +test/test_endpoint_agents_agents_inner.py +test/test_endpoint_agents_connection_string200_response.py +test/test_endpoint_agents_list200_response.py +test/test_endpoint_agents_search200_response.py +test/test_endpoint_asn_details.py +test/test_endpoint_browser_extension.py +test/test_endpoint_client.py +test/test_endpoint_user_profile.py +test/test_endpoint_vpn_profile.py +test/test_error.py +test/test_ethernet_profile.py +test/test_expand.py +test/test_interface_hardware_type.py +test/test_interface_profile.py +test/test_link.py +test/test_manage_agents_api.py +test/test_pagination_next_link.py +test/test_pagination_next_link_links.py +test/test_platform.py +test/test_self_links.py +test/test_self_links_links.py +test/test_status.py +test/test_transfer_api.py +test/test_unauthorized_error.py +test/test_vpn_type.py +test/test_wireless_profile.py +tox.ini diff --git a/endpoint/agents_api/.openapi-generator/VERSION b/endpoint/agents_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/endpoint/agents_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/endpoint/agents_api/.travis.yml b/endpoint/agents_api/.travis.yml new file mode 100644 index 00000000..7ade2997 --- /dev/null +++ b/endpoint/agents_api/.travis.yml @@ -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 diff --git a/endpoint/agents_api/README.md b/endpoint/agents_api/README.md new file mode 100644 index 00000000..1c5b1205 --- /dev/null +++ b/endpoint/agents_api/README.md @@ -0,0 +1,170 @@ +# agents-api +Manage ThousandEyes Endpoint Agents using this API. + +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.AdministrativeEndpointsApi(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: + # Get agent connection string + api_response = api_instance.endpoint_agents_connection_string(aid=aid) + print("The response of AdministrativeEndpointsApi->endpoint_agents_connection_string:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling AdministrativeEndpointsApi->endpoint_agents_connection_string: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AdministrativeEndpointsApi* | [**endpoint_agents_connection_string**](docs/AdministrativeEndpointsApi.md#endpoint_agents_connection_string) | **GET** /v7/endpoint/agents/connection-string | Get agent connection string +*ManageAgentsApi* | [**endpoint_agent_delete**](docs/ManageAgentsApi.md#endpoint_agent_delete) | **DELETE** /v7/endpoint/agents/{agentId} | Delete endpoint agent +*ManageAgentsApi* | [**endpoint_agent_disable**](docs/ManageAgentsApi.md#endpoint_agent_disable) | **POST** /v7/endpoint/agents/{agentId}/disable | Disable endpoint agent +*ManageAgentsApi* | [**endpoint_agent_enable**](docs/ManageAgentsApi.md#endpoint_agent_enable) | **POST** /v7/endpoint/agents/{agentId}/enable | Enable endpoint agent +*ManageAgentsApi* | [**endpoint_agent_get**](docs/ManageAgentsApi.md#endpoint_agent_get) | **GET** /v7/endpoint/agents/{agentId} | Retrieve endpoint agent +*ManageAgentsApi* | [**endpoint_agent_update**](docs/ManageAgentsApi.md#endpoint_agent_update) | **PATCH** /v7/endpoint/agents/{agentId} | Update endpoint agent +*ManageAgentsApi* | [**endpoint_agents_list**](docs/ManageAgentsApi.md#endpoint_agents_list) | **GET** /v7/endpoint/agents | List endpoint agents +*ManageAgentsApi* | [**endpoint_agents_search**](docs/ManageAgentsApi.md#endpoint_agents_search) | **POST** /v7/endpoint/agents/filter | Filter endpoint agents +*TransferApi* | [**endpoint_agent_bulk_transfer**](docs/TransferApi.md#endpoint_agent_bulk_transfer) | **POST** /v7/endpoint/agents/transfer/bulk | Bulk transfer agents +*TransferApi* | [**endpoint_agent_single_transfer**](docs/TransferApi.md#endpoint_agent_single_transfer) | **POST** /v7/endpoint/agents/{agentId}/transfer | Transfer endpoint agent + + +## Documentation For Models + + - [AccountGroupId](docs/AccountGroupId.md) + - [AddressProfile](docs/AddressProfile.md) + - [AddressType](docs/AddressType.md) + - [AgentLicenseType](docs/AgentLicenseType.md) + - [AgentSearchRequest](docs/AgentSearchRequest.md) + - [AgentSearchRequestSearchFilters](docs/AgentSearchRequestSearchFilters.md) + - [AgentTransfer](docs/AgentTransfer.md) + - [AgentTransferRequest](docs/AgentTransferRequest.md) + - [BrowserType](docs/BrowserType.md) + - [EndpointAgent](docs/EndpointAgent.md) + - [EndpointAgentAid](docs/EndpointAgentAid.md) + - [EndpointAgentBulkTransfer207Response](docs/EndpointAgentBulkTransfer207Response.md) + - [EndpointAgentBulkTransfer207ResponseItemsInner](docs/EndpointAgentBulkTransfer207ResponseItemsInner.md) + - [EndpointAgentBulkTransferRequest](docs/EndpointAgentBulkTransferRequest.md) + - [EndpointAgentGet200Response](docs/EndpointAgentGet200Response.md) + - [EndpointAgentLocation](docs/EndpointAgentLocation.md) + - [EndpointAgentUpdate](docs/EndpointAgentUpdate.md) + - [EndpointAgents](docs/EndpointAgents.md) + - [EndpointAgentsAgentsInner](docs/EndpointAgentsAgentsInner.md) + - [EndpointAgentsConnectionString200Response](docs/EndpointAgentsConnectionString200Response.md) + - [EndpointAgentsList200Response](docs/EndpointAgentsList200Response.md) + - [EndpointAgentsSearch200Response](docs/EndpointAgentsSearch200Response.md) + - [EndpointAsnDetails](docs/EndpointAsnDetails.md) + - [EndpointBrowserExtension](docs/EndpointBrowserExtension.md) + - [EndpointClient](docs/EndpointClient.md) + - [EndpointUserProfile](docs/EndpointUserProfile.md) + - [EndpointVpnProfile](docs/EndpointVpnProfile.md) + - [Error](docs/Error.md) + - [EthernetProfile](docs/EthernetProfile.md) + - [Expand](docs/Expand.md) + - [InterfaceHardwareType](docs/InterfaceHardwareType.md) + - [InterfaceProfile](docs/InterfaceProfile.md) + - [Link](docs/Link.md) + - [PaginationNextLink](docs/PaginationNextLink.md) + - [PaginationNextLinkLinks](docs/PaginationNextLinkLinks.md) + - [Platform](docs/Platform.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [Status](docs/Status.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + - [VpnType](docs/VpnType.md) + - [WirelessProfile](docs/WirelessProfile.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/endpoint/agents_api/agents_api/__init__.py b/endpoint/agents_api/agents_api/__init__.py new file mode 100644 index 00000000..6e0e40eb --- /dev/null +++ b/endpoint/agents_api/agents_api/__init__.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.administrative_endpoints_api import AdministrativeEndpointsApi +from agents_api.api.manage_agents_api import ManageAgentsApi +from agents_api.api.transfer_api import TransferApi + +# 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_id import AccountGroupId +from agents_api.models.address_profile import AddressProfile +from agents_api.models.address_type import AddressType +from agents_api.models.agent_license_type import AgentLicenseType +from agents_api.models.agent_search_request import AgentSearchRequest +from agents_api.models.agent_search_request_search_filters import AgentSearchRequestSearchFilters +from agents_api.models.agent_transfer import AgentTransfer +from agents_api.models.agent_transfer_request import AgentTransferRequest +from agents_api.models.browser_type import BrowserType +from agents_api.models.endpoint_agent import EndpointAgent +from agents_api.models.endpoint_agent_aid import EndpointAgentAid +from agents_api.models.endpoint_agent_bulk_transfer207_response import EndpointAgentBulkTransfer207Response +from agents_api.models.endpoint_agent_bulk_transfer207_response_items_inner import EndpointAgentBulkTransfer207ResponseItemsInner +from agents_api.models.endpoint_agent_bulk_transfer_request import EndpointAgentBulkTransferRequest +from agents_api.models.endpoint_agent_get200_response import EndpointAgentGet200Response +from agents_api.models.endpoint_agent_location import EndpointAgentLocation +from agents_api.models.endpoint_agent_update import EndpointAgentUpdate +from agents_api.models.endpoint_agents import EndpointAgents +from agents_api.models.endpoint_agents_agents_inner import EndpointAgentsAgentsInner +from agents_api.models.endpoint_agents_connection_string200_response import EndpointAgentsConnectionString200Response +from agents_api.models.endpoint_agents_list200_response import EndpointAgentsList200Response +from agents_api.models.endpoint_agents_search200_response import EndpointAgentsSearch200Response +from agents_api.models.endpoint_asn_details import EndpointAsnDetails +from agents_api.models.endpoint_browser_extension import EndpointBrowserExtension +from agents_api.models.endpoint_client import EndpointClient +from agents_api.models.endpoint_user_profile import EndpointUserProfile +from agents_api.models.endpoint_vpn_profile import EndpointVpnProfile +from agents_api.models.error import Error +from agents_api.models.ethernet_profile import EthernetProfile +from agents_api.models.expand import Expand +from agents_api.models.interface_hardware_type import InterfaceHardwareType +from agents_api.models.interface_profile import InterfaceProfile +from agents_api.models.link import Link +from agents_api.models.pagination_next_link import PaginationNextLink +from agents_api.models.pagination_next_link_links import PaginationNextLinkLinks +from agents_api.models.platform import Platform +from agents_api.models.self_links import SelfLinks +from agents_api.models.self_links_links import SelfLinksLinks +from agents_api.models.status import Status +from agents_api.models.unauthorized_error import UnauthorizedError +from agents_api.models.vpn_type import VpnType +from agents_api.models.wireless_profile import WirelessProfile diff --git a/endpoint/agents_api/agents_api/api/__init__.py b/endpoint/agents_api/agents_api/api/__init__.py new file mode 100644 index 00000000..e6d20dcb --- /dev/null +++ b/endpoint/agents_api/agents_api/api/__init__.py @@ -0,0 +1,7 @@ +# flake8: noqa + +# import apis into api package +from agents_api.api.administrative_endpoints_api import AdministrativeEndpointsApi +from agents_api.api.manage_agents_api import ManageAgentsApi +from agents_api.api.transfer_api import TransferApi + diff --git a/endpoint/agents_api/agents_api/api/administrative_endpoints_api.py b/endpoint/agents_api/agents_api/api/administrative_endpoints_api.py new file mode 100644 index 00000000..399468cd --- /dev/null +++ b/endpoint/agents_api/agents_api/api/administrative_endpoints_api.py @@ -0,0 +1,320 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.endpoint_agents_connection_string200_response import EndpointAgentsConnectionString200Response + +from agents_api.api_client import ApiClient +from agents_api.api_response import ApiResponse +from agents_api.rest import RESTResponseType + + +class AdministrativeEndpointsApi: + """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 endpoint_agents_connection_string( + 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, + ) -> EndpointAgentsConnectionString200Response: + """Get agent connection string + + + :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._endpoint_agents_connection_string_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': "EndpointAgentsConnectionString200Response", + '401': "UnauthorizedError", + '403': "Error", + '429': "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 endpoint_agents_connection_string_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[EndpointAgentsConnectionString200Response]: + """Get agent connection string + + + :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._endpoint_agents_connection_string_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': "EndpointAgentsConnectionString200Response", + '401': "UnauthorizedError", + '403': "Error", + '429': "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 endpoint_agents_connection_string_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: + """Get agent connection string + + + :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._endpoint_agents_connection_string_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': "EndpointAgentsConnectionString200Response", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_agents_connection_string_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/endpoint/agents/connection-string', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/agents_api/agents_api/api/manage_agents_api.py b/endpoint/agents_api/agents_api/api/manage_agents_api.py new file mode 100644 index 00000000..bb73f14a --- /dev/null +++ b/endpoint/agents_api/agents_api/api/manage_agents_api.py @@ -0,0 +1,2366 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 StrictBool, StrictFloat, StrictInt, StrictStr + +from typing import List, Optional, Union + +from agents_api.models.agent_search_request import AgentSearchRequest +from agents_api.models.endpoint_agent_get200_response import EndpointAgentGet200Response +from agents_api.models.endpoint_agent_update import EndpointAgentUpdate +from agents_api.models.endpoint_agents_list200_response import EndpointAgentsList200Response +from agents_api.models.endpoint_agents_search200_response import EndpointAgentsSearch200Response +from agents_api.models.expand import Expand + +from agents_api.api_client import ApiClient +from agents_api.api_response import ApiResponse +from agents_api.rest import RESTResponseType + + +class ManageAgentsApi: + """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 endpoint_agent_delete( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = 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, + ) -> None: + """Delete endpoint agent + + Deletes the agent with the specified `agent_id`. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :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._endpoint_agent_delete_serialize( + agent_id=agent_id, + 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]] = { + + } + 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 endpoint_agent_delete_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = 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[None]: + """Delete endpoint agent + + Deletes the agent with the specified `agent_id`. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :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._endpoint_agent_delete_serialize( + agent_id=agent_id, + 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]] = { + + } + 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 endpoint_agent_delete_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = 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: + """Delete endpoint agent + + Deletes the agent with the specified `agent_id`. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :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._endpoint_agent_delete_serialize( + agent_id=agent_id, + 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]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_agent_delete_serialize( + self, + agent_id, + 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 + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/endpoint/agents/{agentId}', + 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 endpoint_agent_disable( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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, + ) -> EndpointAgentGet200Response: + """Disable endpoint agent + + Disables an endpoint agent. If it's already disabled, it has no effect (no operation). + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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._endpoint_agent_disable_serialize( + agent_id=agent_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': "EndpointAgentGet200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_agent_disable_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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[EndpointAgentGet200Response]: + """Disable endpoint agent + + Disables an endpoint agent. If it's already disabled, it has no effect (no operation). + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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._endpoint_agent_disable_serialize( + agent_id=agent_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': "EndpointAgentGet200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_agent_disable_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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: + """Disable endpoint agent + + Disables an endpoint agent. If it's already disabled, it has no effect (no operation). + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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._endpoint_agent_disable_serialize( + agent_id=agent_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': "EndpointAgentGet200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_agent_disable_serialize( + self, + agent_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 agent_id is not None: + _path_params['agentId'] = agent_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='POST', + resource_path='/v7/endpoint/agents/{agentId}/disable', + 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 endpoint_agent_enable( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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, + ) -> EndpointAgentGet200Response: + """Enable endpoint agent + + Enables an endpoint agent. If it's already enabled, it has no effect (no operation). + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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._endpoint_agent_enable_serialize( + agent_id=agent_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': "EndpointAgentGet200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_agent_enable_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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[EndpointAgentGet200Response]: + """Enable endpoint agent + + Enables an endpoint agent. If it's already enabled, it has no effect (no operation). + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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._endpoint_agent_enable_serialize( + agent_id=agent_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': "EndpointAgentGet200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_agent_enable_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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: + """Enable endpoint agent + + Enables an endpoint agent. If it's already enabled, it has no effect (no operation). + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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._endpoint_agent_enable_serialize( + agent_id=agent_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': "EndpointAgentGet200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_agent_enable_serialize( + self, + agent_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 agent_id is not None: + _path_params['agentId'] = agent_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='POST', + resource_path='/v7/endpoint/agents/{agentId}/enable', + 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 endpoint_agent_get( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = 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, + ) -> EndpointAgentGet200Response: + """Retrieve endpoint agent + + Retrieves details of an agent with the specified `agent_id`. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :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._endpoint_agent_get_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + include_deleted=include_deleted, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentGet200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_agent_get_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = 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[EndpointAgentGet200Response]: + """Retrieve endpoint agent + + Retrieves details of an agent with the specified `agent_id`. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :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._endpoint_agent_get_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + include_deleted=include_deleted, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentGet200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_agent_get_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = 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 endpoint agent + + Retrieves details of an agent with the specified `agent_id`. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :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._endpoint_agent_get_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + include_deleted=include_deleted, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentGet200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_agent_get_serialize( + self, + agent_id, + aid, + expand, + include_deleted, + _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)) + + if include_deleted is not None: + + _query_params.append(('includeDeleted', include_deleted)) + + # 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/endpoint/agents/{agentId}', + 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 endpoint_agent_update( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + endpoint_agent_update: Annotated[Optional[EndpointAgentUpdate], Field(description="Fields to modify on the agent")] = 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, + ) -> EndpointAgentGet200Response: + """Update endpoint agent + + Updates the agent with the specified `agent_id`. This API supports the modification of the following fields: * `name` * `licenseType` Any attempt to update fields other than those listed above, with a value different from their current value, will result in a 400 Bad Request response. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :param endpoint_agent_update: Fields to modify on the agent + :type endpoint_agent_update: EndpointAgentUpdate + :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._endpoint_agent_update_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + endpoint_agent_update=endpoint_agent_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentGet200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_agent_update_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + endpoint_agent_update: Annotated[Optional[EndpointAgentUpdate], Field(description="Fields to modify on the agent")] = 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[EndpointAgentGet200Response]: + """Update endpoint agent + + Updates the agent with the specified `agent_id`. This API supports the modification of the following fields: * `name` * `licenseType` Any attempt to update fields other than those listed above, with a value different from their current value, will result in a 400 Bad Request response. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :param endpoint_agent_update: Fields to modify on the agent + :type endpoint_agent_update: EndpointAgentUpdate + :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._endpoint_agent_update_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + endpoint_agent_update=endpoint_agent_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentGet200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_agent_update_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + endpoint_agent_update: Annotated[Optional[EndpointAgentUpdate], Field(description="Fields to modify on the agent")] = 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: + """Update endpoint agent + + Updates the agent with the specified `agent_id`. This API supports the modification of the following fields: * `name` * `licenseType` Any attempt to update fields other than those listed above, with a value different from their current value, will result in a 400 Bad Request response. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :param endpoint_agent_update: Fields to modify on the agent + :type endpoint_agent_update: EndpointAgentUpdate + :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._endpoint_agent_update_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + endpoint_agent_update=endpoint_agent_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentGet200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_agent_update_serialize( + self, + agent_id, + aid, + expand, + endpoint_agent_update, + _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 endpoint_agent_update is not None: + _body_params = endpoint_agent_update + + + # 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='PATCH', + resource_path='/v7/endpoint/agents/{agentId}', + 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 endpoint_agents_list( + self, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = None, + use_all_permitted_aids: Annotated[Optional[StrictBool], Field(description="Set to `true` to load data from all accounts the user has access to.")] = None, + agent_name: Annotated[Optional[StrictStr], Field(description="Returns only agents with the specified name. This is an exact match only. ")] = None, + computer_name: Annotated[Optional[StrictStr], Field(description="Returns only agents with the specified computer name. This is an exact match only. ")] = 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, + ) -> EndpointAgentsList200Response: + """List endpoint agents + + Retrieves a list of endpoint agents in a given account group. If there are no agents in the specified account group, it returns an empty array. + + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: 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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :param use_all_permitted_aids: Set to `true` to load data from all accounts the user has access to. + :type use_all_permitted_aids: bool + :param agent_name: Returns only agents with the specified name. This is an exact match only. + :type agent_name: str + :param computer_name: Returns only agents with the specified computer name. This is an exact match only. + :type computer_name: 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._endpoint_agents_list_serialize( + max=max, + cursor=cursor, + aid=aid, + expand=expand, + include_deleted=include_deleted, + use_all_permitted_aids=use_all_permitted_aids, + agent_name=agent_name, + computer_name=computer_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentsList200Response", + '401': "UnauthorizedError", + '403': "Error", + '429': "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 endpoint_agents_list_with_http_info( + self, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = None, + use_all_permitted_aids: Annotated[Optional[StrictBool], Field(description="Set to `true` to load data from all accounts the user has access to.")] = None, + agent_name: Annotated[Optional[StrictStr], Field(description="Returns only agents with the specified name. This is an exact match only. ")] = None, + computer_name: Annotated[Optional[StrictStr], Field(description="Returns only agents with the specified computer name. This is an exact match only. ")] = 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[EndpointAgentsList200Response]: + """List endpoint agents + + Retrieves a list of endpoint agents in a given account group. If there are no agents in the specified account group, it returns an empty array. + + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: 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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :param use_all_permitted_aids: Set to `true` to load data from all accounts the user has access to. + :type use_all_permitted_aids: bool + :param agent_name: Returns only agents with the specified name. This is an exact match only. + :type agent_name: str + :param computer_name: Returns only agents with the specified computer name. This is an exact match only. + :type computer_name: 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._endpoint_agents_list_serialize( + max=max, + cursor=cursor, + aid=aid, + expand=expand, + include_deleted=include_deleted, + use_all_permitted_aids=use_all_permitted_aids, + agent_name=agent_name, + computer_name=computer_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentsList200Response", + '401': "UnauthorizedError", + '403': "Error", + '429': "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 endpoint_agents_list_without_preload_content( + self, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = None, + use_all_permitted_aids: Annotated[Optional[StrictBool], Field(description="Set to `true` to load data from all accounts the user has access to.")] = None, + agent_name: Annotated[Optional[StrictStr], Field(description="Returns only agents with the specified name. This is an exact match only. ")] = None, + computer_name: Annotated[Optional[StrictStr], Field(description="Returns only agents with the specified computer name. This is an exact match only. ")] = 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 endpoint agents + + Retrieves a list of endpoint agents in a given account group. If there are no agents in the specified account group, it returns an empty array. + + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: 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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :param use_all_permitted_aids: Set to `true` to load data from all accounts the user has access to. + :type use_all_permitted_aids: bool + :param agent_name: Returns only agents with the specified name. This is an exact match only. + :type agent_name: str + :param computer_name: Returns only agents with the specified computer name. This is an exact match only. + :type computer_name: 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._endpoint_agents_list_serialize( + max=max, + cursor=cursor, + aid=aid, + expand=expand, + include_deleted=include_deleted, + use_all_permitted_aids=use_all_permitted_aids, + agent_name=agent_name, + computer_name=computer_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentsList200Response", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_agents_list_serialize( + self, + max, + cursor, + aid, + expand, + include_deleted, + use_all_permitted_aids, + agent_name, + computer_name, + _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 + # process the query parameters + if max is not None: + + _query_params.append(('max', max)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if include_deleted is not None: + + _query_params.append(('includeDeleted', include_deleted)) + + if use_all_permitted_aids is not None: + + _query_params.append(('useAllPermittedAids', use_all_permitted_aids)) + + if agent_name is not None: + + _query_params.append(('agentName', agent_name)) + + if computer_name is not None: + + _query_params.append(('computerName', computer_name)) + + # 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/endpoint/agents', + 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 endpoint_agents_search( + self, + agent_search_request: Annotated[AgentSearchRequest, Field(description="The filter options for advanced search filtering for agents.")], + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = 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, + ) -> EndpointAgentsSearch200Response: + """Filter endpoint agents + + Retrieves a list of endpoint agents within the specified account group that match the specified filters. If no agents meet the filter criteria, the API returns an empty array. + + :param agent_search_request: The filter options for advanced search filtering for agents. (required) + :type agent_search_request: AgentSearchRequest + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: 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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :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._endpoint_agents_search_serialize( + agent_search_request=agent_search_request, + max=max, + cursor=cursor, + aid=aid, + expand=expand, + include_deleted=include_deleted, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentsSearch200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '429': "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 endpoint_agents_search_with_http_info( + self, + agent_search_request: Annotated[AgentSearchRequest, Field(description="The filter options for advanced search filtering for agents.")], + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = 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[EndpointAgentsSearch200Response]: + """Filter endpoint agents + + Retrieves a list of endpoint agents within the specified account group that match the specified filters. If no agents meet the filter criteria, the API returns an empty array. + + :param agent_search_request: The filter options for advanced search filtering for agents. (required) + :type agent_search_request: AgentSearchRequest + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: 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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :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._endpoint_agents_search_serialize( + agent_search_request=agent_search_request, + max=max, + cursor=cursor, + aid=aid, + expand=expand, + include_deleted=include_deleted, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentsSearch200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '429': "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 endpoint_agents_search_without_preload_content( + self, + agent_search_request: Annotated[AgentSearchRequest, Field(description="The filter options for advanced search filtering for agents.")], + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + 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[Expand]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = 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: + """Filter endpoint agents + + Retrieves a list of endpoint agents within the specified account group that match the specified filters. If no agents meet the filter criteria, the API returns an empty array. + + :param agent_search_request: The filter options for advanced search filtering for agents. (required) + :type agent_search_request: AgentSearchRequest + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: 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 expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[Expand] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :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._endpoint_agents_search_serialize( + agent_search_request=agent_search_request, + max=max, + cursor=cursor, + aid=aid, + expand=expand, + include_deleted=include_deleted, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentsSearch200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_agents_search_serialize( + self, + agent_search_request, + max, + cursor, + aid, + expand, + include_deleted, + _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 + # process the query parameters + if max is not None: + + _query_params.append(('max', max)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if include_deleted is not None: + + _query_params.append(('includeDeleted', include_deleted)) + + # process the header parameters + # process the form parameters + # process the body parameter + if agent_search_request is not None: + _body_params = agent_search_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/endpoint/agents/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/agents_api/agents_api/api/transfer_api.py b/endpoint/agents_api/agents_api/api/transfer_api.py new file mode 100644 index 00000000..0f23b7c2 --- /dev/null +++ b/endpoint/agents_api/agents_api/api/transfer_api.py @@ -0,0 +1,665 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.agent_transfer_request import AgentTransferRequest +from agents_api.models.endpoint_agent_bulk_transfer207_response import EndpointAgentBulkTransfer207Response +from agents_api.models.endpoint_agent_bulk_transfer_request import EndpointAgentBulkTransferRequest + +from agents_api.api_client import ApiClient +from agents_api.api_response import ApiResponse +from agents_api.rest import RESTResponseType + + +class TransferApi: + """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 endpoint_agent_bulk_transfer( + 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, + endpoint_agent_bulk_transfer_request: Annotated[Optional[EndpointAgentBulkTransferRequest], Field(description="A collection of `AgentTransfers`.")] = 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, + ) -> EndpointAgentBulkTransfer207Response: + """Bulk transfer agents + + Initiates the transfer of multiple agents between accounts. The following conditions apply: * The requester must possess 'write' permissions for both the 'from' and 'to' accounts involved in each transfer. * Multiple transfers may involve a mix of different source and destination accounts. * For each transfer request, the 'from' account must match the current account of the respective agent. * Transfers are executed asynchronously. * Progress tracking is not intended, but users can monitor the progress by periodically polling the 'get agent' endpoint. * Each transfer request is individually validated and completed; this operation is not atomic, meaning transfers can succeed or fail individually. * The API response provides the status of each transfer request. + + :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 endpoint_agent_bulk_transfer_request: A collection of `AgentTransfers`. + :type endpoint_agent_bulk_transfer_request: EndpointAgentBulkTransferRequest + :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._endpoint_agent_bulk_transfer_serialize( + aid=aid, + endpoint_agent_bulk_transfer_request=endpoint_agent_bulk_transfer_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '207': "EndpointAgentBulkTransfer207Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_agent_bulk_transfer_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, + endpoint_agent_bulk_transfer_request: Annotated[Optional[EndpointAgentBulkTransferRequest], Field(description="A collection of `AgentTransfers`.")] = 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[EndpointAgentBulkTransfer207Response]: + """Bulk transfer agents + + Initiates the transfer of multiple agents between accounts. The following conditions apply: * The requester must possess 'write' permissions for both the 'from' and 'to' accounts involved in each transfer. * Multiple transfers may involve a mix of different source and destination accounts. * For each transfer request, the 'from' account must match the current account of the respective agent. * Transfers are executed asynchronously. * Progress tracking is not intended, but users can monitor the progress by periodically polling the 'get agent' endpoint. * Each transfer request is individually validated and completed; this operation is not atomic, meaning transfers can succeed or fail individually. * The API response provides the status of each transfer request. + + :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 endpoint_agent_bulk_transfer_request: A collection of `AgentTransfers`. + :type endpoint_agent_bulk_transfer_request: EndpointAgentBulkTransferRequest + :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._endpoint_agent_bulk_transfer_serialize( + aid=aid, + endpoint_agent_bulk_transfer_request=endpoint_agent_bulk_transfer_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '207': "EndpointAgentBulkTransfer207Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_agent_bulk_transfer_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, + endpoint_agent_bulk_transfer_request: Annotated[Optional[EndpointAgentBulkTransferRequest], Field(description="A collection of `AgentTransfers`.")] = 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: + """Bulk transfer agents + + Initiates the transfer of multiple agents between accounts. The following conditions apply: * The requester must possess 'write' permissions for both the 'from' and 'to' accounts involved in each transfer. * Multiple transfers may involve a mix of different source and destination accounts. * For each transfer request, the 'from' account must match the current account of the respective agent. * Transfers are executed asynchronously. * Progress tracking is not intended, but users can monitor the progress by periodically polling the 'get agent' endpoint. * Each transfer request is individually validated and completed; this operation is not atomic, meaning transfers can succeed or fail individually. * The API response provides the status of each transfer request. + + :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 endpoint_agent_bulk_transfer_request: A collection of `AgentTransfers`. + :type endpoint_agent_bulk_transfer_request: EndpointAgentBulkTransferRequest + :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._endpoint_agent_bulk_transfer_serialize( + aid=aid, + endpoint_agent_bulk_transfer_request=endpoint_agent_bulk_transfer_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '207': "EndpointAgentBulkTransfer207Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_agent_bulk_transfer_serialize( + self, + aid, + endpoint_agent_bulk_transfer_request, + _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 + if endpoint_agent_bulk_transfer_request is not None: + _body_params = endpoint_agent_bulk_transfer_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', + 'text/csv', + 'text/plain' + ] + ) + ) + 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/endpoint/agents/transfer/bulk', + 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 endpoint_agent_single_transfer( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + agent_transfer_request: Annotated[AgentTransferRequest, Field(description="The request to move an agent between accounts.")], + 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, + ) -> None: + """Transfer endpoint agent + + Initiates the transfer of an agent from its current account, which must correspond to the provided aid, to the target account. **Note:** It is essential to ensure that the `aid` parameter matches the current account of the agent for this operation to succeed. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param agent_transfer_request: The request to move an agent between accounts. (required) + :type agent_transfer_request: AgentTransferRequest + :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._endpoint_agent_single_transfer_serialize( + agent_id=agent_id, + agent_transfer_request=agent_transfer_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 endpoint_agent_single_transfer_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + agent_transfer_request: Annotated[AgentTransferRequest, Field(description="The request to move an agent between accounts.")], + 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[None]: + """Transfer endpoint agent + + Initiates the transfer of an agent from its current account, which must correspond to the provided aid, to the target account. **Note:** It is essential to ensure that the `aid` parameter matches the current account of the agent for this operation to succeed. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param agent_transfer_request: The request to move an agent between accounts. (required) + :type agent_transfer_request: AgentTransferRequest + :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._endpoint_agent_single_transfer_serialize( + agent_id=agent_id, + agent_transfer_request=agent_transfer_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 endpoint_agent_single_transfer_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + agent_transfer_request: Annotated[AgentTransferRequest, Field(description="The request to move an agent between accounts.")], + 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: + """Transfer endpoint agent + + Initiates the transfer of an agent from its current account, which must correspond to the provided aid, to the target account. **Note:** It is essential to ensure that the `aid` parameter matches the current account of the agent for this operation to succeed. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param agent_transfer_request: The request to move an agent between accounts. (required) + :type agent_transfer_request: AgentTransferRequest + :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._endpoint_agent_single_transfer_serialize( + agent_id=agent_id, + agent_transfer_request=agent_transfer_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_agent_single_transfer_serialize( + self, + agent_id, + agent_transfer_request, + 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 agent_id is not None: + _path_params['agentId'] = agent_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 + if agent_transfer_request is not None: + _body_params = agent_transfer_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '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/endpoint/agents/{agentId}/transfer', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/agents_api/agents_api/api_client.py b/endpoint/agents_api/agents_api/api_client.py new file mode 100644 index 00000000..cab7c5b0 --- /dev/null +++ b/endpoint/agents_api/agents_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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) diff --git a/endpoint/agents_api/agents_api/api_response.py b/endpoint/agents_api/agents_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/endpoint/agents_api/agents_api/api_response.py @@ -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 + } diff --git a/endpoint/agents_api/agents_api/configuration.py b/endpoint/agents_api/agents_api/configuration.py new file mode 100644 index 00000000..a57db30e --- /dev/null +++ b/endpoint/agents_api/agents_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 diff --git a/endpoint/agents_api/agents_api/exceptions.py b/endpoint/agents_api/agents_api/exceptions.py new file mode 100644 index 00000000..07dd45ce --- /dev/null +++ b/endpoint/agents_api/agents_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 diff --git a/endpoint/agents_api/agents_api/models/__init__.py b/endpoint/agents_api/agents_api/models/__init__.py new file mode 100644 index 00000000..3791e077 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/__init__.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +# flake8: noqa +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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_id import AccountGroupId +from agents_api.models.address_profile import AddressProfile +from agents_api.models.address_type import AddressType +from agents_api.models.agent_license_type import AgentLicenseType +from agents_api.models.agent_search_request import AgentSearchRequest +from agents_api.models.agent_search_request_search_filters import AgentSearchRequestSearchFilters +from agents_api.models.agent_transfer import AgentTransfer +from agents_api.models.agent_transfer_request import AgentTransferRequest +from agents_api.models.browser_type import BrowserType +from agents_api.models.endpoint_agent import EndpointAgent +from agents_api.models.endpoint_agent_aid import EndpointAgentAid +from agents_api.models.endpoint_agent_bulk_transfer207_response import EndpointAgentBulkTransfer207Response +from agents_api.models.endpoint_agent_bulk_transfer207_response_items_inner import EndpointAgentBulkTransfer207ResponseItemsInner +from agents_api.models.endpoint_agent_bulk_transfer_request import EndpointAgentBulkTransferRequest +from agents_api.models.endpoint_agent_get200_response import EndpointAgentGet200Response +from agents_api.models.endpoint_agent_location import EndpointAgentLocation +from agents_api.models.endpoint_agent_update import EndpointAgentUpdate +from agents_api.models.endpoint_agents import EndpointAgents +from agents_api.models.endpoint_agents_agents_inner import EndpointAgentsAgentsInner +from agents_api.models.endpoint_agents_connection_string200_response import EndpointAgentsConnectionString200Response +from agents_api.models.endpoint_agents_list200_response import EndpointAgentsList200Response +from agents_api.models.endpoint_agents_search200_response import EndpointAgentsSearch200Response +from agents_api.models.endpoint_asn_details import EndpointAsnDetails +from agents_api.models.endpoint_browser_extension import EndpointBrowserExtension +from agents_api.models.endpoint_client import EndpointClient +from agents_api.models.endpoint_user_profile import EndpointUserProfile +from agents_api.models.endpoint_vpn_profile import EndpointVpnProfile +from agents_api.models.error import Error +from agents_api.models.ethernet_profile import EthernetProfile +from agents_api.models.expand import Expand +from agents_api.models.interface_hardware_type import InterfaceHardwareType +from agents_api.models.interface_profile import InterfaceProfile +from agents_api.models.link import Link +from agents_api.models.pagination_next_link import PaginationNextLink +from agents_api.models.pagination_next_link_links import PaginationNextLinkLinks +from agents_api.models.platform import Platform +from agents_api.models.self_links import SelfLinks +from agents_api.models.self_links_links import SelfLinksLinks +from agents_api.models.status import Status +from agents_api.models.unauthorized_error import UnauthorizedError +from agents_api.models.vpn_type import VpnType +from agents_api.models.wireless_profile import WirelessProfile diff --git a/endpoint/agents_api/agents_api/models/account_group_id.py b/endpoint/agents_api/agents_api/models/account_group_id.py new file mode 100644 index 00000000..eb22a6b0 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/account_group_id.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 + + diff --git a/endpoint/agents_api/agents_api/models/address_profile.py b/endpoint/agents_api/agents_api/models/address_profile.py new file mode 100644 index 00000000..ff4ec1a5 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/address_profile.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 +from agents_api.models.address_type import AddressType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AddressProfile(BaseModel): + """ + A description of the IPs assigned to this machine. + """ # noqa: E501 + address_type: Optional[AddressType] = Field(default=None, alias="addressType") + ip_address: Optional[StrictStr] = Field(default=None, description="IP address of this interface in the network it's currently connected to.", alias="ipAddress") + prefix_length: Optional[StrictInt] = Field(default=None, description="The number of bits representing the network part of the `ipAddress`.", alias="prefixLength") + gateway: Optional[StrictStr] = Field(default=None, description="The default gateway for this interface.") + router_hardware_address: Optional[StrictStr] = Field(default=None, description="The router's MAC address resolved from an ARP request.", alias="routerHardwareAddress") + __properties: ClassVar[List[str]] = ["addressType", "ipAddress", "prefixLength", "gateway", "routerHardwareAddress"] + + 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 AddressProfile 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 AddressProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "addressType": obj.get("addressType"), + "ipAddress": obj.get("ipAddress"), + "prefixLength": obj.get("prefixLength"), + "gateway": obj.get("gateway"), + "routerHardwareAddress": obj.get("routerHardwareAddress") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/address_type.py b/endpoint/agents_api/agents_api/models/address_type.py new file mode 100644 index 00000000..010e0682 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/address_type.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 AddressType(str, Enum): + """ + AddressType + """ + + """ + allowed enum values + """ + LOOPBACK = 'loopback' + UNSPECIFIED = 'unspecified' + UNIQUE_MINUS_LOCAL = 'unique-local' + LINK_MINUS_LOCAL = 'link-local' + UNIQUE_MINUS_GLOBAL = 'unique-global' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AddressType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/agents_api/agents_api/models/agent_license_type.py b/endpoint/agents_api/agents_api/models/agent_license_type.py new file mode 100644 index 00000000..83079402 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/agent_license_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 AgentLicenseType(str, Enum): + """ + AgentLicenseType + """ + + """ + allowed enum values + """ + ESSENTIALS = 'essentials' + ADVANTAGE = 'advantage' + EMBEDDED = 'embedded' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AgentLicenseType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/agents_api/agents_api/models/agent_search_request.py b/endpoint/agents_api/agents_api/models/agent_search_request.py new file mode 100644 index 00000000..8e0ccc66 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/agent_search_request.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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_search_request_search_filters import AgentSearchRequestSearchFilters +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AgentSearchRequest(BaseModel): + """ + Parameters for filtering a list of agents. + """ # noqa: E501 + search_filters: Optional[AgentSearchRequestSearchFilters] = Field(default=None, alias="searchFilters") + __properties: ClassVar[List[str]] = ["searchFilters"] + + 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 AgentSearchRequest 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 search_filters + if self.search_filters: + _dict['searchFilters'] = self.search_filters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AgentSearchRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "searchFilters": AgentSearchRequestSearchFilters.from_dict(obj.get("searchFilters")) if obj.get("searchFilters") is not None else None + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/agent_search_request_search_filters.py b/endpoint/agents_api/agents_api/models/agent_search_request_search_filters.py new file mode 100644 index 00000000..59bbec8b --- /dev/null +++ b/endpoint/agents_api/agents_api/models/agent_search_request_search_filters.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.platform import Platform +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AgentSearchRequestSearchFilters(BaseModel): + """ + AgentSearchRequestSearchFilters + """ # noqa: E501 + agent_name: Optional[List[StrictStr]] = Field(default=None, description="Returns only agents with the given name. This is an exact match only. ", alias="agentName") + computer_name: Optional[List[StrictStr]] = Field(default=None, description="Returns only agents with the given computer name. This is an exact match only. ", alias="computerName") + username: Optional[List[StrictStr]] = Field(default=None, description="Returns only agents that have at least one user with a name. starting with the provided string. This is a case-insensitive prefix match. ") + platform: Optional[List[Platform]] = Field(default=None, description="Filter on the platform on which the agent is running. ") + os_version: Optional[List[StrictStr]] = Field(default=None, description="Case-insensitive prefix filter on the OS version.", alias="osVersion") + location_country_iso: Optional[List[StrictStr]] = Field(default=None, description="Filter using the ISO country code of the location. ", alias="locationCountryISO") + location_subdivision1_code: Optional[List[StrictStr]] = Field(default=None, description="Filter using the code for the first level administrative division within the country. In US/Canada this is the State, in UK it's the country e.g. `ENG` ", alias="locationSubdivision1Code") + location_city: Optional[List[StrictStr]] = Field(default=None, description="This is a prefix match on the city name field. The endpoint expects this to contain the name of the city in English. e.g. 'Paris' or '' ", alias="locationCity") + __properties: ClassVar[List[str]] = ["agentName", "computerName", "username", "platform", "osVersion", "locationCountryISO", "locationSubdivision1Code", "locationCity"] + + 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 AgentSearchRequestSearchFilters 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 AgentSearchRequestSearchFilters 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"), + "computerName": obj.get("computerName"), + "username": obj.get("username"), + "platform": obj.get("platform"), + "osVersion": obj.get("osVersion"), + "locationCountryISO": obj.get("locationCountryISO"), + "locationSubdivision1Code": obj.get("locationSubdivision1Code"), + "locationCity": obj.get("locationCity") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/agent_transfer.py b/endpoint/agents_api/agents_api/models/agent_transfer.py new file mode 100644 index 00000000..843f8eda --- /dev/null +++ b/endpoint/agents_api/agents_api/models/agent_transfer.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 AgentTransfer(BaseModel): + """ + AgentTransfer + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Identifier of the agent this applies to.", alias="agentId") + from_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.", alias="fromAid") + to_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.", alias="toAid") + __properties: ClassVar[List[str]] = ["agentId", "fromAid", "toAid"] + + 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 AgentTransfer 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={ + "agent_id", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AgentTransfer from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "fromAid": obj.get("fromAid"), + "toAid": obj.get("toAid") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/agent_transfer_request.py b/endpoint/agents_api/agents_api/models/agent_transfer_request.py new file mode 100644 index 00000000..4053c092 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/agent_transfer_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 AgentTransferRequest(BaseModel): + """ + AgentTransferRequest + """ # noqa: E501 + to_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.", alias="toAid") + __properties: ClassVar[List[str]] = ["toAid"] + + 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 AgentTransferRequest 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 AgentTransferRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "toAid": obj.get("toAid") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/browser_type.py b/endpoint/agents_api/agents_api/models/browser_type.py new file mode 100644 index 00000000..c1c1fcad --- /dev/null +++ b/endpoint/agents_api/agents_api/models/browser_type.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 BrowserType(str, Enum): + """ + BrowserType + """ + + """ + allowed enum values + """ + CHROME = 'chrome' + CHROME_MINUS_CANARY = 'chrome-canary' + CHROMIUM = 'chromium' + IE = 'ie' + EDGE = 'edge' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of BrowserType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_agent.py b/endpoint/agents_api/agents_api/models/endpoint_agent.py new file mode 100644 index 00000000..8d4b0f46 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_agent.py @@ -0,0 +1,215 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.agent_license_type import AgentLicenseType +from agents_api.models.endpoint_agent_aid import EndpointAgentAid +from agents_api.models.endpoint_agent_location import EndpointAgentLocation +from agents_api.models.endpoint_asn_details import EndpointAsnDetails +from agents_api.models.endpoint_client import EndpointClient +from agents_api.models.endpoint_vpn_profile import EndpointVpnProfile +from agents_api.models.interface_profile import InterfaceProfile +from agents_api.models.platform import Platform +from agents_api.models.status import Status +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgent(BaseModel): + """ + The `EndpointAgent` object, which may include multiple clients. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the agent this applies to.") + aid: Optional[EndpointAgentAid] = None + name: Optional[StrictStr] = Field(default=None, description="The name of the agent.") + computer_name: Optional[StrictStr] = Field(default=None, alias="computerName") + os_version: Optional[StrictStr] = Field(default=None, alias="osVersion") + platform: Optional[Platform] = None + kernel_version: Optional[StrictStr] = Field(default=None, alias="kernelVersion") + manufacturer: Optional[StrictStr] = None + model: Optional[StrictStr] = None + last_seen: Optional[datetime] = Field(default=None, description="The last time the agent checked-in.", alias="lastSeen") + status: Optional[Status] = None + deleted: Optional[StrictBool] = None + version: Optional[StrictStr] = Field(default=None, description="Version of the agent software running.") + created_at: Optional[datetime] = Field(default=None, alias="createdAt") + number_of_clients: Optional[StrictInt] = Field(default=None, alias="numberOfClients") + public_ip: Optional[StrictStr] = Field(default=None, alias="publicIP") + location: Optional[EndpointAgentLocation] = None + clients: Optional[List[EndpointClient]] = Field(default=None, description="List of clients (user accounts) that the agent works with. Not populated by default. ") + total_memory: Optional[StrictStr] = Field(default=None, alias="totalMemory") + agent_type: Optional[StrictStr] = Field(default=None, alias="agentType") + vpn_profiles: Optional[List[EndpointVpnProfile]] = Field(default=None, description="List of VPN connections on the agent. Not populated by default. ", alias="vpnProfiles") + network_interface_profiles: Optional[List[InterfaceProfile]] = Field(default=None, description="List of network interfaces on the agent. Not populated by default. ", alias="networkInterfaceProfiles") + asn_details: Optional[EndpointAsnDetails] = Field(default=None, alias="asnDetails") + license_type: Optional[AgentLicenseType] = Field(default=None, alias="licenseType") + tcp_driver_available: Optional[StrictBool] = Field(default=None, description="Status of TCP test support on the agent.", alias="tcpDriverAvailable") + npcap_version: Optional[StrictStr] = Field(default=None, description="For Windows agents, the version of the NPCAP driver that the agent has loaded.", alias="npcapVersion") + __properties: ClassVar[List[str]] = ["id", "aid", "name", "computerName", "osVersion", "platform", "kernelVersion", "manufacturer", "model", "lastSeen", "status", "deleted", "version", "createdAt", "numberOfClients", "publicIP", "location", "clients", "totalMemory", "agentType", "vpnProfiles", "networkInterfaceProfiles", "asnDetails", "licenseType", "tcpDriverAvailable", "npcapVersion"] + + 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 EndpointAgent 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "id", + "computer_name", + "os_version", + "kernel_version", + "manufacturer", + "model", + "last_seen", + "deleted", + "version", + "created_at", + "number_of_clients", + "public_ip", + "clients", + "total_memory", + "agent_type", + "vpn_profiles", + "network_interface_profiles", + "tcp_driver_available", + "npcap_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + # override the default output from pydantic by calling `to_dict()` of location + if self.location: + _dict['location'] = self.location.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in clients (list) + _items = [] + if self.clients: + for _item in self.clients: + if _item: + _items.append(_item.to_dict()) + _dict['clients'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in vpn_profiles (list) + _items = [] + if self.vpn_profiles: + for _item in self.vpn_profiles: + if _item: + _items.append(_item.to_dict()) + _dict['vpnProfiles'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in network_interface_profiles (list) + _items = [] + if self.network_interface_profiles: + for _item in self.network_interface_profiles: + if _item: + _items.append(_item.to_dict()) + _dict['networkInterfaceProfiles'] = _items + # override the default output from pydantic by calling `to_dict()` of asn_details + if self.asn_details: + _dict['asnDetails'] = self.asn_details.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "aid": EndpointAgentAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "name": obj.get("name"), + "computerName": obj.get("computerName"), + "osVersion": obj.get("osVersion"), + "platform": obj.get("platform"), + "kernelVersion": obj.get("kernelVersion"), + "manufacturer": obj.get("manufacturer"), + "model": obj.get("model"), + "lastSeen": obj.get("lastSeen"), + "status": obj.get("status"), + "deleted": obj.get("deleted"), + "version": obj.get("version"), + "createdAt": obj.get("createdAt"), + "numberOfClients": obj.get("numberOfClients"), + "publicIP": obj.get("publicIP"), + "location": EndpointAgentLocation.from_dict(obj.get("location")) if obj.get("location") is not None else None, + "clients": [EndpointClient.from_dict(_item) for _item in obj.get("clients")] if obj.get("clients") is not None else None, + "totalMemory": obj.get("totalMemory"), + "agentType": obj.get("agentType"), + "vpnProfiles": [EndpointVpnProfile.from_dict(_item) for _item in obj.get("vpnProfiles")] if obj.get("vpnProfiles") is not None else None, + "networkInterfaceProfiles": [InterfaceProfile.from_dict(_item) for _item in obj.get("networkInterfaceProfiles")] if obj.get("networkInterfaceProfiles") is not None else None, + "asnDetails": EndpointAsnDetails.from_dict(obj.get("asnDetails")) if obj.get("asnDetails") is not None else None, + "licenseType": obj.get("licenseType"), + "tcpDriverAvailable": obj.get("tcpDriverAvailable"), + "npcapVersion": obj.get("npcapVersion") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_agent_aid.py b/endpoint/agents_api/agents_api/models/endpoint_agent_aid.py new file mode 100644 index 00000000..04eb316f --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_agent_aid.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 EndpointAgentAid(BaseModel): + """ + EndpointAgentAid + """ # 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 EndpointAgentAid 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 EndpointAgentAid 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 + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_agent_bulk_transfer207_response.py b/endpoint/agents_api/agents_api/models/endpoint_agent_bulk_transfer207_response.py new file mode 100644 index 00000000..7388f74f --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_agent_bulk_transfer207_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.endpoint_agent_bulk_transfer207_response_items_inner import EndpointAgentBulkTransfer207ResponseItemsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentBulkTransfer207Response(BaseModel): + """ + EndpointAgentBulkTransfer207Response + """ # noqa: E501 + items: Optional[List[EndpointAgentBulkTransfer207ResponseItemsInner]] = None + __properties: ClassVar[List[str]] = ["items"] + + 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 EndpointAgentBulkTransfer207Response 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 items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgentBulkTransfer207Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [EndpointAgentBulkTransfer207ResponseItemsInner.from_dict(_item) for _item in obj.get("items")] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_agent_bulk_transfer207_response_items_inner.py b/endpoint/agents_api/agents_api/models/endpoint_agent_bulk_transfer207_response_items_inner.py new file mode 100644 index 00000000..63824f5e --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_agent_bulk_transfer207_response_items_inner.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 +from agents_api.models.agent_transfer import AgentTransfer +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentBulkTransfer207ResponseItemsInner(BaseModel): + """ + EndpointAgentBulkTransfer207ResponseItemsInner + """ # 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.") + request: Optional[AgentTransfer] = None + __properties: ClassVar[List[str]] = ["type", "title", "status", "detail", "instance", "request"] + + 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 EndpointAgentBulkTransfer207ResponseItemsInner 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 request + if self.request: + _dict['request'] = self.request.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgentBulkTransfer207ResponseItemsInner 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"), + "request": AgentTransfer.from_dict(obj.get("request")) if obj.get("request") is not None else None + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_agent_bulk_transfer_request.py b/endpoint/agents_api/agents_api/models/endpoint_agent_bulk_transfer_request.py new file mode 100644 index 00000000..f0b00d87 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_agent_bulk_transfer_request.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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_transfer import AgentTransfer +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentBulkTransferRequest(BaseModel): + """ + EndpointAgentBulkTransferRequest + """ # noqa: E501 + transfers: Optional[List[AgentTransfer]] = None + __properties: ClassVar[List[str]] = ["transfers"] + + 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 EndpointAgentBulkTransferRequest 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 transfers (list) + _items = [] + if self.transfers: + for _item in self.transfers: + if _item: + _items.append(_item.to_dict()) + _dict['transfers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgentBulkTransferRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "transfers": [AgentTransfer.from_dict(_item) for _item in obj.get("transfers")] if obj.get("transfers") is not None else None + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_agent_get200_response.py b/endpoint/agents_api/agents_api/models/endpoint_agent_get200_response.py new file mode 100644 index 00000000..f62ddd37 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_agent_get200_response.py @@ -0,0 +1,221 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.agent_license_type import AgentLicenseType +from agents_api.models.endpoint_agent_aid import EndpointAgentAid +from agents_api.models.endpoint_agent_location import EndpointAgentLocation +from agents_api.models.endpoint_asn_details import EndpointAsnDetails +from agents_api.models.endpoint_client import EndpointClient +from agents_api.models.endpoint_vpn_profile import EndpointVpnProfile +from agents_api.models.interface_profile import InterfaceProfile +from agents_api.models.platform import Platform +from agents_api.models.self_links_links import SelfLinksLinks +from agents_api.models.status import Status +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentGet200Response(BaseModel): + """ + EndpointAgentGet200Response + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the agent this applies to.") + aid: Optional[EndpointAgentAid] = None + name: Optional[StrictStr] = Field(default=None, description="The name of the agent.") + computer_name: Optional[StrictStr] = Field(default=None, alias="computerName") + os_version: Optional[StrictStr] = Field(default=None, alias="osVersion") + platform: Optional[Platform] = None + kernel_version: Optional[StrictStr] = Field(default=None, alias="kernelVersion") + manufacturer: Optional[StrictStr] = None + model: Optional[StrictStr] = None + last_seen: Optional[datetime] = Field(default=None, description="The last time the agent checked-in.", alias="lastSeen") + status: Optional[Status] = None + deleted: Optional[StrictBool] = None + version: Optional[StrictStr] = Field(default=None, description="Version of the agent software running.") + created_at: Optional[datetime] = Field(default=None, alias="createdAt") + number_of_clients: Optional[StrictInt] = Field(default=None, alias="numberOfClients") + public_ip: Optional[StrictStr] = Field(default=None, alias="publicIP") + location: Optional[EndpointAgentLocation] = None + clients: Optional[List[EndpointClient]] = Field(default=None, description="List of clients (user accounts) that the agent works with. Not populated by default. ") + total_memory: Optional[StrictStr] = Field(default=None, alias="totalMemory") + agent_type: Optional[StrictStr] = Field(default=None, alias="agentType") + vpn_profiles: Optional[List[EndpointVpnProfile]] = Field(default=None, description="List of VPN connections on the agent. Not populated by default. ", alias="vpnProfiles") + network_interface_profiles: Optional[List[InterfaceProfile]] = Field(default=None, description="List of network interfaces on the agent. Not populated by default. ", alias="networkInterfaceProfiles") + asn_details: Optional[EndpointAsnDetails] = Field(default=None, alias="asnDetails") + license_type: Optional[AgentLicenseType] = Field(default=None, alias="licenseType") + tcp_driver_available: Optional[StrictBool] = Field(default=None, description="Status of TCP test support on the agent.", alias="tcpDriverAvailable") + npcap_version: Optional[StrictStr] = Field(default=None, description="For Windows agents, the version of the NPCAP driver that the agent has loaded.", alias="npcapVersion") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["id", "aid", "name", "computerName", "osVersion", "platform", "kernelVersion", "manufacturer", "model", "lastSeen", "status", "deleted", "version", "createdAt", "numberOfClients", "publicIP", "location", "clients", "totalMemory", "agentType", "vpnProfiles", "networkInterfaceProfiles", "asnDetails", "licenseType", "tcpDriverAvailable", "npcapVersion", "_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 EndpointAgentGet200Response 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "id", + "computer_name", + "os_version", + "kernel_version", + "manufacturer", + "model", + "last_seen", + "deleted", + "version", + "created_at", + "number_of_clients", + "public_ip", + "clients", + "total_memory", + "agent_type", + "vpn_profiles", + "network_interface_profiles", + "tcp_driver_available", + "npcap_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + # override the default output from pydantic by calling `to_dict()` of location + if self.location: + _dict['location'] = self.location.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in clients (list) + _items = [] + if self.clients: + for _item in self.clients: + if _item: + _items.append(_item.to_dict()) + _dict['clients'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in vpn_profiles (list) + _items = [] + if self.vpn_profiles: + for _item in self.vpn_profiles: + if _item: + _items.append(_item.to_dict()) + _dict['vpnProfiles'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in network_interface_profiles (list) + _items = [] + if self.network_interface_profiles: + for _item in self.network_interface_profiles: + if _item: + _items.append(_item.to_dict()) + _dict['networkInterfaceProfiles'] = _items + # override the default output from pydantic by calling `to_dict()` of asn_details + if self.asn_details: + _dict['asnDetails'] = self.asn_details.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 EndpointAgentGet200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "aid": EndpointAgentAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "name": obj.get("name"), + "computerName": obj.get("computerName"), + "osVersion": obj.get("osVersion"), + "platform": obj.get("platform"), + "kernelVersion": obj.get("kernelVersion"), + "manufacturer": obj.get("manufacturer"), + "model": obj.get("model"), + "lastSeen": obj.get("lastSeen"), + "status": obj.get("status"), + "deleted": obj.get("deleted"), + "version": obj.get("version"), + "createdAt": obj.get("createdAt"), + "numberOfClients": obj.get("numberOfClients"), + "publicIP": obj.get("publicIP"), + "location": EndpointAgentLocation.from_dict(obj.get("location")) if obj.get("location") is not None else None, + "clients": [EndpointClient.from_dict(_item) for _item in obj.get("clients")] if obj.get("clients") is not None else None, + "totalMemory": obj.get("totalMemory"), + "agentType": obj.get("agentType"), + "vpnProfiles": [EndpointVpnProfile.from_dict(_item) for _item in obj.get("vpnProfiles")] if obj.get("vpnProfiles") is not None else None, + "networkInterfaceProfiles": [InterfaceProfile.from_dict(_item) for _item in obj.get("networkInterfaceProfiles")] if obj.get("networkInterfaceProfiles") is not None else None, + "asnDetails": EndpointAsnDetails.from_dict(obj.get("asnDetails")) if obj.get("asnDetails") is not None else None, + "licenseType": obj.get("licenseType"), + "tcpDriverAvailable": obj.get("tcpDriverAvailable"), + "npcapVersion": obj.get("npcapVersion"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_agent_location.py b/endpoint/agents_api/agents_api/models/endpoint_agent_location.py new file mode 100644 index 00000000..72273a41 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_agent_location.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentLocation(BaseModel): + """ + Approximate location of the agent. + """ # noqa: E501 + latitude: Optional[Union[StrictFloat, StrictInt]] = None + longitude: Optional[Union[StrictFloat, StrictInt]] = None + location_name: Optional[StrictStr] = Field(default=None, alias="locationName") + __properties: ClassVar[List[str]] = ["latitude", "longitude", "locationName"] + + 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 EndpointAgentLocation 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={ + "latitude", + "longitude", + "location_name", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgentLocation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "latitude": obj.get("latitude"), + "longitude": obj.get("longitude"), + "locationName": obj.get("locationName") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_agent_update.py b/endpoint/agents_api/agents_api/models/endpoint_agent_update.py new file mode 100644 index 00000000..232aa15c --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_agent_update.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.agent_license_type import AgentLicenseType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentUpdate(BaseModel): + """ + The `EndpointAgentUpdate` object contains supported fields for updates. + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="New agent name.") + license_type: Optional[List[AgentLicenseType]] = Field(default=None, description="New license type.", alias="licenseType") + __properties: ClassVar[List[str]] = ["name", "licenseType"] + + 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 EndpointAgentUpdate 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={ + "name", + "license_type", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgentUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "licenseType": obj.get("licenseType") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_agents.py b/endpoint/agents_api/agents_api/models/endpoint_agents.py new file mode 100644 index 00000000..d94eba28 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_agents.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 +from pydantic import Field +from agents_api.models.endpoint_agents_agents_inner import EndpointAgentsAgentsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgents(BaseModel): + """ + A list of `EndpointAgents`. + """ # noqa: E501 + total_agents: Optional[StrictInt] = Field(default=None, description="The total number of agents.", alias="totalAgents") + agents: Optional[List[EndpointAgentsAgentsInner]] = None + __properties: ClassVar[List[str]] = ["totalAgents", "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 EndpointAgents 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 EndpointAgents from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "totalAgents": obj.get("totalAgents"), + "agents": [EndpointAgentsAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_agents_agents_inner.py b/endpoint/agents_api/agents_api/models/endpoint_agents_agents_inner.py new file mode 100644 index 00000000..dcd4438d --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_agents_agents_inner.py @@ -0,0 +1,221 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.agent_license_type import AgentLicenseType +from agents_api.models.endpoint_agent_aid import EndpointAgentAid +from agents_api.models.endpoint_agent_location import EndpointAgentLocation +from agents_api.models.endpoint_asn_details import EndpointAsnDetails +from agents_api.models.endpoint_client import EndpointClient +from agents_api.models.endpoint_vpn_profile import EndpointVpnProfile +from agents_api.models.interface_profile import InterfaceProfile +from agents_api.models.platform import Platform +from agents_api.models.self_links_links import SelfLinksLinks +from agents_api.models.status import Status +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentsAgentsInner(BaseModel): + """ + EndpointAgentsAgentsInner + """ # noqa: E501 + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + id: Optional[StrictStr] = Field(default=None, description="Identifier of the agent this applies to.") + aid: Optional[EndpointAgentAid] = None + name: Optional[StrictStr] = Field(default=None, description="The name of the agent.") + computer_name: Optional[StrictStr] = Field(default=None, alias="computerName") + os_version: Optional[StrictStr] = Field(default=None, alias="osVersion") + platform: Optional[Platform] = None + kernel_version: Optional[StrictStr] = Field(default=None, alias="kernelVersion") + manufacturer: Optional[StrictStr] = None + model: Optional[StrictStr] = None + last_seen: Optional[datetime] = Field(default=None, description="The last time the agent checked-in.", alias="lastSeen") + status: Optional[Status] = None + deleted: Optional[StrictBool] = None + version: Optional[StrictStr] = Field(default=None, description="Version of the agent software running.") + created_at: Optional[datetime] = Field(default=None, alias="createdAt") + number_of_clients: Optional[StrictInt] = Field(default=None, alias="numberOfClients") + public_ip: Optional[StrictStr] = Field(default=None, alias="publicIP") + location: Optional[EndpointAgentLocation] = None + clients: Optional[List[EndpointClient]] = Field(default=None, description="List of clients (user accounts) that the agent works with. Not populated by default. ") + total_memory: Optional[StrictStr] = Field(default=None, alias="totalMemory") + agent_type: Optional[StrictStr] = Field(default=None, alias="agentType") + vpn_profiles: Optional[List[EndpointVpnProfile]] = Field(default=None, description="List of VPN connections on the agent. Not populated by default. ", alias="vpnProfiles") + network_interface_profiles: Optional[List[InterfaceProfile]] = Field(default=None, description="List of network interfaces on the agent. Not populated by default. ", alias="networkInterfaceProfiles") + asn_details: Optional[EndpointAsnDetails] = Field(default=None, alias="asnDetails") + license_type: Optional[AgentLicenseType] = Field(default=None, alias="licenseType") + tcp_driver_available: Optional[StrictBool] = Field(default=None, description="Status of TCP test support on the agent.", alias="tcpDriverAvailable") + npcap_version: Optional[StrictStr] = Field(default=None, description="For Windows agents, the version of the NPCAP driver that the agent has loaded.", alias="npcapVersion") + __properties: ClassVar[List[str]] = ["_links", "id", "aid", "name", "computerName", "osVersion", "platform", "kernelVersion", "manufacturer", "model", "lastSeen", "status", "deleted", "version", "createdAt", "numberOfClients", "publicIP", "location", "clients", "totalMemory", "agentType", "vpnProfiles", "networkInterfaceProfiles", "asnDetails", "licenseType", "tcpDriverAvailable", "npcapVersion"] + + 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 EndpointAgentsAgentsInner 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "id", + "computer_name", + "os_version", + "kernel_version", + "manufacturer", + "model", + "last_seen", + "deleted", + "version", + "created_at", + "number_of_clients", + "public_ip", + "clients", + "total_memory", + "agent_type", + "vpn_profiles", + "network_interface_profiles", + "tcp_driver_available", + "npcap_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + # override the default output from pydantic by calling `to_dict()` of location + if self.location: + _dict['location'] = self.location.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in clients (list) + _items = [] + if self.clients: + for _item in self.clients: + if _item: + _items.append(_item.to_dict()) + _dict['clients'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in vpn_profiles (list) + _items = [] + if self.vpn_profiles: + for _item in self.vpn_profiles: + if _item: + _items.append(_item.to_dict()) + _dict['vpnProfiles'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in network_interface_profiles (list) + _items = [] + if self.network_interface_profiles: + for _item in self.network_interface_profiles: + if _item: + _items.append(_item.to_dict()) + _dict['networkInterfaceProfiles'] = _items + # override the default output from pydantic by calling `to_dict()` of asn_details + if self.asn_details: + _dict['asnDetails'] = self.asn_details.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgentsAgentsInner 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, + "id": obj.get("id"), + "aid": EndpointAgentAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "name": obj.get("name"), + "computerName": obj.get("computerName"), + "osVersion": obj.get("osVersion"), + "platform": obj.get("platform"), + "kernelVersion": obj.get("kernelVersion"), + "manufacturer": obj.get("manufacturer"), + "model": obj.get("model"), + "lastSeen": obj.get("lastSeen"), + "status": obj.get("status"), + "deleted": obj.get("deleted"), + "version": obj.get("version"), + "createdAt": obj.get("createdAt"), + "numberOfClients": obj.get("numberOfClients"), + "publicIP": obj.get("publicIP"), + "location": EndpointAgentLocation.from_dict(obj.get("location")) if obj.get("location") is not None else None, + "clients": [EndpointClient.from_dict(_item) for _item in obj.get("clients")] if obj.get("clients") is not None else None, + "totalMemory": obj.get("totalMemory"), + "agentType": obj.get("agentType"), + "vpnProfiles": [EndpointVpnProfile.from_dict(_item) for _item in obj.get("vpnProfiles")] if obj.get("vpnProfiles") is not None else None, + "networkInterfaceProfiles": [InterfaceProfile.from_dict(_item) for _item in obj.get("networkInterfaceProfiles")] if obj.get("networkInterfaceProfiles") is not None else None, + "asnDetails": EndpointAsnDetails.from_dict(obj.get("asnDetails")) if obj.get("asnDetails") is not None else None, + "licenseType": obj.get("licenseType"), + "tcpDriverAvailable": obj.get("tcpDriverAvailable"), + "npcapVersion": obj.get("npcapVersion") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_agents_connection_string200_response.py b/endpoint/agents_api/agents_api/models/endpoint_agents_connection_string200_response.py new file mode 100644 index 00000000..e4768912 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_agents_connection_string200_response.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentsConnectionString200Response(BaseModel): + """ + EndpointAgentsConnectionString200Response + """ # noqa: E501 + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + connection_string: Optional[StrictStr] = Field(default=None, description="The connection string is used for some integrations and other client types. ", alias="connectionString") + __properties: ClassVar[List[str]] = ["_links", "connectionString"] + + 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 EndpointAgentsConnectionString200Response 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 EndpointAgentsConnectionString200Response 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, + "connectionString": obj.get("connectionString") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_agents_list200_response.py b/endpoint/agents_api/agents_api/models/endpoint_agents_list200_response.py new file mode 100644 index 00000000..0d1ccbea --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_agents_list200_response.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 +from pydantic import Field +from agents_api.models.endpoint_agents_agents_inner import EndpointAgentsAgentsInner +from agents_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentsList200Response(BaseModel): + """ + EndpointAgentsList200Response + """ # noqa: E501 + total_agents: Optional[StrictInt] = Field(default=None, description="The total number of agents.", alias="totalAgents") + agents: Optional[List[EndpointAgentsAgentsInner]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["totalAgents", "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 EndpointAgentsList200Response 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 EndpointAgentsList200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "totalAgents": obj.get("totalAgents"), + "agents": [EndpointAgentsAgentsInner.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 + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_agents_search200_response.py b/endpoint/agents_api/agents_api/models/endpoint_agents_search200_response.py new file mode 100644 index 00000000..93e29db4 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_agents_search200_response.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 +from pydantic import Field +from agents_api.models.endpoint_agents_agents_inner import EndpointAgentsAgentsInner +from agents_api.models.pagination_next_link_links import PaginationNextLinkLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentsSearch200Response(BaseModel): + """ + EndpointAgentsSearch200Response + """ # noqa: E501 + total_agents: Optional[StrictInt] = Field(default=None, description="The total number of agents.", alias="totalAgents") + agents: Optional[List[EndpointAgentsAgentsInner]] = None + links: Optional[PaginationNextLinkLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["totalAgents", "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 EndpointAgentsSearch200Response 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 EndpointAgentsSearch200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "totalAgents": obj.get("totalAgents"), + "agents": [EndpointAgentsAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "_links": PaginationNextLinkLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_asn_details.py b/endpoint/agents_api/agents_api/models/endpoint_asn_details.py new file mode 100644 index 00000000..b8445f4e --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_asn_details.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 EndpointAsnDetails(BaseModel): + """ + EndpointAsnDetails + """ # noqa: E501 + as_number: StrictInt = Field(description="Autonomous system number.", alias="asNumber") + as_name: Optional[StrictStr] = Field(default=None, description="Name of autonomous system.", alias="asName") + __properties: ClassVar[List[str]] = ["asNumber", "asName"] + + 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 EndpointAsnDetails 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 EndpointAsnDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "asNumber": obj.get("asNumber"), + "asName": obj.get("asName") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_browser_extension.py b/endpoint/agents_api/agents_api/models/endpoint_browser_extension.py new file mode 100644 index 00000000..8f3b34cd --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_browser_extension.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.browser_type import BrowserType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointBrowserExtension(BaseModel): + """ + EndpointBrowserExtension + """ # noqa: E501 + browser: Optional[BrowserType] = None + profile: Optional[StrictStr] = Field(default=None, description="Name of the browser profile where this extension is stored.") + version: Optional[StrictStr] = Field(default=None, description="Endpoint agent browser extension version.") + enabled: Optional[StrictBool] = Field(default=None, description="Indicates if the extension is disabled or enabled in the web browser.") + active: Optional[StrictBool] = Field(default=None, description="Flag indicating if there is communication between the extension and ThousandEyes portal. ") + error: Optional[StrictStr] = Field(default=None, description="Contains any errors encountered while getting extension status.") + __properties: ClassVar[List[str]] = ["browser", "profile", "version", "enabled", "active", "error"] + + 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 EndpointBrowserExtension 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 EndpointBrowserExtension from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "browser": obj.get("browser"), + "profile": obj.get("profile"), + "version": obj.get("version"), + "enabled": obj.get("enabled"), + "active": obj.get("active"), + "error": obj.get("error") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_client.py b/endpoint/agents_api/agents_api/models/endpoint_client.py new file mode 100644 index 00000000..43443d02 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_client.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.endpoint_browser_extension import EndpointBrowserExtension +from agents_api.models.endpoint_user_profile import EndpointUserProfile +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointClient(BaseModel): + """ + Information about the user who has the agent installed. + """ # noqa: E501 + user_profile: Optional[EndpointUserProfile] = Field(default=None, alias="userProfile") + browser_extensions: Optional[List[EndpointBrowserExtension]] = Field(default=None, alias="browserExtensions") + __properties: ClassVar[List[str]] = ["userProfile", "browserExtensions"] + + 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 EndpointClient 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 user_profile + if self.user_profile: + _dict['userProfile'] = self.user_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in browser_extensions (list) + _items = [] + if self.browser_extensions: + for _item in self.browser_extensions: + if _item: + _items.append(_item.to_dict()) + _dict['browserExtensions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointClient from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "userProfile": EndpointUserProfile.from_dict(obj.get("userProfile")) if obj.get("userProfile") is not None else None, + "browserExtensions": [EndpointBrowserExtension.from_dict(_item) for _item in obj.get("browserExtensions")] if obj.get("browserExtensions") is not None else None + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_user_profile.py b/endpoint/agents_api/agents_api/models/endpoint_user_profile.py new file mode 100644 index 00000000..a807c9e5 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_user_profile.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 +from pydantic import BaseModel, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointUserProfile(BaseModel): + """ + EndpointUserProfile + """ # noqa: E501 + user_name: StrictStr = Field(alias="userName") + __properties: ClassVar[List[str]] = ["userName"] + + 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 EndpointUserProfile 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 EndpointUserProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "userName": obj.get("userName") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/endpoint_vpn_profile.py b/endpoint/agents_api/agents_api/models/endpoint_vpn_profile.py new file mode 100644 index 00000000..00bac6ce --- /dev/null +++ b/endpoint/agents_api/agents_api/models/endpoint_vpn_profile.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.vpn_type import VpnType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointVpnProfile(BaseModel): + """ + EndpointVpnProfile + """ # noqa: E501 + interface_name: Optional[StrictStr] = Field(default=None, description="Interface name associated with `interfaceProfile`.", alias="interfaceName") + vpn_type: Optional[VpnType] = Field(default=None, alias="vpnType") + vpn_gateway_address: Optional[StrictStr] = Field(default=None, description="IP address of the VPN gateway.", alias="vpnGatewayAddress") + vpn_client_addresses: List[StrictStr] = Field(description="List of private IP addresses assigned to the device, by the VPN server.", alias="vpnClientAddresses") + vpn_client_network_range: List[StrictStr] = Field(description="List of private networks assigned to the device, by the VPN server.", alias="vpnClientNetworkRange") + __properties: ClassVar[List[str]] = ["interfaceName", "vpnType", "vpnGatewayAddress", "vpnClientAddresses", "vpnClientNetworkRange"] + + 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 EndpointVpnProfile 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 EndpointVpnProfile 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"), + "vpnType": obj.get("vpnType"), + "vpnGatewayAddress": obj.get("vpnGatewayAddress"), + "vpnClientAddresses": obj.get("vpnClientAddresses"), + "vpnClientNetworkRange": obj.get("vpnClientNetworkRange") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/error.py b/endpoint/agents_api/agents_api/models/error.py new file mode 100644 index 00000000..5394767f --- /dev/null +++ b/endpoint/agents_api/agents_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 + + diff --git a/endpoint/agents_api/agents_api/models/ethernet_profile.py b/endpoint/agents_api/agents_api/models/ethernet_profile.py new file mode 100644 index 00000000..243da20a --- /dev/null +++ b/endpoint/agents_api/agents_api/models/ethernet_profile.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EthernetProfile(BaseModel): + """ + Information about the ethernet connectivity of this device. Only present if the hardware type is `ethernet`. + """ # noqa: E501 + link_speed: Optional[StrictInt] = Field(default=None, description="Link speed in Mbps.", alias="linkSpeed") + __properties: ClassVar[List[str]] = ["linkSpeed"] + + 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 EthernetProfile 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 EthernetProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "linkSpeed": obj.get("linkSpeed") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/expand.py b/endpoint/agents_api/agents_api/models/expand.py new file mode 100644 index 00000000..ab64edd0 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/expand.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 Expand(str, Enum): + """ + Expand + """ + + """ + allowed enum values + """ + CLIENTS = 'clients' + VPNPROFILES = 'vpnProfiles' + NETWORKINTERFACEPROFILES = 'networkInterfaceProfiles' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Expand from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/agents_api/agents_api/models/interface_hardware_type.py b/endpoint/agents_api/agents_api/models/interface_hardware_type.py new file mode 100644 index 00000000..66766196 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/interface_hardware_type.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 InterfaceHardwareType(str, Enum): + """ + InterfaceHardwareType + """ + + """ + allowed enum values + """ + UNKNOWN = 'unknown' + WIRELESS = 'wireless' + ETHERNET = 'ethernet' + MODEM = 'modem' + VIRTUAL = 'virtual' + LOOPBACK = 'loopback' + OTHER = 'other' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of InterfaceHardwareType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/agents_api/agents_api/models/interface_profile.py b/endpoint/agents_api/agents_api/models/interface_profile.py new file mode 100644 index 00000000..bc4b406c --- /dev/null +++ b/endpoint/agents_api/agents_api/models/interface_profile.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.address_profile import AddressProfile +from agents_api.models.ethernet_profile import EthernetProfile +from agents_api.models.interface_hardware_type import InterfaceHardwareType +from agents_api.models.wireless_profile import WirelessProfile +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class InterfaceProfile(BaseModel): + """ + InterfaceProfile + """ # noqa: E501 + interface_name: Optional[StrictStr] = Field(default=None, alias="interfaceName") + address_profiles: Optional[List[AddressProfile]] = Field(default=None, alias="addressProfiles") + hardware_type: Optional[InterfaceHardwareType] = Field(default=None, alias="hardwareType") + ethernet_profile: Optional[EthernetProfile] = Field(default=None, alias="ethernetProfile") + wireless_profile: Optional[WirelessProfile] = Field(default=None, alias="wirelessProfile") + __properties: ClassVar[List[str]] = ["interfaceName", "addressProfiles", "hardwareType", "ethernetProfile", "wirelessProfile"] + + 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 InterfaceProfile 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 address_profiles (list) + _items = [] + if self.address_profiles: + for _item in self.address_profiles: + if _item: + _items.append(_item.to_dict()) + _dict['addressProfiles'] = _items + # override the default output from pydantic by calling `to_dict()` of ethernet_profile + if self.ethernet_profile: + _dict['ethernetProfile'] = self.ethernet_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of wireless_profile + if self.wireless_profile: + _dict['wirelessProfile'] = self.wireless_profile.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of InterfaceProfile 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"), + "addressProfiles": [AddressProfile.from_dict(_item) for _item in obj.get("addressProfiles")] if obj.get("addressProfiles") is not None else None, + "hardwareType": obj.get("hardwareType"), + "ethernetProfile": EthernetProfile.from_dict(obj.get("ethernetProfile")) if obj.get("ethernetProfile") is not None else None, + "wirelessProfile": WirelessProfile.from_dict(obj.get("wirelessProfile")) if obj.get("wirelessProfile") is not None else None + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/link.py b/endpoint/agents_api/agents_api/models/link.py new file mode 100644 index 00000000..7e7d93c5 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 + + diff --git a/endpoint/agents_api/agents_api/models/pagination_next_link.py b/endpoint/agents_api/agents_api/models/pagination_next_link.py new file mode 100644 index 00000000..73782882 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/pagination_next_link.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.pagination_next_link_links import PaginationNextLinkLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationNextLink(BaseModel): + """ + A links object containing a related link for forward pagination. + """ # noqa: E501 + links: Optional[PaginationNextLinkLinks] = 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 PaginationNextLink 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 PaginationNextLink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": PaginationNextLinkLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/pagination_next_link_links.py b/endpoint/agents_api/agents_api/models/pagination_next_link_links.py new file mode 100644 index 00000000..74a209e8 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/pagination_next_link_links.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationNextLinkLinks(BaseModel): + """ + PaginationNextLinkLinks + """ # noqa: E501 + next: Optional[Link] = None + __properties: ClassVar[List[str]] = ["next"] + + 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 PaginationNextLinkLinks 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 next + if self.next: + _dict['next'] = self.next.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PaginationNextLinkLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "next": Link.from_dict(obj.get("next")) if obj.get("next") is not None else None + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/models/platform.py b/endpoint/agents_api/agents_api/models/platform.py new file mode 100644 index 00000000..312fad5f --- /dev/null +++ b/endpoint/agents_api/agents_api/models/platform.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 Platform(str, Enum): + """ + OS platform types + """ + + """ + allowed enum values + """ + WINDOWS = 'windows' + LINUX = 'linux' + MAC = 'mac' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Platform from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/agents_api/agents_api/models/self_links.py b/endpoint/agents_api/agents_api/models/self_links.py new file mode 100644 index 00000000..1b5e7f57 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 + + diff --git a/endpoint/agents_api/agents_api/models/self_links_links.py b/endpoint/agents_api/agents_api/models/self_links_links.py new file mode 100644 index 00000000..f67e1655 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 + + diff --git a/endpoint/agents_api/agents_api/models/status.py b/endpoint/agents_api/agents_api/models/status.py new file mode 100644 index 00000000..00fb1605 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/status.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 Status(str, Enum): + """ + Status of the endpoint agent in ThousandEyes. Disabled agents don't report data. + """ + + """ + allowed enum values + """ + ENABLED = 'enabled' + DISABLED = 'disabled' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Status from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/agents_api/agents_api/models/unauthorized_error.py b/endpoint/agents_api/agents_api/models/unauthorized_error.py new file mode 100644 index 00000000..2a84560d --- /dev/null +++ b/endpoint/agents_api/agents_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 + + diff --git a/endpoint/agents_api/agents_api/models/vpn_type.py b/endpoint/agents_api/agents_api/models/vpn_type.py new file mode 100644 index 00000000..3a002e97 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/vpn_type.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 VpnType(str, Enum): + """ + Name of the VPN provider. + """ + + """ + allowed enum values + """ + CISCO_MINUS_ANYCONNECT = 'cisco-anyconnect' + PALO_MINUS_ALTO_MINUS_GLOBALPROTECT = 'palo-alto-globalprotect' + IVANTI_MINUS_CONNECT_MINUS_SECURE = 'ivanti-connect-secure' + ZSCALER_MINUS_INTERNET_MINUS_ACCESS = 'zscaler-internet-access' + F5_MINUS_BIG_MINUS_IP = 'f5-big-ip' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of VpnType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/agents_api/agents_api/models/wireless_profile.py b/endpoint/agents_api/agents_api/models/wireless_profile.py new file mode 100644 index 00000000..d2cfe295 --- /dev/null +++ b/endpoint/agents_api/agents_api/models/wireless_profile.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 WirelessProfile(BaseModel): + """ + WirelessProfile + """ # noqa: E501 + bssid: Optional[StrictStr] = None + ssid: Optional[StrictStr] = None + rssi: Optional[StrictInt] = None + channel: Optional[StrictInt] = None + phy_mode: Optional[StrictStr] = Field(default=None, alias="phyMode") + __properties: ClassVar[List[str]] = ["bssid", "ssid", "rssi", "channel", "phyMode"] + + 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 WirelessProfile 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 WirelessProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bssid": obj.get("bssid"), + "ssid": obj.get("ssid"), + "rssi": obj.get("rssi"), + "channel": obj.get("channel"), + "phyMode": obj.get("phyMode") + }) + return _obj + + diff --git a/endpoint/agents_api/agents_api/py.typed b/endpoint/agents_api/agents_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/endpoint/agents_api/agents_api/rest.py b/endpoint/agents_api/agents_api/rest.py new file mode 100644 index 00000000..bd0ef88d --- /dev/null +++ b/endpoint/agents_api/agents_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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) diff --git a/endpoint/agents_api/docs/AccountGroupId.md b/endpoint/agents_api/docs/AccountGroupId.md new file mode 100644 index 00000000..37c02068 --- /dev/null +++ b/endpoint/agents_api/docs/AccountGroupId.md @@ -0,0 +1,28 @@ +# AccountGroupId + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] + +## 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) + + diff --git a/endpoint/agents_api/docs/AddressProfile.md b/endpoint/agents_api/docs/AddressProfile.md new file mode 100644 index 00000000..7a11ca1e --- /dev/null +++ b/endpoint/agents_api/docs/AddressProfile.md @@ -0,0 +1,33 @@ +# AddressProfile + +A description of the IPs assigned to this machine. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address_type** | [**AddressType**](AddressType.md) | | [optional] +**ip_address** | **str** | IP address of this interface in the network it's currently connected to. | [optional] +**prefix_length** | **int** | The number of bits representing the network part of the `ipAddress`. | [optional] +**gateway** | **str** | The default gateway for this interface. | [optional] +**router_hardware_address** | **str** | The router's MAC address resolved from an ARP request. | [optional] + +## Example + +```python +from agents_api.models.address_profile import AddressProfile + +# TODO update the JSON string below +json = "{}" +# create an instance of AddressProfile from a JSON string +address_profile_instance = AddressProfile.from_json(json) +# print the JSON string representation of the object +print AddressProfile.to_json() + +# convert the object into a dict +address_profile_dict = address_profile_instance.to_dict() +# create an instance of AddressProfile from a dict +address_profile_form_dict = address_profile.from_dict(address_profile_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/AddressType.md b/endpoint/agents_api/docs/AddressType.md new file mode 100644 index 00000000..c4c8ce62 --- /dev/null +++ b/endpoint/agents_api/docs/AddressType.md @@ -0,0 +1,10 @@ +# AddressType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/AdministrativeEndpointsApi.md b/endpoint/agents_api/docs/AdministrativeEndpointsApi.md new file mode 100644 index 00000000..e21af82d --- /dev/null +++ b/endpoint/agents_api/docs/AdministrativeEndpointsApi.md @@ -0,0 +1,87 @@ +# agents_api.AdministrativeEndpointsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**endpoint_agents_connection_string**](AdministrativeEndpointsApi.md#endpoint_agents_connection_string) | **GET** /v7/endpoint/agents/connection-string | Get agent connection string + + +# **endpoint_agents_connection_string** +> EndpointAgentsConnectionString200Response endpoint_agents_connection_string(aid=aid) + +Get agent connection string + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import agents_api +from agents_api.models.endpoint_agents_connection_string200_response import EndpointAgentsConnectionString200Response +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.AdministrativeEndpointsApi(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: + # Get agent connection string + api_response = api_instance.endpoint_agents_connection_string(aid=aid) + print("The response of AdministrativeEndpointsApi->endpoint_agents_connection_string:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AdministrativeEndpointsApi->endpoint_agents_connection_string: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointAgentsConnectionString200Response**](EndpointAgentsConnectionString200Response.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 | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/agents_api/docs/AgentLicenseType.md b/endpoint/agents_api/docs/AgentLicenseType.md new file mode 100644 index 00000000..b98ab3af --- /dev/null +++ b/endpoint/agents_api/docs/AgentLicenseType.md @@ -0,0 +1,10 @@ +# AgentLicenseType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/AgentSearchRequest.md b/endpoint/agents_api/docs/AgentSearchRequest.md new file mode 100644 index 00000000..1de0847f --- /dev/null +++ b/endpoint/agents_api/docs/AgentSearchRequest.md @@ -0,0 +1,29 @@ +# AgentSearchRequest + +Parameters for filtering a list of agents. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**search_filters** | [**AgentSearchRequestSearchFilters**](AgentSearchRequestSearchFilters.md) | | [optional] + +## Example + +```python +from agents_api.models.agent_search_request import AgentSearchRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentSearchRequest from a JSON string +agent_search_request_instance = AgentSearchRequest.from_json(json) +# print the JSON string representation of the object +print AgentSearchRequest.to_json() + +# convert the object into a dict +agent_search_request_dict = agent_search_request_instance.to_dict() +# create an instance of AgentSearchRequest from a dict +agent_search_request_form_dict = agent_search_request.from_dict(agent_search_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) + + diff --git a/endpoint/agents_api/docs/AgentSearchRequestSearchFilters.md b/endpoint/agents_api/docs/AgentSearchRequestSearchFilters.md new file mode 100644 index 00000000..fb9413a3 --- /dev/null +++ b/endpoint/agents_api/docs/AgentSearchRequestSearchFilters.md @@ -0,0 +1,35 @@ +# AgentSearchRequestSearchFilters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_name** | **List[str]** | Returns only agents with the given name. This is an exact match only. | [optional] +**computer_name** | **List[str]** | Returns only agents with the given computer name. This is an exact match only. | [optional] +**username** | **List[str]** | Returns only agents that have at least one user with a name. starting with the provided string. This is a case-insensitive prefix match. | [optional] +**platform** | [**List[Platform]**](Platform.md) | Filter on the platform on which the agent is running. | [optional] +**os_version** | **List[str]** | Case-insensitive prefix filter on the OS version. | [optional] +**location_country_iso** | **List[str]** | Filter using the ISO country code of the location. | [optional] +**location_subdivision1_code** | **List[str]** | Filter using the code for the first level administrative division within the country. In US/Canada this is the State, in UK it's the country e.g. `ENG` | [optional] +**location_city** | **List[str]** | This is a prefix match on the city name field. The endpoint expects this to contain the name of the city in English. e.g. 'Paris' or '' | [optional] + +## Example + +```python +from agents_api.models.agent_search_request_search_filters import AgentSearchRequestSearchFilters + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentSearchRequestSearchFilters from a JSON string +agent_search_request_search_filters_instance = AgentSearchRequestSearchFilters.from_json(json) +# print the JSON string representation of the object +print AgentSearchRequestSearchFilters.to_json() + +# convert the object into a dict +agent_search_request_search_filters_dict = agent_search_request_search_filters_instance.to_dict() +# create an instance of AgentSearchRequestSearchFilters from a dict +agent_search_request_search_filters_form_dict = agent_search_request_search_filters.from_dict(agent_search_request_search_filters_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/AgentTransfer.md b/endpoint/agents_api/docs/AgentTransfer.md new file mode 100644 index 00000000..6f27b050 --- /dev/null +++ b/endpoint/agents_api/docs/AgentTransfer.md @@ -0,0 +1,30 @@ +# AgentTransfer + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Identifier of the agent this applies to. | [optional] [readonly] +**from_aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**to_aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] + +## Example + +```python +from agents_api.models.agent_transfer import AgentTransfer + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentTransfer from a JSON string +agent_transfer_instance = AgentTransfer.from_json(json) +# print the JSON string representation of the object +print AgentTransfer.to_json() + +# convert the object into a dict +agent_transfer_dict = agent_transfer_instance.to_dict() +# create an instance of AgentTransfer from a dict +agent_transfer_form_dict = agent_transfer.from_dict(agent_transfer_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/AgentTransferRequest.md b/endpoint/agents_api/docs/AgentTransferRequest.md new file mode 100644 index 00000000..91b9f5f2 --- /dev/null +++ b/endpoint/agents_api/docs/AgentTransferRequest.md @@ -0,0 +1,28 @@ +# AgentTransferRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**to_aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] + +## Example + +```python +from agents_api.models.agent_transfer_request import AgentTransferRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentTransferRequest from a JSON string +agent_transfer_request_instance = AgentTransferRequest.from_json(json) +# print the JSON string representation of the object +print AgentTransferRequest.to_json() + +# convert the object into a dict +agent_transfer_request_dict = agent_transfer_request_instance.to_dict() +# create an instance of AgentTransferRequest from a dict +agent_transfer_request_form_dict = agent_transfer_request.from_dict(agent_transfer_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) + + diff --git a/endpoint/agents_api/docs/BrowserType.md b/endpoint/agents_api/docs/BrowserType.md new file mode 100644 index 00000000..69afb5f8 --- /dev/null +++ b/endpoint/agents_api/docs/BrowserType.md @@ -0,0 +1,10 @@ +# BrowserType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointAgent.md b/endpoint/agents_api/docs/EndpointAgent.md new file mode 100644 index 00000000..9056e76b --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAgent.md @@ -0,0 +1,54 @@ +# EndpointAgent + +The `EndpointAgent` object, which may include multiple clients. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the agent this applies to. | [optional] [readonly] +**aid** | [**EndpointAgentAid**](EndpointAgentAid.md) | | [optional] +**name** | **str** | The name of the agent. | [optional] +**computer_name** | **str** | | [optional] [readonly] +**os_version** | **str** | | [optional] [readonly] +**platform** | [**Platform**](Platform.md) | | [optional] +**kernel_version** | **str** | | [optional] [readonly] +**manufacturer** | **str** | | [optional] [readonly] +**model** | **str** | | [optional] [readonly] +**last_seen** | **datetime** | The last time the agent checked-in. | [optional] [readonly] +**status** | [**Status**](Status.md) | | [optional] +**deleted** | **bool** | | [optional] [readonly] +**version** | **str** | Version of the agent software running. | [optional] [readonly] +**created_at** | **datetime** | | [optional] [readonly] +**number_of_clients** | **int** | | [optional] [readonly] +**public_ip** | **str** | | [optional] [readonly] +**location** | [**EndpointAgentLocation**](EndpointAgentLocation.md) | | [optional] +**clients** | [**List[EndpointClient]**](EndpointClient.md) | List of clients (user accounts) that the agent works with. Not populated by default. | [optional] [readonly] +**total_memory** | **str** | | [optional] [readonly] +**agent_type** | **str** | | [optional] [readonly] +**vpn_profiles** | [**List[EndpointVpnProfile]**](EndpointVpnProfile.md) | List of VPN connections on the agent. Not populated by default. | [optional] [readonly] +**network_interface_profiles** | [**List[InterfaceProfile]**](InterfaceProfile.md) | List of network interfaces on the agent. Not populated by default. | [optional] [readonly] +**asn_details** | [**EndpointAsnDetails**](EndpointAsnDetails.md) | | [optional] +**license_type** | [**AgentLicenseType**](AgentLicenseType.md) | | [optional] +**tcp_driver_available** | **bool** | Status of TCP test support on the agent. | [optional] [readonly] +**npcap_version** | **str** | For Windows agents, the version of the NPCAP driver that the agent has loaded. | [optional] [readonly] + +## Example + +```python +from agents_api.models.endpoint_agent import EndpointAgent + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgent from a JSON string +endpoint_agent_instance = EndpointAgent.from_json(json) +# print the JSON string representation of the object +print EndpointAgent.to_json() + +# convert the object into a dict +endpoint_agent_dict = endpoint_agent_instance.to_dict() +# create an instance of EndpointAgent from a dict +endpoint_agent_form_dict = endpoint_agent.from_dict(endpoint_agent_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointAgentAid.md b/endpoint/agents_api/docs/EndpointAgentAid.md new file mode 100644 index 00000000..5c871099 --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAgentAid.md @@ -0,0 +1,28 @@ +# EndpointAgentAid + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] + +## Example + +```python +from agents_api.models.endpoint_agent_aid import EndpointAgentAid + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentAid from a JSON string +endpoint_agent_aid_instance = EndpointAgentAid.from_json(json) +# print the JSON string representation of the object +print EndpointAgentAid.to_json() + +# convert the object into a dict +endpoint_agent_aid_dict = endpoint_agent_aid_instance.to_dict() +# create an instance of EndpointAgentAid from a dict +endpoint_agent_aid_form_dict = endpoint_agent_aid.from_dict(endpoint_agent_aid_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointAgentBulkTransfer207Response.md b/endpoint/agents_api/docs/EndpointAgentBulkTransfer207Response.md new file mode 100644 index 00000000..10d4fd6b --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAgentBulkTransfer207Response.md @@ -0,0 +1,28 @@ +# EndpointAgentBulkTransfer207Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**List[EndpointAgentBulkTransfer207ResponseItemsInner]**](EndpointAgentBulkTransfer207ResponseItemsInner.md) | | [optional] + +## Example + +```python +from agents_api.models.endpoint_agent_bulk_transfer207_response import EndpointAgentBulkTransfer207Response + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentBulkTransfer207Response from a JSON string +endpoint_agent_bulk_transfer207_response_instance = EndpointAgentBulkTransfer207Response.from_json(json) +# print the JSON string representation of the object +print EndpointAgentBulkTransfer207Response.to_json() + +# convert the object into a dict +endpoint_agent_bulk_transfer207_response_dict = endpoint_agent_bulk_transfer207_response_instance.to_dict() +# create an instance of EndpointAgentBulkTransfer207Response from a dict +endpoint_agent_bulk_transfer207_response_form_dict = endpoint_agent_bulk_transfer207_response.from_dict(endpoint_agent_bulk_transfer207_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointAgentBulkTransfer207ResponseItemsInner.md b/endpoint/agents_api/docs/EndpointAgentBulkTransfer207ResponseItemsInner.md new file mode 100644 index 00000000..fd4b3601 --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAgentBulkTransfer207ResponseItemsInner.md @@ -0,0 +1,33 @@ +# EndpointAgentBulkTransfer207ResponseItemsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] +**request** | [**AgentTransfer**](AgentTransfer.md) | | [optional] + +## Example + +```python +from agents_api.models.endpoint_agent_bulk_transfer207_response_items_inner import EndpointAgentBulkTransfer207ResponseItemsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentBulkTransfer207ResponseItemsInner from a JSON string +endpoint_agent_bulk_transfer207_response_items_inner_instance = EndpointAgentBulkTransfer207ResponseItemsInner.from_json(json) +# print the JSON string representation of the object +print EndpointAgentBulkTransfer207ResponseItemsInner.to_json() + +# convert the object into a dict +endpoint_agent_bulk_transfer207_response_items_inner_dict = endpoint_agent_bulk_transfer207_response_items_inner_instance.to_dict() +# create an instance of EndpointAgentBulkTransfer207ResponseItemsInner from a dict +endpoint_agent_bulk_transfer207_response_items_inner_form_dict = endpoint_agent_bulk_transfer207_response_items_inner.from_dict(endpoint_agent_bulk_transfer207_response_items_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointAgentBulkTransferRequest.md b/endpoint/agents_api/docs/EndpointAgentBulkTransferRequest.md new file mode 100644 index 00000000..31e1de4c --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAgentBulkTransferRequest.md @@ -0,0 +1,28 @@ +# EndpointAgentBulkTransferRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transfers** | [**List[AgentTransfer]**](AgentTransfer.md) | | [optional] + +## Example + +```python +from agents_api.models.endpoint_agent_bulk_transfer_request import EndpointAgentBulkTransferRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentBulkTransferRequest from a JSON string +endpoint_agent_bulk_transfer_request_instance = EndpointAgentBulkTransferRequest.from_json(json) +# print the JSON string representation of the object +print EndpointAgentBulkTransferRequest.to_json() + +# convert the object into a dict +endpoint_agent_bulk_transfer_request_dict = endpoint_agent_bulk_transfer_request_instance.to_dict() +# create an instance of EndpointAgentBulkTransferRequest from a dict +endpoint_agent_bulk_transfer_request_form_dict = endpoint_agent_bulk_transfer_request.from_dict(endpoint_agent_bulk_transfer_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) + + diff --git a/endpoint/agents_api/docs/EndpointAgentGet200Response.md b/endpoint/agents_api/docs/EndpointAgentGet200Response.md new file mode 100644 index 00000000..85f71285 --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAgentGet200Response.md @@ -0,0 +1,54 @@ +# EndpointAgentGet200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the agent this applies to. | [optional] [readonly] +**aid** | [**EndpointAgentAid**](EndpointAgentAid.md) | | [optional] +**name** | **str** | The name of the agent. | [optional] +**computer_name** | **str** | | [optional] [readonly] +**os_version** | **str** | | [optional] [readonly] +**platform** | [**Platform**](Platform.md) | | [optional] +**kernel_version** | **str** | | [optional] [readonly] +**manufacturer** | **str** | | [optional] [readonly] +**model** | **str** | | [optional] [readonly] +**last_seen** | **datetime** | The last time the agent checked-in. | [optional] [readonly] +**status** | [**Status**](Status.md) | | [optional] +**deleted** | **bool** | | [optional] [readonly] +**version** | **str** | Version of the agent software running. | [optional] [readonly] +**created_at** | **datetime** | | [optional] [readonly] +**number_of_clients** | **int** | | [optional] [readonly] +**public_ip** | **str** | | [optional] [readonly] +**location** | [**EndpointAgentLocation**](EndpointAgentLocation.md) | | [optional] +**clients** | [**List[EndpointClient]**](EndpointClient.md) | List of clients (user accounts) that the agent works with. Not populated by default. | [optional] [readonly] +**total_memory** | **str** | | [optional] [readonly] +**agent_type** | **str** | | [optional] [readonly] +**vpn_profiles** | [**List[EndpointVpnProfile]**](EndpointVpnProfile.md) | List of VPN connections on the agent. Not populated by default. | [optional] [readonly] +**network_interface_profiles** | [**List[InterfaceProfile]**](InterfaceProfile.md) | List of network interfaces on the agent. Not populated by default. | [optional] [readonly] +**asn_details** | [**EndpointAsnDetails**](EndpointAsnDetails.md) | | [optional] +**license_type** | [**AgentLicenseType**](AgentLicenseType.md) | | [optional] +**tcp_driver_available** | **bool** | Status of TCP test support on the agent. | [optional] [readonly] +**npcap_version** | **str** | For Windows agents, the version of the NPCAP driver that the agent has loaded. | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.endpoint_agent_get200_response import EndpointAgentGet200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentGet200Response from a JSON string +endpoint_agent_get200_response_instance = EndpointAgentGet200Response.from_json(json) +# print the JSON string representation of the object +print EndpointAgentGet200Response.to_json() + +# convert the object into a dict +endpoint_agent_get200_response_dict = endpoint_agent_get200_response_instance.to_dict() +# create an instance of EndpointAgentGet200Response from a dict +endpoint_agent_get200_response_form_dict = endpoint_agent_get200_response.from_dict(endpoint_agent_get200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointAgentLocation.md b/endpoint/agents_api/docs/EndpointAgentLocation.md new file mode 100644 index 00000000..424398ed --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAgentLocation.md @@ -0,0 +1,31 @@ +# EndpointAgentLocation + +Approximate location of the agent. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**latitude** | **float** | | [optional] [readonly] +**longitude** | **float** | | [optional] [readonly] +**location_name** | **str** | | [optional] [readonly] + +## Example + +```python +from agents_api.models.endpoint_agent_location import EndpointAgentLocation + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentLocation from a JSON string +endpoint_agent_location_instance = EndpointAgentLocation.from_json(json) +# print the JSON string representation of the object +print EndpointAgentLocation.to_json() + +# convert the object into a dict +endpoint_agent_location_dict = endpoint_agent_location_instance.to_dict() +# create an instance of EndpointAgentLocation from a dict +endpoint_agent_location_form_dict = endpoint_agent_location.from_dict(endpoint_agent_location_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointAgentUpdate.md b/endpoint/agents_api/docs/EndpointAgentUpdate.md new file mode 100644 index 00000000..0205754f --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAgentUpdate.md @@ -0,0 +1,30 @@ +# EndpointAgentUpdate + +The `EndpointAgentUpdate` object contains supported fields for updates. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | New agent name. | [optional] [readonly] +**license_type** | [**List[AgentLicenseType]**](AgentLicenseType.md) | New license type. | [optional] [readonly] + +## Example + +```python +from agents_api.models.endpoint_agent_update import EndpointAgentUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentUpdate from a JSON string +endpoint_agent_update_instance = EndpointAgentUpdate.from_json(json) +# print the JSON string representation of the object +print EndpointAgentUpdate.to_json() + +# convert the object into a dict +endpoint_agent_update_dict = endpoint_agent_update_instance.to_dict() +# create an instance of EndpointAgentUpdate from a dict +endpoint_agent_update_form_dict = endpoint_agent_update.from_dict(endpoint_agent_update_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointAgents.md b/endpoint/agents_api/docs/EndpointAgents.md new file mode 100644 index 00000000..9a20b114 --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAgents.md @@ -0,0 +1,30 @@ +# EndpointAgents + +A list of `EndpointAgents`. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_agents** | **int** | The total number of agents. | [optional] +**agents** | [**List[EndpointAgentsAgentsInner]**](EndpointAgentsAgentsInner.md) | | [optional] + +## Example + +```python +from agents_api.models.endpoint_agents import EndpointAgents + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgents from a JSON string +endpoint_agents_instance = EndpointAgents.from_json(json) +# print the JSON string representation of the object +print EndpointAgents.to_json() + +# convert the object into a dict +endpoint_agents_dict = endpoint_agents_instance.to_dict() +# create an instance of EndpointAgents from a dict +endpoint_agents_form_dict = endpoint_agents.from_dict(endpoint_agents_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointAgentsAgentsInner.md b/endpoint/agents_api/docs/EndpointAgentsAgentsInner.md new file mode 100644 index 00000000..1e7a5004 --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAgentsAgentsInner.md @@ -0,0 +1,54 @@ +# EndpointAgentsAgentsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**id** | **str** | Identifier of the agent this applies to. | [optional] [readonly] +**aid** | [**EndpointAgentAid**](EndpointAgentAid.md) | | [optional] +**name** | **str** | The name of the agent. | [optional] +**computer_name** | **str** | | [optional] [readonly] +**os_version** | **str** | | [optional] [readonly] +**platform** | [**Platform**](Platform.md) | | [optional] +**kernel_version** | **str** | | [optional] [readonly] +**manufacturer** | **str** | | [optional] [readonly] +**model** | **str** | | [optional] [readonly] +**last_seen** | **datetime** | The last time the agent checked-in. | [optional] [readonly] +**status** | [**Status**](Status.md) | | [optional] +**deleted** | **bool** | | [optional] [readonly] +**version** | **str** | Version of the agent software running. | [optional] [readonly] +**created_at** | **datetime** | | [optional] [readonly] +**number_of_clients** | **int** | | [optional] [readonly] +**public_ip** | **str** | | [optional] [readonly] +**location** | [**EndpointAgentLocation**](EndpointAgentLocation.md) | | [optional] +**clients** | [**List[EndpointClient]**](EndpointClient.md) | List of clients (user accounts) that the agent works with. Not populated by default. | [optional] [readonly] +**total_memory** | **str** | | [optional] [readonly] +**agent_type** | **str** | | [optional] [readonly] +**vpn_profiles** | [**List[EndpointVpnProfile]**](EndpointVpnProfile.md) | List of VPN connections on the agent. Not populated by default. | [optional] [readonly] +**network_interface_profiles** | [**List[InterfaceProfile]**](InterfaceProfile.md) | List of network interfaces on the agent. Not populated by default. | [optional] [readonly] +**asn_details** | [**EndpointAsnDetails**](EndpointAsnDetails.md) | | [optional] +**license_type** | [**AgentLicenseType**](AgentLicenseType.md) | | [optional] +**tcp_driver_available** | **bool** | Status of TCP test support on the agent. | [optional] [readonly] +**npcap_version** | **str** | For Windows agents, the version of the NPCAP driver that the agent has loaded. | [optional] [readonly] + +## Example + +```python +from agents_api.models.endpoint_agents_agents_inner import EndpointAgentsAgentsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentsAgentsInner from a JSON string +endpoint_agents_agents_inner_instance = EndpointAgentsAgentsInner.from_json(json) +# print the JSON string representation of the object +print EndpointAgentsAgentsInner.to_json() + +# convert the object into a dict +endpoint_agents_agents_inner_dict = endpoint_agents_agents_inner_instance.to_dict() +# create an instance of EndpointAgentsAgentsInner from a dict +endpoint_agents_agents_inner_form_dict = endpoint_agents_agents_inner.from_dict(endpoint_agents_agents_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointAgentsConnectionString200Response.md b/endpoint/agents_api/docs/EndpointAgentsConnectionString200Response.md new file mode 100644 index 00000000..844207e5 --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAgentsConnectionString200Response.md @@ -0,0 +1,29 @@ +# EndpointAgentsConnectionString200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**connection_string** | **str** | The connection string is used for some integrations and other client types. | [optional] + +## Example + +```python +from agents_api.models.endpoint_agents_connection_string200_response import EndpointAgentsConnectionString200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentsConnectionString200Response from a JSON string +endpoint_agents_connection_string200_response_instance = EndpointAgentsConnectionString200Response.from_json(json) +# print the JSON string representation of the object +print EndpointAgentsConnectionString200Response.to_json() + +# convert the object into a dict +endpoint_agents_connection_string200_response_dict = endpoint_agents_connection_string200_response_instance.to_dict() +# create an instance of EndpointAgentsConnectionString200Response from a dict +endpoint_agents_connection_string200_response_form_dict = endpoint_agents_connection_string200_response.from_dict(endpoint_agents_connection_string200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointAgentsList200Response.md b/endpoint/agents_api/docs/EndpointAgentsList200Response.md new file mode 100644 index 00000000..dc39e207 --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAgentsList200Response.md @@ -0,0 +1,30 @@ +# EndpointAgentsList200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_agents** | **int** | The total number of agents. | [optional] +**agents** | [**List[EndpointAgentsAgentsInner]**](EndpointAgentsAgentsInner.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.endpoint_agents_list200_response import EndpointAgentsList200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentsList200Response from a JSON string +endpoint_agents_list200_response_instance = EndpointAgentsList200Response.from_json(json) +# print the JSON string representation of the object +print EndpointAgentsList200Response.to_json() + +# convert the object into a dict +endpoint_agents_list200_response_dict = endpoint_agents_list200_response_instance.to_dict() +# create an instance of EndpointAgentsList200Response from a dict +endpoint_agents_list200_response_form_dict = endpoint_agents_list200_response.from_dict(endpoint_agents_list200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointAgentsSearch200Response.md b/endpoint/agents_api/docs/EndpointAgentsSearch200Response.md new file mode 100644 index 00000000..2a902809 --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAgentsSearch200Response.md @@ -0,0 +1,30 @@ +# EndpointAgentsSearch200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_agents** | **int** | The total number of agents. | [optional] +**agents** | [**List[EndpointAgentsAgentsInner]**](EndpointAgentsAgentsInner.md) | | [optional] +**links** | [**PaginationNextLinkLinks**](PaginationNextLinkLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.endpoint_agents_search200_response import EndpointAgentsSearch200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentsSearch200Response from a JSON string +endpoint_agents_search200_response_instance = EndpointAgentsSearch200Response.from_json(json) +# print the JSON string representation of the object +print EndpointAgentsSearch200Response.to_json() + +# convert the object into a dict +endpoint_agents_search200_response_dict = endpoint_agents_search200_response_instance.to_dict() +# create an instance of EndpointAgentsSearch200Response from a dict +endpoint_agents_search200_response_form_dict = endpoint_agents_search200_response.from_dict(endpoint_agents_search200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointAsnDetails.md b/endpoint/agents_api/docs/EndpointAsnDetails.md new file mode 100644 index 00000000..7d1dabaa --- /dev/null +++ b/endpoint/agents_api/docs/EndpointAsnDetails.md @@ -0,0 +1,29 @@ +# EndpointAsnDetails + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**as_number** | **int** | Autonomous system number. | +**as_name** | **str** | Name of autonomous system. | [optional] + +## Example + +```python +from agents_api.models.endpoint_asn_details import EndpointAsnDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAsnDetails from a JSON string +endpoint_asn_details_instance = EndpointAsnDetails.from_json(json) +# print the JSON string representation of the object +print EndpointAsnDetails.to_json() + +# convert the object into a dict +endpoint_asn_details_dict = endpoint_asn_details_instance.to_dict() +# create an instance of EndpointAsnDetails from a dict +endpoint_asn_details_form_dict = endpoint_asn_details.from_dict(endpoint_asn_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) + + diff --git a/endpoint/agents_api/docs/EndpointBrowserExtension.md b/endpoint/agents_api/docs/EndpointBrowserExtension.md new file mode 100644 index 00000000..2eaef9f8 --- /dev/null +++ b/endpoint/agents_api/docs/EndpointBrowserExtension.md @@ -0,0 +1,33 @@ +# EndpointBrowserExtension + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**browser** | [**BrowserType**](BrowserType.md) | | [optional] +**profile** | **str** | Name of the browser profile where this extension is stored. | [optional] +**version** | **str** | Endpoint agent browser extension version. | [optional] +**enabled** | **bool** | Indicates if the extension is disabled or enabled in the web browser. | [optional] +**active** | **bool** | Flag indicating if there is communication between the extension and ThousandEyes portal. | [optional] +**error** | **str** | Contains any errors encountered while getting extension status. | [optional] + +## Example + +```python +from agents_api.models.endpoint_browser_extension import EndpointBrowserExtension + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointBrowserExtension from a JSON string +endpoint_browser_extension_instance = EndpointBrowserExtension.from_json(json) +# print the JSON string representation of the object +print EndpointBrowserExtension.to_json() + +# convert the object into a dict +endpoint_browser_extension_dict = endpoint_browser_extension_instance.to_dict() +# create an instance of EndpointBrowserExtension from a dict +endpoint_browser_extension_form_dict = endpoint_browser_extension.from_dict(endpoint_browser_extension_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointClient.md b/endpoint/agents_api/docs/EndpointClient.md new file mode 100644 index 00000000..1d43e84b --- /dev/null +++ b/endpoint/agents_api/docs/EndpointClient.md @@ -0,0 +1,30 @@ +# EndpointClient + +Information about the user who has the agent installed. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_profile** | [**EndpointUserProfile**](EndpointUserProfile.md) | | [optional] +**browser_extensions** | [**List[EndpointBrowserExtension]**](EndpointBrowserExtension.md) | | [optional] + +## Example + +```python +from agents_api.models.endpoint_client import EndpointClient + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointClient from a JSON string +endpoint_client_instance = EndpointClient.from_json(json) +# print the JSON string representation of the object +print EndpointClient.to_json() + +# convert the object into a dict +endpoint_client_dict = endpoint_client_instance.to_dict() +# create an instance of EndpointClient from a dict +endpoint_client_form_dict = endpoint_client.from_dict(endpoint_client_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointUserProfile.md b/endpoint/agents_api/docs/EndpointUserProfile.md new file mode 100644 index 00000000..d03afe6e --- /dev/null +++ b/endpoint/agents_api/docs/EndpointUserProfile.md @@ -0,0 +1,28 @@ +# EndpointUserProfile + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_name** | **str** | | + +## Example + +```python +from agents_api.models.endpoint_user_profile import EndpointUserProfile + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointUserProfile from a JSON string +endpoint_user_profile_instance = EndpointUserProfile.from_json(json) +# print the JSON string representation of the object +print EndpointUserProfile.to_json() + +# convert the object into a dict +endpoint_user_profile_dict = endpoint_user_profile_instance.to_dict() +# create an instance of EndpointUserProfile from a dict +endpoint_user_profile_form_dict = endpoint_user_profile.from_dict(endpoint_user_profile_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EndpointVpnProfile.md b/endpoint/agents_api/docs/EndpointVpnProfile.md new file mode 100644 index 00000000..b4838a45 --- /dev/null +++ b/endpoint/agents_api/docs/EndpointVpnProfile.md @@ -0,0 +1,32 @@ +# EndpointVpnProfile + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interface_name** | **str** | Interface name associated with `interfaceProfile`. | [optional] +**vpn_type** | [**VpnType**](VpnType.md) | | [optional] +**vpn_gateway_address** | **str** | IP address of the VPN gateway. | [optional] +**vpn_client_addresses** | **List[str]** | List of private IP addresses assigned to the device, by the VPN server. | +**vpn_client_network_range** | **List[str]** | List of private networks assigned to the device, by the VPN server. | + +## Example + +```python +from agents_api.models.endpoint_vpn_profile import EndpointVpnProfile + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointVpnProfile from a JSON string +endpoint_vpn_profile_instance = EndpointVpnProfile.from_json(json) +# print the JSON string representation of the object +print EndpointVpnProfile.to_json() + +# convert the object into a dict +endpoint_vpn_profile_dict = endpoint_vpn_profile_instance.to_dict() +# create an instance of EndpointVpnProfile from a dict +endpoint_vpn_profile_form_dict = endpoint_vpn_profile.from_dict(endpoint_vpn_profile_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/Error.md b/endpoint/agents_api/docs/Error.md new file mode 100644 index 00000000..41bf6718 --- /dev/null +++ b/endpoint/agents_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from agents_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/EthernetProfile.md b/endpoint/agents_api/docs/EthernetProfile.md new file mode 100644 index 00000000..ac54a7f2 --- /dev/null +++ b/endpoint/agents_api/docs/EthernetProfile.md @@ -0,0 +1,29 @@ +# EthernetProfile + +Information about the ethernet connectivity of this device. Only present if the hardware type is `ethernet`. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**link_speed** | **int** | Link speed in Mbps. | [optional] + +## Example + +```python +from agents_api.models.ethernet_profile import EthernetProfile + +# TODO update the JSON string below +json = "{}" +# create an instance of EthernetProfile from a JSON string +ethernet_profile_instance = EthernetProfile.from_json(json) +# print the JSON string representation of the object +print EthernetProfile.to_json() + +# convert the object into a dict +ethernet_profile_dict = ethernet_profile_instance.to_dict() +# create an instance of EthernetProfile from a dict +ethernet_profile_form_dict = ethernet_profile.from_dict(ethernet_profile_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/Expand.md b/endpoint/agents_api/docs/Expand.md new file mode 100644 index 00000000..5d5b5ca2 --- /dev/null +++ b/endpoint/agents_api/docs/Expand.md @@ -0,0 +1,10 @@ +# Expand + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/InterfaceHardwareType.md b/endpoint/agents_api/docs/InterfaceHardwareType.md new file mode 100644 index 00000000..b4967774 --- /dev/null +++ b/endpoint/agents_api/docs/InterfaceHardwareType.md @@ -0,0 +1,10 @@ +# InterfaceHardwareType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/InterfaceProfile.md b/endpoint/agents_api/docs/InterfaceProfile.md new file mode 100644 index 00000000..b4006c8b --- /dev/null +++ b/endpoint/agents_api/docs/InterfaceProfile.md @@ -0,0 +1,32 @@ +# InterfaceProfile + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interface_name** | **str** | | [optional] +**address_profiles** | [**List[AddressProfile]**](AddressProfile.md) | | [optional] +**hardware_type** | [**InterfaceHardwareType**](InterfaceHardwareType.md) | | [optional] +**ethernet_profile** | [**EthernetProfile**](EthernetProfile.md) | | [optional] +**wireless_profile** | [**WirelessProfile**](WirelessProfile.md) | | [optional] + +## Example + +```python +from agents_api.models.interface_profile import InterfaceProfile + +# TODO update the JSON string below +json = "{}" +# create an instance of InterfaceProfile from a JSON string +interface_profile_instance = InterfaceProfile.from_json(json) +# print the JSON string representation of the object +print InterfaceProfile.to_json() + +# convert the object into a dict +interface_profile_dict = interface_profile_instance.to_dict() +# create an instance of InterfaceProfile from a dict +interface_profile_form_dict = interface_profile.from_dict(interface_profile_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/Link.md b/endpoint/agents_api/docs/Link.md new file mode 100644 index 00000000..b158dd4c --- /dev/null +++ b/endpoint/agents_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from agents_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/ManageAgentsApi.md b/endpoint/agents_api/docs/ManageAgentsApi.md new file mode 100644 index 00000000..4159e81a --- /dev/null +++ b/endpoint/agents_api/docs/ManageAgentsApi.md @@ -0,0 +1,629 @@ +# agents_api.ManageAgentsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**endpoint_agent_delete**](ManageAgentsApi.md#endpoint_agent_delete) | **DELETE** /v7/endpoint/agents/{agentId} | Delete endpoint agent +[**endpoint_agent_disable**](ManageAgentsApi.md#endpoint_agent_disable) | **POST** /v7/endpoint/agents/{agentId}/disable | Disable endpoint agent +[**endpoint_agent_enable**](ManageAgentsApi.md#endpoint_agent_enable) | **POST** /v7/endpoint/agents/{agentId}/enable | Enable endpoint agent +[**endpoint_agent_get**](ManageAgentsApi.md#endpoint_agent_get) | **GET** /v7/endpoint/agents/{agentId} | Retrieve endpoint agent +[**endpoint_agent_update**](ManageAgentsApi.md#endpoint_agent_update) | **PATCH** /v7/endpoint/agents/{agentId} | Update endpoint agent +[**endpoint_agents_list**](ManageAgentsApi.md#endpoint_agents_list) | **GET** /v7/endpoint/agents | List endpoint agents +[**endpoint_agents_search**](ManageAgentsApi.md#endpoint_agents_search) | **POST** /v7/endpoint/agents/filter | Filter endpoint agents + + +# **endpoint_agent_delete** +> endpoint_agent_delete(agent_id, aid=aid, expand=expand) + +Delete endpoint agent + +Deletes the agent with the specified `agent_id`. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import agents_api +from agents_api.models.expand import Expand +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.ManageAgentsApi(api_client) + agent_id = 'agent_id_example' # str | The identifier of the agent to operate on. + 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.Expand()] # List[Expand] | This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. (optional) + + try: + # Delete endpoint agent + api_instance.endpoint_agent_delete(agent_id, aid=aid, expand=expand) + except Exception as e: + print("Exception when calling ManageAgentsApi->endpoint_agent_delete: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| The identifier of the agent to operate on. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. | [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 | - | + +[[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) + +# **endpoint_agent_disable** +> EndpointAgentGet200Response endpoint_agent_disable(agent_id, aid=aid) + +Disable endpoint agent + +Disables an endpoint agent. If it's already disabled, it has no effect (no operation). + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import agents_api +from agents_api.models.endpoint_agent_get200_response import EndpointAgentGet200Response +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.ManageAgentsApi(api_client) + agent_id = 'agent_id_example' # str | The identifier of the agent to operate on. + 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: + # Disable endpoint agent + api_response = api_instance.endpoint_agent_disable(agent_id, aid=aid) + print("The response of ManageAgentsApi->endpoint_agent_disable:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManageAgentsApi->endpoint_agent_disable: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| The identifier of the agent to operate on. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointAgentGet200Response**](EndpointAgentGet200Response.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** | The agent's current state. | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[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) + +# **endpoint_agent_enable** +> EndpointAgentGet200Response endpoint_agent_enable(agent_id, aid=aid) + +Enable endpoint agent + +Enables an endpoint agent. If it's already enabled, it has no effect (no operation). + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import agents_api +from agents_api.models.endpoint_agent_get200_response import EndpointAgentGet200Response +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.ManageAgentsApi(api_client) + agent_id = 'agent_id_example' # str | The identifier of the agent to operate on. + 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: + # Enable endpoint agent + api_response = api_instance.endpoint_agent_enable(agent_id, aid=aid) + print("The response of ManageAgentsApi->endpoint_agent_enable:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManageAgentsApi->endpoint_agent_enable: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| The identifier of the agent to operate on. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointAgentGet200Response**](EndpointAgentGet200Response.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** | The agent's current state. | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[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) + +# **endpoint_agent_get** +> EndpointAgentGet200Response endpoint_agent_get(agent_id, aid=aid, expand=expand, include_deleted=include_deleted) + +Retrieve endpoint agent + +Retrieves details of an agent with the specified `agent_id`. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import agents_api +from agents_api.models.endpoint_agent_get200_response import EndpointAgentGet200Response +from agents_api.models.expand import Expand +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.ManageAgentsApi(api_client) + agent_id = 'agent_id_example' # str | The identifier of the agent to operate on. + 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.Expand()] # List[Expand] | This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. (optional) + include_deleted = false # bool | When requesting entities, set to `true` if you want to see deleted entities. (optional) + + try: + # Retrieve endpoint agent + api_response = api_instance.endpoint_agent_get(agent_id, aid=aid, expand=expand, include_deleted=include_deleted) + print("The response of ManageAgentsApi->endpoint_agent_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManageAgentsApi->endpoint_agent_get: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| The identifier of the agent to operate on. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. | [optional] + **include_deleted** | **bool**| When requesting entities, set to `true` if you want to see deleted entities. | [optional] + +### Return type + +[**EndpointAgentGet200Response**](EndpointAgentGet200Response.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** | The agent's current state. | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[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) + +# **endpoint_agent_update** +> EndpointAgentGet200Response endpoint_agent_update(agent_id, aid=aid, expand=expand, endpoint_agent_update=endpoint_agent_update) + +Update endpoint agent + +Updates the agent with the specified `agent_id`. This API supports the modification of the following fields: * `name` * `licenseType` Any attempt to update fields other than those listed above, with a value different from their current value, will result in a 400 Bad Request response. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import agents_api +from agents_api.models.endpoint_agent_get200_response import EndpointAgentGet200Response +from agents_api.models.endpoint_agent_update import EndpointAgentUpdate +from agents_api.models.expand import Expand +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.ManageAgentsApi(api_client) + agent_id = 'agent_id_example' # str | The identifier of the agent to operate on. + 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.Expand()] # List[Expand] | This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. (optional) + endpoint_agent_update = agents_api.EndpointAgentUpdate() # EndpointAgentUpdate | Fields to modify on the agent (optional) + + try: + # Update endpoint agent + api_response = api_instance.endpoint_agent_update(agent_id, aid=aid, expand=expand, endpoint_agent_update=endpoint_agent_update) + print("The response of ManageAgentsApi->endpoint_agent_update:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManageAgentsApi->endpoint_agent_update: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| The identifier of the agent to operate on. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. | [optional] + **endpoint_agent_update** | [**EndpointAgentUpdate**](EndpointAgentUpdate.md)| Fields to modify on the agent | [optional] + +### Return type + +[**EndpointAgentGet200Response**](EndpointAgentGet200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The agent's current state. | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[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) + +# **endpoint_agents_list** +> EndpointAgentsList200Response endpoint_agents_list(max=max, cursor=cursor, aid=aid, expand=expand, include_deleted=include_deleted, use_all_permitted_aids=use_all_permitted_aids, agent_name=agent_name, computer_name=computer_name) + +List endpoint agents + +Retrieves a list of endpoint agents in a given account group. If there are no agents in the specified account group, it returns an empty array. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import agents_api +from agents_api.models.endpoint_agents_list200_response import EndpointAgentsList200Response +from agents_api.models.expand import Expand +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.ManageAgentsApi(api_client) + max = 5 # float | (Optional) Maximum number of objects to return. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + 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.Expand()] # List[Expand] | This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. (optional) + include_deleted = false # bool | When requesting entities, set to `true` if you want to see deleted entities. (optional) + use_all_permitted_aids = False # bool | Set to `true` to load data from all accounts the user has access to. (optional) (default to False) + agent_name = 'agent_name_example' # str | Returns only agents with the specified name. This is an exact match only. (optional) + computer_name = 'computer_name_example' # str | Returns only agents with the specified computer name. This is an exact match only. (optional) + + try: + # List endpoint agents + api_response = api_instance.endpoint_agents_list(max=max, cursor=cursor, aid=aid, expand=expand, include_deleted=include_deleted, use_all_permitted_aids=use_all_permitted_aids, agent_name=agent_name, computer_name=computer_name) + print("The response of ManageAgentsApi->endpoint_agents_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManageAgentsApi->endpoint_agents_list: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **max** | **float**| (Optional) Maximum number of objects to return. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. | [optional] + **include_deleted** | **bool**| When requesting entities, set to `true` if you want to see deleted entities. | [optional] + **use_all_permitted_aids** | **bool**| Set to `true` to load data from all accounts the user has access to. | [optional] [default to False] + **agent_name** | **str**| Returns only agents with the specified name. This is an exact match only. | [optional] + **computer_name** | **str**| Returns only agents with the specified computer name. This is an exact match only. | [optional] + +### Return type + +[**EndpointAgentsList200Response**](EndpointAgentsList200Response.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 | - | +**429** | Exhausted rate limit for the organization | - | + +[[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) + +# **endpoint_agents_search** +> EndpointAgentsSearch200Response endpoint_agents_search(agent_search_request, max=max, cursor=cursor, aid=aid, expand=expand, include_deleted=include_deleted) + +Filter endpoint agents + +Retrieves a list of endpoint agents within the specified account group that match the specified filters. If no agents meet the filter criteria, the API returns an empty array. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import agents_api +from agents_api.models.agent_search_request import AgentSearchRequest +from agents_api.models.endpoint_agents_search200_response import EndpointAgentsSearch200Response +from agents_api.models.expand import Expand +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.ManageAgentsApi(api_client) + agent_search_request = agents_api.AgentSearchRequest() # AgentSearchRequest | The filter options for advanced search filtering for agents. + max = 5 # float | (Optional) Maximum number of objects to return. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + 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.Expand()] # List[Expand] | This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. (optional) + include_deleted = false # bool | When requesting entities, set to `true` if you want to see deleted entities. (optional) + + try: + # Filter endpoint agents + api_response = api_instance.endpoint_agents_search(agent_search_request, max=max, cursor=cursor, aid=aid, expand=expand, include_deleted=include_deleted) + print("The response of ManageAgentsApi->endpoint_agents_search:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManageAgentsApi->endpoint_agents_search: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_search_request** | [**AgentSearchRequest**](AgentSearchRequest.md)| The filter options for advanced search filtering for agents. | + **max** | **float**| (Optional) Maximum number of objects to return. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. | [optional] + **include_deleted** | **bool**| When requesting entities, set to `true` if you want to see deleted entities. | [optional] + +### Return type + +[**EndpointAgentsSearch200Response**](EndpointAgentsSearch200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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 | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/agents_api/docs/PaginationNextLink.md b/endpoint/agents_api/docs/PaginationNextLink.md new file mode 100644 index 00000000..0b02c80f --- /dev/null +++ b/endpoint/agents_api/docs/PaginationNextLink.md @@ -0,0 +1,29 @@ +# PaginationNextLink + +A links object containing a related link for forward pagination. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**PaginationNextLinkLinks**](PaginationNextLinkLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.pagination_next_link import PaginationNextLink + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationNextLink from a JSON string +pagination_next_link_instance = PaginationNextLink.from_json(json) +# print the JSON string representation of the object +print PaginationNextLink.to_json() + +# convert the object into a dict +pagination_next_link_dict = pagination_next_link_instance.to_dict() +# create an instance of PaginationNextLink from a dict +pagination_next_link_form_dict = pagination_next_link.from_dict(pagination_next_link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/PaginationNextLinkLinks.md b/endpoint/agents_api/docs/PaginationNextLinkLinks.md new file mode 100644 index 00000000..0d9aa5b6 --- /dev/null +++ b/endpoint/agents_api/docs/PaginationNextLinkLinks.md @@ -0,0 +1,28 @@ +# PaginationNextLinkLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from agents_api.models.pagination_next_link_links import PaginationNextLinkLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationNextLinkLinks from a JSON string +pagination_next_link_links_instance = PaginationNextLinkLinks.from_json(json) +# print the JSON string representation of the object +print PaginationNextLinkLinks.to_json() + +# convert the object into a dict +pagination_next_link_links_dict = pagination_next_link_links_instance.to_dict() +# create an instance of PaginationNextLinkLinks from a dict +pagination_next_link_links_form_dict = pagination_next_link_links.from_dict(pagination_next_link_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/Platform.md b/endpoint/agents_api/docs/Platform.md new file mode 100644 index 00000000..0fda6780 --- /dev/null +++ b/endpoint/agents_api/docs/Platform.md @@ -0,0 +1,11 @@ +# Platform + +OS platform types + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/SelfLinks.md b/endpoint/agents_api/docs/SelfLinks.md new file mode 100644 index 00000000..152ab3c6 --- /dev/null +++ b/endpoint/agents_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from agents_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/SelfLinksLinks.md b/endpoint/agents_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..e01ac6f9 --- /dev/null +++ b/endpoint/agents_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from agents_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/Status.md b/endpoint/agents_api/docs/Status.md new file mode 100644 index 00000000..5d270b46 --- /dev/null +++ b/endpoint/agents_api/docs/Status.md @@ -0,0 +1,11 @@ +# Status + +Status of the endpoint agent in ThousandEyes. Disabled agents don't report data. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/TransferApi.md b/endpoint/agents_api/docs/TransferApi.md new file mode 100644 index 00000000..b6212c2c --- /dev/null +++ b/endpoint/agents_api/docs/TransferApi.md @@ -0,0 +1,178 @@ +# agents_api.TransferApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**endpoint_agent_bulk_transfer**](TransferApi.md#endpoint_agent_bulk_transfer) | **POST** /v7/endpoint/agents/transfer/bulk | Bulk transfer agents +[**endpoint_agent_single_transfer**](TransferApi.md#endpoint_agent_single_transfer) | **POST** /v7/endpoint/agents/{agentId}/transfer | Transfer endpoint agent + + +# **endpoint_agent_bulk_transfer** +> EndpointAgentBulkTransfer207Response endpoint_agent_bulk_transfer(aid=aid, endpoint_agent_bulk_transfer_request=endpoint_agent_bulk_transfer_request) + +Bulk transfer agents + +Initiates the transfer of multiple agents between accounts. The following conditions apply: * The requester must possess 'write' permissions for both the 'from' and 'to' accounts involved in each transfer. * Multiple transfers may involve a mix of different source and destination accounts. * For each transfer request, the 'from' account must match the current account of the respective agent. * Transfers are executed asynchronously. * Progress tracking is not intended, but users can monitor the progress by periodically polling the 'get agent' endpoint. * Each transfer request is individually validated and completed; this operation is not atomic, meaning transfers can succeed or fail individually. * The API response provides the status of each transfer request. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import agents_api +from agents_api.models.endpoint_agent_bulk_transfer207_response import EndpointAgentBulkTransfer207Response +from agents_api.models.endpoint_agent_bulk_transfer_request import EndpointAgentBulkTransferRequest +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.TransferApi(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) + endpoint_agent_bulk_transfer_request = agents_api.EndpointAgentBulkTransferRequest() # EndpointAgentBulkTransferRequest | A collection of `AgentTransfers`. (optional) + + try: + # Bulk transfer agents + api_response = api_instance.endpoint_agent_bulk_transfer(aid=aid, endpoint_agent_bulk_transfer_request=endpoint_agent_bulk_transfer_request) + print("The response of TransferApi->endpoint_agent_bulk_transfer:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TransferApi->endpoint_agent_bulk_transfer: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **endpoint_agent_bulk_transfer_request** | [**EndpointAgentBulkTransferRequest**](EndpointAgentBulkTransferRequest.md)| A collection of `AgentTransfers`. | [optional] + +### Return type + +[**EndpointAgentBulkTransfer207Response**](EndpointAgentBulkTransfer207Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json, text/csv, text/plain + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**207** | Transfer initiated | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[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) + +# **endpoint_agent_single_transfer** +> endpoint_agent_single_transfer(agent_id, agent_transfer_request, aid=aid) + +Transfer endpoint agent + +Initiates the transfer of an agent from its current account, which must correspond to the provided aid, to the target account. **Note:** It is essential to ensure that the `aid` parameter matches the current account of the agent for this operation to succeed. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import agents_api +from agents_api.models.agent_transfer_request import AgentTransferRequest +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.TransferApi(api_client) + agent_id = 'agent_id_example' # str | The identifier of the agent to operate on. + agent_transfer_request = agents_api.AgentTransferRequest() # AgentTransferRequest | The request to move an agent between accounts. + 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: + # Transfer endpoint agent + api_instance.endpoint_agent_single_transfer(agent_id, agent_transfer_request, aid=aid) + except Exception as e: + print("Exception when calling TransferApi->endpoint_agent_single_transfer: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| The identifier of the agent to operate on. | + **agent_transfer_request** | [**AgentTransferRequest**](AgentTransferRequest.md)| The request to move an agent between accounts. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Transfer initiated | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/agents_api/docs/UnauthorizedError.md b/endpoint/agents_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..8f5ab602 --- /dev/null +++ b/endpoint/agents_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from agents_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/VpnType.md b/endpoint/agents_api/docs/VpnType.md new file mode 100644 index 00000000..5531185b --- /dev/null +++ b/endpoint/agents_api/docs/VpnType.md @@ -0,0 +1,11 @@ +# VpnType + +Name of the VPN provider. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/docs/WirelessProfile.md b/endpoint/agents_api/docs/WirelessProfile.md new file mode 100644 index 00000000..6a0e81da --- /dev/null +++ b/endpoint/agents_api/docs/WirelessProfile.md @@ -0,0 +1,32 @@ +# WirelessProfile + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bssid** | **str** | | [optional] +**ssid** | **str** | | [optional] +**rssi** | **int** | | [optional] +**channel** | **int** | | [optional] +**phy_mode** | **str** | | [optional] + +## Example + +```python +from agents_api.models.wireless_profile import WirelessProfile + +# TODO update the JSON string below +json = "{}" +# create an instance of WirelessProfile from a JSON string +wireless_profile_instance = WirelessProfile.from_json(json) +# print the JSON string representation of the object +print WirelessProfile.to_json() + +# convert the object into a dict +wireless_profile_dict = wireless_profile_instance.to_dict() +# create an instance of WirelessProfile from a dict +wireless_profile_form_dict = wireless_profile.from_dict(wireless_profile_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/agents_api/git_push.sh b/endpoint/agents_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/endpoint/agents_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/endpoint/agents_api/pyproject.toml b/endpoint/agents_api/pyproject.toml new file mode 100644 index 00000000..17a57f6c --- /dev/null +++ b/endpoint/agents_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "agents_api" +version = "1.0.0" +description = "Endpoint Agents API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Endpoint Agents API"] +include = ["agents_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/endpoint/agents_api/requirements.txt b/endpoint/agents_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/endpoint/agents_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/endpoint/agents_api/setup.cfg b/endpoint/agents_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/endpoint/agents_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/endpoint/agents_api/setup.py b/endpoint/agents_api/setup.py new file mode 100644 index 00000000..e47e947c --- /dev/null +++ b/endpoint/agents_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "agents-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Endpoint Agents API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Endpoint Agents API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + Manage ThousandEyes Endpoint Agents using this API. + """, # noqa: E501 + package_data={"agents_api": ["py.typed"]}, +) diff --git a/endpoint/agents_api/test-requirements.txt b/endpoint/agents_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/endpoint/agents_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/endpoint/agents_api/test/__init__.py b/endpoint/agents_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/endpoint/agents_api/test/test_account_group_id.py b/endpoint/agents_api/test/test_account_group_id.py new file mode 100644 index 00000000..e4b6da5e --- /dev/null +++ b/endpoint/agents_api/test/test_account_group_id.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.account_group_id import AccountGroupId + +class TestAccountGroupId(unittest.TestCase): + """AccountGroupId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroupId: + """Test AccountGroupId + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroupId` + """ + model = AccountGroupId() + if include_optional: + return AccountGroupId( + aid = '11' + ) + else: + return AccountGroupId( + ) + """ + + def testAccountGroupId(self): + """Test AccountGroupId""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_address_profile.py b/endpoint/agents_api/test/test_address_profile.py new file mode 100644 index 00000000..aca9f34f --- /dev/null +++ b/endpoint/agents_api/test/test_address_profile.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.address_profile import AddressProfile + +class TestAddressProfile(unittest.TestCase): + """AddressProfile unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AddressProfile: + """Test AddressProfile + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AddressProfile` + """ + model = AddressProfile() + if include_optional: + return AddressProfile( + address_type = 'unique-local', + ip_address = '2001:db8:3333:4444:5555:6666:7777:8888', + prefix_length = 24, + gateway = '192.168.0.254', + router_hardware_address = '5c:b1:3e:46:1c:84' + ) + else: + return AddressProfile( + ) + """ + + def testAddressProfile(self): + """Test AddressProfile""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_address_type.py b/endpoint/agents_api/test/test_address_type.py new file mode 100644 index 00000000..4c1128d5 --- /dev/null +++ b/endpoint/agents_api/test/test_address_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.address_type import AddressType + +class TestAddressType(unittest.TestCase): + """AddressType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAddressType(self): + """Test AddressType""" + # inst = AddressType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_administrative_endpoints_api.py b/endpoint/agents_api/test/test_administrative_endpoints_api.py new file mode 100644 index 00000000..fe1dae94 --- /dev/null +++ b/endpoint/agents_api/test/test_administrative_endpoints_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest + +from agents_api.api.administrative_endpoints_api import AdministrativeEndpointsApi + + +class TestAdministrativeEndpointsApi(unittest.TestCase): + """AdministrativeEndpointsApi unit test stubs""" + + def setUp(self) -> None: + self.api = AdministrativeEndpointsApi() + + def tearDown(self) -> None: + pass + + def test_endpoint_agents_connection_string(self) -> None: + """Test case for endpoint_agents_connection_string + + Get agent connection string + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_agent_license_type.py b/endpoint/agents_api/test/test_agent_license_type.py new file mode 100644 index 00000000..db5567ee --- /dev/null +++ b/endpoint/agents_api/test/test_agent_license_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.agent_license_type import AgentLicenseType + +class TestAgentLicenseType(unittest.TestCase): + """AgentLicenseType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAgentLicenseType(self): + """Test AgentLicenseType""" + # inst = AgentLicenseType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_agent_search_request.py b/endpoint/agents_api/test/test_agent_search_request.py new file mode 100644 index 00000000..96f732a5 --- /dev/null +++ b/endpoint/agents_api/test/test_agent_search_request.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.agent_search_request import AgentSearchRequest + +class TestAgentSearchRequest(unittest.TestCase): + """AgentSearchRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentSearchRequest: + """Test AgentSearchRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentSearchRequest` + """ + model = AgentSearchRequest() + if include_optional: + return AgentSearchRequest( + search_filters = agents_api.models.agent_search_request_search_filters.AgentSearchRequest_searchFilters( + agent_name = [ + 'myagent-1234' + ], + computer_name = [ + 'DESKTOP-45AE8' + ], + username = ["picard"], + platform = [ + 'mac' + ], + os_version = [ + 'Version 10.15.2' + ], + location_country_iso = [ + 'FR' + ], + location_subdivision1_code = [ + 'ENG' + ], + location_city = [ + 'Paris' + ], ) + ) + else: + return AgentSearchRequest( + ) + """ + + def testAgentSearchRequest(self): + """Test AgentSearchRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_agent_search_request_search_filters.py b/endpoint/agents_api/test/test_agent_search_request_search_filters.py new file mode 100644 index 00000000..619efed4 --- /dev/null +++ b/endpoint/agents_api/test/test_agent_search_request_search_filters.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.agent_search_request_search_filters import AgentSearchRequestSearchFilters + +class TestAgentSearchRequestSearchFilters(unittest.TestCase): + """AgentSearchRequestSearchFilters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentSearchRequestSearchFilters: + """Test AgentSearchRequestSearchFilters + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentSearchRequestSearchFilters` + """ + model = AgentSearchRequestSearchFilters() + if include_optional: + return AgentSearchRequestSearchFilters( + agent_name = [ + 'myagent-1234' + ], + computer_name = [ + 'DESKTOP-45AE8' + ], + username = ["picard"], + platform = [ + 'mac' + ], + os_version = [ + 'Version 10.15.2' + ], + location_country_iso = [ + 'FR' + ], + location_subdivision1_code = [ + 'ENG' + ], + location_city = [ + 'Paris' + ] + ) + else: + return AgentSearchRequestSearchFilters( + ) + """ + + def testAgentSearchRequestSearchFilters(self): + """Test AgentSearchRequestSearchFilters""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_agent_transfer.py b/endpoint/agents_api/test/test_agent_transfer.py new file mode 100644 index 00000000..89bee5d4 --- /dev/null +++ b/endpoint/agents_api/test/test_agent_transfer.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.agent_transfer import AgentTransfer + +class TestAgentTransfer(unittest.TestCase): + """AgentTransfer unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentTransfer: + """Test AgentTransfer + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentTransfer` + """ + model = AgentTransfer() + if include_optional: + return AgentTransfer( + agent_id = '5d0764ac-7e42-4ec8-a0d4-39fc53edccba', + from_aid = '111', + to_aid = '111' + ) + else: + return AgentTransfer( + ) + """ + + def testAgentTransfer(self): + """Test AgentTransfer""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_agent_transfer_request.py b/endpoint/agents_api/test/test_agent_transfer_request.py new file mode 100644 index 00000000..f0ee8d33 --- /dev/null +++ b/endpoint/agents_api/test/test_agent_transfer_request.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.agent_transfer_request import AgentTransferRequest + +class TestAgentTransferRequest(unittest.TestCase): + """AgentTransferRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentTransferRequest: + """Test AgentTransferRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentTransferRequest` + """ + model = AgentTransferRequest() + if include_optional: + return AgentTransferRequest( + to_aid = '111' + ) + else: + return AgentTransferRequest( + ) + """ + + def testAgentTransferRequest(self): + """Test AgentTransferRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_browser_type.py b/endpoint/agents_api/test/test_browser_type.py new file mode 100644 index 00000000..9e5b6bf4 --- /dev/null +++ b/endpoint/agents_api/test/test_browser_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.browser_type import BrowserType + +class TestBrowserType(unittest.TestCase): + """BrowserType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBrowserType(self): + """Test BrowserType""" + # inst = BrowserType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_agent.py b/endpoint/agents_api/test/test_endpoint_agent.py new file mode 100644 index 00000000..3ca5ac9b --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_agent.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_agent import EndpointAgent + +class TestEndpointAgent(unittest.TestCase): + """EndpointAgent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgent: + """Test EndpointAgent + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgent` + """ + model = EndpointAgent() + if include_optional: + return EndpointAgent( + id = '5d0764ac-7e42-4ec8-a0d4-39fc53edccba', + aid = None, + name = 'Office Printer', + computer_name = 'DESKJET-123', + os_version = 'Version 10.15.2 (Build 19C57)', + platform = 'mac', + kernel_version = 'Darwin 19.2.0', + manufacturer = 'Apple, Inc.', + model = 'MacBookAir7,2', + last_seen = '2022-05-26T23:37:16Z', + status = 'enabled', + deleted = True, + version = '0.123.4', + created_at = '2022-05-26T23:37:16Z', + number_of_clients = 3, + public_ip = '88.45.2.123', + location = agents_api.models.endpoint_agent_location.EndpointAgentLocation( + latitude = 51.51279, + longitude = -0.09184, + location_name = 'London', ), + clients = [ + agents_api.models.endpoint_client.EndpointClient( + user_profile = agents_api.models.endpoint_user_profile.EndpointUserProfile( + user_name = 'joeblogs32', ), + browser_extensions = [ + agents_api.models.endpoint_browser_extension.EndpointBrowserExtension( + browser = 'edge', + profile = 'Profile 1', + version = '0.123.0', + enabled = True, + active = True, + error = '', ) + ], ) + ], + total_memory = '16384 MB', + agent_type = 'endpoint', + vpn_profiles = [ + agents_api.models.endpoint_vpn_profile.EndpointVpnProfile( + interface_name = '', + vpn_type = 'cisco-anyconnect', + vpn_gateway_address = '', + vpn_client_addresses = ["10.100.0.10"], + vpn_client_network_range = ["10.100.0.0/22"], ) + ], + network_interface_profiles = [ + agents_api.models.interface_profile.InterfaceProfile( + interface_name = 'en0', + address_profiles = [ + agents_api.models.address_profile.AddressProfile( + address_type = 'unique-local', + ip_address = '2001:db8:3333:4444:5555:6666:7777:8888', + prefix_length = 24, + gateway = '192.168.0.254', + router_hardware_address = '5c:b1:3e:46:1c:84', ) + ], + hardware_type = 'wireless', + ethernet_profile = agents_api.models.ethernet_profile.EthernetProfile( + link_speed = 56, ), + wireless_profile = agents_api.models.wireless_profile.WirelessProfile( + bssid = '00:11:22:aa:bb:cc', + ssid = 'GuestWiFi', + rssi = -36, + channel = 48, + phy_mode = '802.11ac', ), ) + ], + asn_details = agents_api.models.endpoint_asn_details.EndpointAsnDetails( + as_number = 5089, + as_name = 'Virgin Media Limited', ), + license_type = 'essentials', + tcp_driver_available = True, + npcap_version = '' + ) + else: + return EndpointAgent( + ) + """ + + def testEndpointAgent(self): + """Test EndpointAgent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_agent_aid.py b/endpoint/agents_api/test/test_endpoint_agent_aid.py new file mode 100644 index 00000000..af537b60 --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_agent_aid.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_agent_aid import EndpointAgentAid + +class TestEndpointAgentAid(unittest.TestCase): + """EndpointAgentAid unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentAid: + """Test EndpointAgentAid + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentAid` + """ + model = EndpointAgentAid() + if include_optional: + return EndpointAgentAid( + aid = '11' + ) + else: + return EndpointAgentAid( + ) + """ + + def testEndpointAgentAid(self): + """Test EndpointAgentAid""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_agent_bulk_transfer207_response.py b/endpoint/agents_api/test/test_endpoint_agent_bulk_transfer207_response.py new file mode 100644 index 00000000..227f3397 --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_agent_bulk_transfer207_response.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_agent_bulk_transfer207_response import EndpointAgentBulkTransfer207Response + +class TestEndpointAgentBulkTransfer207Response(unittest.TestCase): + """EndpointAgentBulkTransfer207Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentBulkTransfer207Response: + """Test EndpointAgentBulkTransfer207Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentBulkTransfer207Response` + """ + model = EndpointAgentBulkTransfer207Response() + if include_optional: + return EndpointAgentBulkTransfer207Response( + items = [{"status":200,"detail":"Initiated","request":{"agentId":"5d0764ac-7e42-4ec8-a0d4-39fc53edccba","fromAid":"234","toAid":"222"}},{"status":400,"detail":"Missing from-account id","request":{"agentId":"5d0764ac-7e42-4ec8-a0d5-39fc53ed1234","fromAid":"xxx","toAid":"222"}},{"status":403,"detail":"User does not have permission on 'to' aid","request":{"agentId":"5d0764ac-7e42-4ec8-a0d5-39fc53ed7890","fromAid":"555","toAid":"444"}}] + ) + else: + return EndpointAgentBulkTransfer207Response( + ) + """ + + def testEndpointAgentBulkTransfer207Response(self): + """Test EndpointAgentBulkTransfer207Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_agent_bulk_transfer207_response_items_inner.py b/endpoint/agents_api/test/test_endpoint_agent_bulk_transfer207_response_items_inner.py new file mode 100644 index 00000000..2e92be55 --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_agent_bulk_transfer207_response_items_inner.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_agent_bulk_transfer207_response_items_inner import EndpointAgentBulkTransfer207ResponseItemsInner + +class TestEndpointAgentBulkTransfer207ResponseItemsInner(unittest.TestCase): + """EndpointAgentBulkTransfer207ResponseItemsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentBulkTransfer207ResponseItemsInner: + """Test EndpointAgentBulkTransfer207ResponseItemsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentBulkTransfer207ResponseItemsInner` + """ + model = EndpointAgentBulkTransfer207ResponseItemsInner() + if include_optional: + return EndpointAgentBulkTransfer207ResponseItemsInner( + type = '', + title = '', + status = 56, + detail = '', + instance = '', + request = {"agentId":"5d0764ac-7e42-4ec8-a0d4-39fc53edccba","fromAid":"234","toAid":"222"} + ) + else: + return EndpointAgentBulkTransfer207ResponseItemsInner( + ) + """ + + def testEndpointAgentBulkTransfer207ResponseItemsInner(self): + """Test EndpointAgentBulkTransfer207ResponseItemsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_agent_bulk_transfer_request.py b/endpoint/agents_api/test/test_endpoint_agent_bulk_transfer_request.py new file mode 100644 index 00000000..fe5cd08b --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_agent_bulk_transfer_request.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_agent_bulk_transfer_request import EndpointAgentBulkTransferRequest + +class TestEndpointAgentBulkTransferRequest(unittest.TestCase): + """EndpointAgentBulkTransferRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentBulkTransferRequest: + """Test EndpointAgentBulkTransferRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentBulkTransferRequest` + """ + model = EndpointAgentBulkTransferRequest() + if include_optional: + return EndpointAgentBulkTransferRequest( + transfers = [ + {"agentId":"5d0764ac-7e42-4ec8-a0d4-39fc53edccba","fromAid":"234","toAid":"222"} + ] + ) + else: + return EndpointAgentBulkTransferRequest( + ) + """ + + def testEndpointAgentBulkTransferRequest(self): + """Test EndpointAgentBulkTransferRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_agent_get200_response.py b/endpoint/agents_api/test/test_endpoint_agent_get200_response.py new file mode 100644 index 00000000..7e8b5488 --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_agent_get200_response.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_agent_get200_response import EndpointAgentGet200Response + +class TestEndpointAgentGet200Response(unittest.TestCase): + """EndpointAgentGet200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentGet200Response: + """Test EndpointAgentGet200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentGet200Response` + """ + model = EndpointAgentGet200Response() + if include_optional: + return EndpointAgentGet200Response( + id = '5d0764ac-7e42-4ec8-a0d4-39fc53edccba', + aid = None, + name = 'Office Printer', + computer_name = 'DESKJET-123', + os_version = 'Version 10.15.2 (Build 19C57)', + platform = 'mac', + kernel_version = 'Darwin 19.2.0', + manufacturer = 'Apple, Inc.', + model = 'MacBookAir7,2', + last_seen = '2022-05-26T23:37:16Z', + status = 'enabled', + deleted = True, + version = '0.123.4', + created_at = '2022-05-26T23:37:16Z', + number_of_clients = 3, + public_ip = '88.45.2.123', + location = agents_api.models.endpoint_agent_location.EndpointAgentLocation( + latitude = 51.51279, + longitude = -0.09184, + location_name = 'London', ), + clients = [ + agents_api.models.endpoint_client.EndpointClient( + user_profile = agents_api.models.endpoint_user_profile.EndpointUserProfile( + user_name = 'joeblogs32', ), + browser_extensions = [ + agents_api.models.endpoint_browser_extension.EndpointBrowserExtension( + browser = 'edge', + profile = 'Profile 1', + version = '0.123.0', + enabled = True, + active = True, + error = '', ) + ], ) + ], + total_memory = '16384 MB', + agent_type = 'endpoint', + vpn_profiles = [ + agents_api.models.endpoint_vpn_profile.EndpointVpnProfile( + interface_name = '', + vpn_type = 'cisco-anyconnect', + vpn_gateway_address = '', + vpn_client_addresses = ["10.100.0.10"], + vpn_client_network_range = ["10.100.0.0/22"], ) + ], + network_interface_profiles = [ + agents_api.models.interface_profile.InterfaceProfile( + interface_name = 'en0', + address_profiles = [ + agents_api.models.address_profile.AddressProfile( + address_type = 'unique-local', + ip_address = '2001:db8:3333:4444:5555:6666:7777:8888', + prefix_length = 24, + gateway = '192.168.0.254', + router_hardware_address = '5c:b1:3e:46:1c:84', ) + ], + hardware_type = 'wireless', + ethernet_profile = agents_api.models.ethernet_profile.EthernetProfile( + link_speed = 56, ), + wireless_profile = agents_api.models.wireless_profile.WirelessProfile( + bssid = '00:11:22:aa:bb:cc', + ssid = 'GuestWiFi', + rssi = -36, + channel = 48, + phy_mode = '802.11ac', ), ) + ], + asn_details = agents_api.models.endpoint_asn_details.EndpointAsnDetails( + as_number = 5089, + as_name = 'Virgin Media Limited', ), + license_type = 'essentials', + tcp_driver_available = True, + npcap_version = '', + links = agents_api.models.self_links__links.SelfLinks__links( + self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return EndpointAgentGet200Response( + ) + """ + + def testEndpointAgentGet200Response(self): + """Test EndpointAgentGet200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_agent_location.py b/endpoint/agents_api/test/test_endpoint_agent_location.py new file mode 100644 index 00000000..ca787ec1 --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_agent_location.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_agent_location import EndpointAgentLocation + +class TestEndpointAgentLocation(unittest.TestCase): + """EndpointAgentLocation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentLocation: + """Test EndpointAgentLocation + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentLocation` + """ + model = EndpointAgentLocation() + if include_optional: + return EndpointAgentLocation( + latitude = 51.51279, + longitude = -0.09184, + location_name = 'London' + ) + else: + return EndpointAgentLocation( + ) + """ + + def testEndpointAgentLocation(self): + """Test EndpointAgentLocation""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_agent_update.py b/endpoint/agents_api/test/test_endpoint_agent_update.py new file mode 100644 index 00000000..2bd69eaa --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_agent_update.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_agent_update import EndpointAgentUpdate + +class TestEndpointAgentUpdate(unittest.TestCase): + """EndpointAgentUpdate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentUpdate: + """Test EndpointAgentUpdate + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentUpdate` + """ + model = EndpointAgentUpdate() + if include_optional: + return EndpointAgentUpdate( + name = 'Office Printer', + license_type = advantage + ) + else: + return EndpointAgentUpdate( + ) + """ + + def testEndpointAgentUpdate(self): + """Test EndpointAgentUpdate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_agents.py b/endpoint/agents_api/test/test_endpoint_agents.py new file mode 100644 index 00000000..75d5fed5 --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_agents.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_agents import EndpointAgents + +class TestEndpointAgents(unittest.TestCase): + """EndpointAgents unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgents: + """Test EndpointAgents + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgents` + """ + model = EndpointAgents() + if include_optional: + return EndpointAgents( + total_agents = 1, + agents = [ + null + ] + ) + else: + return EndpointAgents( + ) + """ + + def testEndpointAgents(self): + """Test EndpointAgents""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_agents_agents_inner.py b/endpoint/agents_api/test/test_endpoint_agents_agents_inner.py new file mode 100644 index 00000000..b1a414cd --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_agents_agents_inner.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_agents_agents_inner import EndpointAgentsAgentsInner + +class TestEndpointAgentsAgentsInner(unittest.TestCase): + """EndpointAgentsAgentsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentsAgentsInner: + """Test EndpointAgentsAgentsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentsAgentsInner` + """ + model = EndpointAgentsAgentsInner() + if include_optional: + return EndpointAgentsAgentsInner( + links = agents_api.models.self_links__links.SelfLinks__links( + self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + id = '5d0764ac-7e42-4ec8-a0d4-39fc53edccba', + aid = None, + name = 'Office Printer', + computer_name = 'DESKJET-123', + os_version = 'Version 10.15.2 (Build 19C57)', + platform = 'mac', + kernel_version = 'Darwin 19.2.0', + manufacturer = 'Apple, Inc.', + model = 'MacBookAir7,2', + last_seen = '2022-05-26T23:37:16Z', + status = 'enabled', + deleted = True, + version = '0.123.4', + created_at = '2022-05-26T23:37:16Z', + number_of_clients = 3, + public_ip = '88.45.2.123', + location = agents_api.models.endpoint_agent_location.EndpointAgentLocation( + latitude = 51.51279, + longitude = -0.09184, + location_name = 'London', ), + clients = [ + agents_api.models.endpoint_client.EndpointClient( + user_profile = agents_api.models.endpoint_user_profile.EndpointUserProfile( + user_name = 'joeblogs32', ), + browser_extensions = [ + agents_api.models.endpoint_browser_extension.EndpointBrowserExtension( + browser = 'edge', + profile = 'Profile 1', + version = '0.123.0', + enabled = True, + active = True, + error = '', ) + ], ) + ], + total_memory = '16384 MB', + agent_type = 'endpoint', + vpn_profiles = [ + agents_api.models.endpoint_vpn_profile.EndpointVpnProfile( + interface_name = '', + vpn_type = 'cisco-anyconnect', + vpn_gateway_address = '', + vpn_client_addresses = ["10.100.0.10"], + vpn_client_network_range = ["10.100.0.0/22"], ) + ], + network_interface_profiles = [ + agents_api.models.interface_profile.InterfaceProfile( + interface_name = 'en0', + address_profiles = [ + agents_api.models.address_profile.AddressProfile( + address_type = 'unique-local', + ip_address = '2001:db8:3333:4444:5555:6666:7777:8888', + prefix_length = 24, + gateway = '192.168.0.254', + router_hardware_address = '5c:b1:3e:46:1c:84', ) + ], + hardware_type = 'wireless', + ethernet_profile = agents_api.models.ethernet_profile.EthernetProfile( + link_speed = 56, ), + wireless_profile = agents_api.models.wireless_profile.WirelessProfile( + bssid = '00:11:22:aa:bb:cc', + ssid = 'GuestWiFi', + rssi = -36, + channel = 48, + phy_mode = '802.11ac', ), ) + ], + asn_details = agents_api.models.endpoint_asn_details.EndpointAsnDetails( + as_number = 5089, + as_name = 'Virgin Media Limited', ), + license_type = 'essentials', + tcp_driver_available = True, + npcap_version = '' + ) + else: + return EndpointAgentsAgentsInner( + ) + """ + + def testEndpointAgentsAgentsInner(self): + """Test EndpointAgentsAgentsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_agents_connection_string200_response.py b/endpoint/agents_api/test/test_endpoint_agents_connection_string200_response.py new file mode 100644 index 00000000..fe164209 --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_agents_connection_string200_response.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_agents_connection_string200_response import EndpointAgentsConnectionString200Response + +class TestEndpointAgentsConnectionString200Response(unittest.TestCase): + """EndpointAgentsConnectionString200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentsConnectionString200Response: + """Test EndpointAgentsConnectionString200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentsConnectionString200Response` + """ + model = EndpointAgentsConnectionString200Response() + if include_optional: + return EndpointAgentsConnectionString200Response( + links = agents_api.models.self_links__links.SelfLinks__links( + self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + connection_string = 'D2xZSLlqo64Xe2EnYisklA==' + ) + else: + return EndpointAgentsConnectionString200Response( + ) + """ + + def testEndpointAgentsConnectionString200Response(self): + """Test EndpointAgentsConnectionString200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_agents_list200_response.py b/endpoint/agents_api/test/test_endpoint_agents_list200_response.py new file mode 100644 index 00000000..46bebe99 --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_agents_list200_response.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_agents_list200_response import EndpointAgentsList200Response + +class TestEndpointAgentsList200Response(unittest.TestCase): + """EndpointAgentsList200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentsList200Response: + """Test EndpointAgentsList200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentsList200Response` + """ + model = EndpointAgentsList200Response() + if include_optional: + return EndpointAgentsList200Response( + total_agents = 1, + agents = [ + null + ], + links = agents_api.models.self_links__links.SelfLinks__links( + self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return EndpointAgentsList200Response( + ) + """ + + def testEndpointAgentsList200Response(self): + """Test EndpointAgentsList200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_agents_search200_response.py b/endpoint/agents_api/test/test_endpoint_agents_search200_response.py new file mode 100644 index 00000000..74528116 --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_agents_search200_response.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_agents_search200_response import EndpointAgentsSearch200Response + +class TestEndpointAgentsSearch200Response(unittest.TestCase): + """EndpointAgentsSearch200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentsSearch200Response: + """Test EndpointAgentsSearch200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentsSearch200Response` + """ + model = EndpointAgentsSearch200Response() + if include_optional: + return EndpointAgentsSearch200Response( + total_agents = 1, + agents = [ + null + ], + links = agents_api.models.pagination_next_link__links.PaginationNextLink__links( + next = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return EndpointAgentsSearch200Response( + ) + """ + + def testEndpointAgentsSearch200Response(self): + """Test EndpointAgentsSearch200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_asn_details.py b/endpoint/agents_api/test/test_endpoint_asn_details.py new file mode 100644 index 00000000..9e52e89c --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_asn_details.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_asn_details import EndpointAsnDetails + +class TestEndpointAsnDetails(unittest.TestCase): + """EndpointAsnDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAsnDetails: + """Test EndpointAsnDetails + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAsnDetails` + """ + model = EndpointAsnDetails() + if include_optional: + return EndpointAsnDetails( + as_number = 5089, + as_name = 'Virgin Media Limited' + ) + else: + return EndpointAsnDetails( + as_number = 5089, + ) + """ + + def testEndpointAsnDetails(self): + """Test EndpointAsnDetails""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_browser_extension.py b/endpoint/agents_api/test/test_endpoint_browser_extension.py new file mode 100644 index 00000000..a0d466e3 --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_browser_extension.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_browser_extension import EndpointBrowserExtension + +class TestEndpointBrowserExtension(unittest.TestCase): + """EndpointBrowserExtension unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointBrowserExtension: + """Test EndpointBrowserExtension + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointBrowserExtension` + """ + model = EndpointBrowserExtension() + if include_optional: + return EndpointBrowserExtension( + browser = 'edge', + profile = 'Profile 1', + version = '0.123.0', + enabled = True, + active = True, + error = '' + ) + else: + return EndpointBrowserExtension( + ) + """ + + def testEndpointBrowserExtension(self): + """Test EndpointBrowserExtension""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_client.py b/endpoint/agents_api/test/test_endpoint_client.py new file mode 100644 index 00000000..a4416053 --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_client.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_client import EndpointClient + +class TestEndpointClient(unittest.TestCase): + """EndpointClient unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointClient: + """Test EndpointClient + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointClient` + """ + model = EndpointClient() + if include_optional: + return EndpointClient( + user_profile = agents_api.models.endpoint_user_profile.EndpointUserProfile( + user_name = 'joeblogs32', ), + browser_extensions = [ + agents_api.models.endpoint_browser_extension.EndpointBrowserExtension( + browser = 'edge', + profile = 'Profile 1', + version = '0.123.0', + enabled = True, + active = True, + error = '', ) + ] + ) + else: + return EndpointClient( + ) + """ + + def testEndpointClient(self): + """Test EndpointClient""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_user_profile.py b/endpoint/agents_api/test/test_endpoint_user_profile.py new file mode 100644 index 00000000..81caa44e --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_user_profile.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_user_profile import EndpointUserProfile + +class TestEndpointUserProfile(unittest.TestCase): + """EndpointUserProfile unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointUserProfile: + """Test EndpointUserProfile + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointUserProfile` + """ + model = EndpointUserProfile() + if include_optional: + return EndpointUserProfile( + user_name = 'joeblogs32' + ) + else: + return EndpointUserProfile( + user_name = 'joeblogs32', + ) + """ + + def testEndpointUserProfile(self): + """Test EndpointUserProfile""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_endpoint_vpn_profile.py b/endpoint/agents_api/test/test_endpoint_vpn_profile.py new file mode 100644 index 00000000..2aa2716a --- /dev/null +++ b/endpoint/agents_api/test/test_endpoint_vpn_profile.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.endpoint_vpn_profile import EndpointVpnProfile + +class TestEndpointVpnProfile(unittest.TestCase): + """EndpointVpnProfile unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointVpnProfile: + """Test EndpointVpnProfile + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointVpnProfile` + """ + model = EndpointVpnProfile() + if include_optional: + return EndpointVpnProfile( + interface_name = '', + vpn_type = 'cisco-anyconnect', + vpn_gateway_address = '', + vpn_client_addresses = ["10.100.0.10"], + vpn_client_network_range = ["10.100.0.0/22"] + ) + else: + return EndpointVpnProfile( + vpn_client_addresses = ["10.100.0.10"], + vpn_client_network_range = ["10.100.0.0/22"], + ) + """ + + def testEndpointVpnProfile(self): + """Test EndpointVpnProfile""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_error.py b/endpoint/agents_api/test/test_error.py new file mode 100644 index 00000000..fb05306c --- /dev/null +++ b/endpoint/agents_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_ethernet_profile.py b/endpoint/agents_api/test/test_ethernet_profile.py new file mode 100644 index 00000000..270862ed --- /dev/null +++ b/endpoint/agents_api/test/test_ethernet_profile.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.ethernet_profile import EthernetProfile + +class TestEthernetProfile(unittest.TestCase): + """EthernetProfile unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EthernetProfile: + """Test EthernetProfile + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EthernetProfile` + """ + model = EthernetProfile() + if include_optional: + return EthernetProfile( + link_speed = 56 + ) + else: + return EthernetProfile( + ) + """ + + def testEthernetProfile(self): + """Test EthernetProfile""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_expand.py b/endpoint/agents_api/test/test_expand.py new file mode 100644 index 00000000..9d64b07f --- /dev/null +++ b/endpoint/agents_api/test/test_expand.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.expand import Expand + +class TestExpand(unittest.TestCase): + """Expand unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testExpand(self): + """Test Expand""" + # inst = Expand() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_interface_hardware_type.py b/endpoint/agents_api/test/test_interface_hardware_type.py new file mode 100644 index 00000000..ea2d37c5 --- /dev/null +++ b/endpoint/agents_api/test/test_interface_hardware_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.interface_hardware_type import InterfaceHardwareType + +class TestInterfaceHardwareType(unittest.TestCase): + """InterfaceHardwareType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInterfaceHardwareType(self): + """Test InterfaceHardwareType""" + # inst = InterfaceHardwareType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_interface_profile.py b/endpoint/agents_api/test/test_interface_profile.py new file mode 100644 index 00000000..94b1a907 --- /dev/null +++ b/endpoint/agents_api/test/test_interface_profile.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.interface_profile import InterfaceProfile + +class TestInterfaceProfile(unittest.TestCase): + """InterfaceProfile unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterfaceProfile: + """Test InterfaceProfile + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InterfaceProfile` + """ + model = InterfaceProfile() + if include_optional: + return InterfaceProfile( + interface_name = 'en0', + address_profiles = [ + agents_api.models.address_profile.AddressProfile( + address_type = 'unique-local', + ip_address = '2001:db8:3333:4444:5555:6666:7777:8888', + prefix_length = 24, + gateway = '192.168.0.254', + router_hardware_address = '5c:b1:3e:46:1c:84', ) + ], + hardware_type = 'wireless', + ethernet_profile = agents_api.models.ethernet_profile.EthernetProfile( + link_speed = 56, ), + wireless_profile = agents_api.models.wireless_profile.WirelessProfile( + bssid = '00:11:22:aa:bb:cc', + ssid = 'GuestWiFi', + rssi = -36, + channel = 48, + phy_mode = '802.11ac', ) + ) + else: + return InterfaceProfile( + ) + """ + + def testInterfaceProfile(self): + """Test InterfaceProfile""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_link.py b/endpoint/agents_api/test/test_link.py new file mode 100644 index 00000000..8aa424cf --- /dev/null +++ b/endpoint/agents_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_manage_agents_api.py b/endpoint/agents_api/test/test_manage_agents_api.py new file mode 100644 index 00000000..8e5f0e47 --- /dev/null +++ b/endpoint/agents_api/test/test_manage_agents_api.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest + +from agents_api.api.manage_agents_api import ManageAgentsApi + + +class TestManageAgentsApi(unittest.TestCase): + """ManageAgentsApi unit test stubs""" + + def setUp(self) -> None: + self.api = ManageAgentsApi() + + def tearDown(self) -> None: + pass + + def test_endpoint_agent_delete(self) -> None: + """Test case for endpoint_agent_delete + + Delete endpoint agent + """ + pass + + def test_endpoint_agent_disable(self) -> None: + """Test case for endpoint_agent_disable + + Disable endpoint agent + """ + pass + + def test_endpoint_agent_enable(self) -> None: + """Test case for endpoint_agent_enable + + Enable endpoint agent + """ + pass + + def test_endpoint_agent_get(self) -> None: + """Test case for endpoint_agent_get + + Retrieve endpoint agent + """ + pass + + def test_endpoint_agent_update(self) -> None: + """Test case for endpoint_agent_update + + Update endpoint agent + """ + pass + + def test_endpoint_agents_list(self) -> None: + """Test case for endpoint_agents_list + + List endpoint agents + """ + pass + + def test_endpoint_agents_search(self) -> None: + """Test case for endpoint_agents_search + + Filter endpoint agents + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_pagination_next_link.py b/endpoint/agents_api/test/test_pagination_next_link.py new file mode 100644 index 00000000..d10c3308 --- /dev/null +++ b/endpoint/agents_api/test/test_pagination_next_link.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.pagination_next_link import PaginationNextLink + +class TestPaginationNextLink(unittest.TestCase): + """PaginationNextLink unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationNextLink: + """Test PaginationNextLink + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationNextLink` + """ + model = PaginationNextLink() + if include_optional: + return PaginationNextLink( + links = agents_api.models.pagination_next_link__links.PaginationNextLink__links( + next = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return PaginationNextLink( + ) + """ + + def testPaginationNextLink(self): + """Test PaginationNextLink""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_pagination_next_link_links.py b/endpoint/agents_api/test/test_pagination_next_link_links.py new file mode 100644 index 00000000..872e6f65 --- /dev/null +++ b/endpoint/agents_api/test/test_pagination_next_link_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.pagination_next_link_links import PaginationNextLinkLinks + +class TestPaginationNextLinkLinks(unittest.TestCase): + """PaginationNextLinkLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationNextLinkLinks: + """Test PaginationNextLinkLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationNextLinkLinks` + """ + model = PaginationNextLinkLinks() + if include_optional: + return PaginationNextLinkLinks( + next = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return PaginationNextLinkLinks( + ) + """ + + def testPaginationNextLinkLinks(self): + """Test PaginationNextLinkLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_platform.py b/endpoint/agents_api/test/test_platform.py new file mode 100644 index 00000000..2ce83238 --- /dev/null +++ b/endpoint/agents_api/test/test_platform.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.platform import Platform + +class TestPlatform(unittest.TestCase): + """Platform unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPlatform(self): + """Test Platform""" + # inst = Platform() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_self_links.py b/endpoint/agents_api/test/test_self_links.py new file mode 100644 index 00000000..3159f93f --- /dev/null +++ b/endpoint/agents_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = agents_api.models.self_links__links.SelfLinks__links( + self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_self_links_links.py b/endpoint/agents_api/test/test_self_links_links.py new file mode 100644 index 00000000..022bcc76 --- /dev/null +++ b/endpoint/agents_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = agents_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_status.py b/endpoint/agents_api/test/test_status.py new file mode 100644 index 00000000..d385c737 --- /dev/null +++ b/endpoint/agents_api/test/test_status.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.status import Status + +class TestStatus(unittest.TestCase): + """Status unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStatus(self): + """Test Status""" + # inst = Status() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_transfer_api.py b/endpoint/agents_api/test/test_transfer_api.py new file mode 100644 index 00000000..cba30a5d --- /dev/null +++ b/endpoint/agents_api/test/test_transfer_api.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest + +from agents_api.api.transfer_api import TransferApi + + +class TestTransferApi(unittest.TestCase): + """TransferApi unit test stubs""" + + def setUp(self) -> None: + self.api = TransferApi() + + def tearDown(self) -> None: + pass + + def test_endpoint_agent_bulk_transfer(self) -> None: + """Test case for endpoint_agent_bulk_transfer + + Bulk transfer agents + """ + pass + + def test_endpoint_agent_single_transfer(self) -> None: + """Test case for endpoint_agent_single_transfer + + Transfer endpoint agent + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_unauthorized_error.py b/endpoint/agents_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..ee0e8d6a --- /dev/null +++ b/endpoint/agents_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_vpn_type.py b/endpoint/agents_api/test/test_vpn_type.py new file mode 100644 index 00000000..a97d1db9 --- /dev/null +++ b/endpoint/agents_api/test/test_vpn_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.vpn_type import VpnType + +class TestVpnType(unittest.TestCase): + """VpnType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVpnType(self): + """Test VpnType""" + # inst = VpnType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/test/test_wireless_profile.py b/endpoint/agents_api/test/test_wireless_profile.py new file mode 100644 index 00000000..3927ea33 --- /dev/null +++ b/endpoint/agents_api/test/test_wireless_profile.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. + + 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 unittest +import datetime + +from agents_api.models.wireless_profile import WirelessProfile + +class TestWirelessProfile(unittest.TestCase): + """WirelessProfile unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WirelessProfile: + """Test WirelessProfile + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WirelessProfile` + """ + model = WirelessProfile() + if include_optional: + return WirelessProfile( + bssid = '00:11:22:aa:bb:cc', + ssid = 'GuestWiFi', + rssi = -36, + channel = 48, + phy_mode = '802.11ac' + ) + else: + return WirelessProfile( + ) + """ + + def testWirelessProfile(self): + """Test WirelessProfile""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/agents_api/tox.ini b/endpoint/agents_api/tox.ini new file mode 100644 index 00000000..5d4caa48 --- /dev/null +++ b/endpoint/agents_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=agents_api diff --git a/endpoint/instant_tests_api/.github/workflows/python.yml b/endpoint/instant_tests_api/.github/workflows/python.yml new file mode 100644 index 00000000..c5de856c --- /dev/null +++ b/endpoint/instant_tests_api/.github/workflows/python.yml @@ -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: instant_tests_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 diff --git a/endpoint/instant_tests_api/.gitignore b/endpoint/instant_tests_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/endpoint/instant_tests_api/.gitignore @@ -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 diff --git a/endpoint/instant_tests_api/.gitlab-ci.yml b/endpoint/instant_tests_api/.gitlab-ci.yml new file mode 100644 index 00000000..735f324a --- /dev/null +++ b/endpoint/instant_tests_api/.gitlab-ci.yml @@ -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=instant_tests_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 diff --git a/endpoint/instant_tests_api/.openapi-generator-ignore b/endpoint/instant_tests_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/endpoint/instant_tests_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/endpoint/instant_tests_api/.openapi-generator/FILES b/endpoint/instant_tests_api/.openapi-generator/FILES new file mode 100644 index 00000000..4b822f1e --- /dev/null +++ b/endpoint/instant_tests_api/.openapi-generator/FILES @@ -0,0 +1,125 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/AccountGroupId.md +docs/AgentLabelsSelectorType.md +docs/AgentToServerInstantScheduledTestApi.md +docs/AllAgentsSelectorType.md +docs/EndpointAgentLabelsSelectorConfig.md +docs/EndpointAgentSelectorConfig.md +docs/EndpointAgentToServerInstantTest.md +docs/EndpointAgentToServerTest.md +docs/EndpointAgentToServerType.md +docs/EndpointAllAgentsSelectorConfig.md +docs/EndpointHttpServerBaseTest.md +docs/EndpointHttpServerInstantTest.md +docs/EndpointHttpServerTest.md +docs/EndpointHttpServerType.md +docs/EndpointInstantTest.md +docs/EndpointScheduledTestType.md +docs/EndpointSpecificAgentsSelectorConfig.md +docs/EndpointTest.md +docs/EndpointTestAgentSelectorType.md +docs/EndpointTestAid.md +docs/EndpointTestAuthType.md +docs/EndpointTestLinks.md +docs/EndpointTestLinksSelf.md +docs/EndpointTestLinksTestResults.md +docs/EndpointTestProtocol.md +docs/Error.md +docs/HttpServerInstantScheduledTestApi.md +docs/Link.md +docs/RunExistingTestApi.md +docs/SpecificAgentsSelectorType.md +docs/TestInterval.md +docs/TestProbeMode.md +docs/TestSslVersionId.md +docs/UnauthorizedError.md +git_push.sh +instant_tests_api/__init__.py +instant_tests_api/api/__init__.py +instant_tests_api/api/agent_to_server_instant_scheduled_test_api.py +instant_tests_api/api/http_server_instant_scheduled_test_api.py +instant_tests_api/api/run_existing_test_api.py +instant_tests_api/api_client.py +instant_tests_api/api_response.py +instant_tests_api/configuration.py +instant_tests_api/exceptions.py +instant_tests_api/models/__init__.py +instant_tests_api/models/account_group_id.py +instant_tests_api/models/agent_labels_selector_type.py +instant_tests_api/models/all_agents_selector_type.py +instant_tests_api/models/endpoint_agent_labels_selector_config.py +instant_tests_api/models/endpoint_agent_selector_config.py +instant_tests_api/models/endpoint_agent_to_server_instant_test.py +instant_tests_api/models/endpoint_agent_to_server_test.py +instant_tests_api/models/endpoint_agent_to_server_type.py +instant_tests_api/models/endpoint_all_agents_selector_config.py +instant_tests_api/models/endpoint_http_server_base_test.py +instant_tests_api/models/endpoint_http_server_instant_test.py +instant_tests_api/models/endpoint_http_server_test.py +instant_tests_api/models/endpoint_http_server_type.py +instant_tests_api/models/endpoint_instant_test.py +instant_tests_api/models/endpoint_scheduled_test_type.py +instant_tests_api/models/endpoint_specific_agents_selector_config.py +instant_tests_api/models/endpoint_test.py +instant_tests_api/models/endpoint_test_agent_selector_type.py +instant_tests_api/models/endpoint_test_aid.py +instant_tests_api/models/endpoint_test_auth_type.py +instant_tests_api/models/endpoint_test_links.py +instant_tests_api/models/endpoint_test_links_self.py +instant_tests_api/models/endpoint_test_links_test_results.py +instant_tests_api/models/endpoint_test_protocol.py +instant_tests_api/models/error.py +instant_tests_api/models/link.py +instant_tests_api/models/specific_agents_selector_type.py +instant_tests_api/models/test_interval.py +instant_tests_api/models/test_probe_mode.py +instant_tests_api/models/test_ssl_version_id.py +instant_tests_api/models/unauthorized_error.py +instant_tests_api/py.typed +instant_tests_api/rest.py +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_account_group_id.py +test/test_agent_labels_selector_type.py +test/test_agent_to_server_instant_scheduled_test_api.py +test/test_all_agents_selector_type.py +test/test_endpoint_agent_labels_selector_config.py +test/test_endpoint_agent_selector_config.py +test/test_endpoint_agent_to_server_instant_test.py +test/test_endpoint_agent_to_server_test.py +test/test_endpoint_agent_to_server_type.py +test/test_endpoint_all_agents_selector_config.py +test/test_endpoint_http_server_base_test.py +test/test_endpoint_http_server_instant_test.py +test/test_endpoint_http_server_test.py +test/test_endpoint_http_server_type.py +test/test_endpoint_instant_test.py +test/test_endpoint_scheduled_test_type.py +test/test_endpoint_specific_agents_selector_config.py +test/test_endpoint_test.py +test/test_endpoint_test_agent_selector_type.py +test/test_endpoint_test_aid.py +test/test_endpoint_test_auth_type.py +test/test_endpoint_test_links.py +test/test_endpoint_test_links_self.py +test/test_endpoint_test_links_test_results.py +test/test_endpoint_test_protocol.py +test/test_error.py +test/test_http_server_instant_scheduled_test_api.py +test/test_link.py +test/test_run_existing_test_api.py +test/test_specific_agents_selector_type.py +test/test_test_interval.py +test/test_test_probe_mode.py +test/test_test_ssl_version_id.py +test/test_unauthorized_error.py +tox.ini diff --git a/endpoint/instant_tests_api/.openapi-generator/VERSION b/endpoint/instant_tests_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/endpoint/instant_tests_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/endpoint/instant_tests_api/.travis.yml b/endpoint/instant_tests_api/.travis.yml new file mode 100644 index 00000000..41362426 --- /dev/null +++ b/endpoint/instant_tests_api/.travis.yml @@ -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=instant_tests_api diff --git a/endpoint/instant_tests_api/README.md b/endpoint/instant_tests_api/README.md new file mode 100644 index 00000000..16651cb5 --- /dev/null +++ b/endpoint/instant_tests_api/README.md @@ -0,0 +1,165 @@ +# instant-tests-api + +### Overview + +You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. + +The following applies to the Endpoint Instant Scheduled Tests API: + +* To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. + +* Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. +* It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. +The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + +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 instant_tests_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 instant_tests_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 instant_tests_api +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.AgentToServerInstantScheduledTestApi(api_client) + endpoint_agent_to_server_instant_test = instant_tests_api.EndpointAgentToServerInstantTest() # EndpointAgentToServerInstantTest | + 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: + # Run agent to server instant scheduled test + api_response = api_instance.post_agent_to_server_instant_test(endpoint_agent_to_server_instant_test, aid=aid) + print("The response of AgentToServerInstantScheduledTestApi->post_agent_to_server_instant_test:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling AgentToServerInstantScheduledTestApi->post_agent_to_server_instant_test: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AgentToServerInstantScheduledTestApi* | [**post_agent_to_server_instant_test**](docs/AgentToServerInstantScheduledTestApi.md#post_agent_to_server_instant_test) | **POST** /v7/endpoint/tests/scheduled-tests/agent-to-server/instant | Run agent to server instant scheduled test +*HttpServerInstantScheduledTestApi* | [**post_http_server_instant_test**](docs/HttpServerInstantScheduledTestApi.md#post_http_server_instant_test) | **POST** /v7/endpoint/tests/scheduled-tests/http-server/instant | Run http server instant scheduled test +*RunExistingTestApi* | [**post_endpoint_instant_run**](docs/RunExistingTestApi.md#post_endpoint_instant_run) | **POST** /v7/endpoint/tests/scheduled-tests/{testId}/run | Run endpoint instant scheduled test + + +## Documentation For Models + + - [AccountGroupId](docs/AccountGroupId.md) + - [AgentLabelsSelectorType](docs/AgentLabelsSelectorType.md) + - [AllAgentsSelectorType](docs/AllAgentsSelectorType.md) + - [EndpointAgentLabelsSelectorConfig](docs/EndpointAgentLabelsSelectorConfig.md) + - [EndpointAgentSelectorConfig](docs/EndpointAgentSelectorConfig.md) + - [EndpointAgentToServerInstantTest](docs/EndpointAgentToServerInstantTest.md) + - [EndpointAgentToServerTest](docs/EndpointAgentToServerTest.md) + - [EndpointAgentToServerType](docs/EndpointAgentToServerType.md) + - [EndpointAllAgentsSelectorConfig](docs/EndpointAllAgentsSelectorConfig.md) + - [EndpointHttpServerBaseTest](docs/EndpointHttpServerBaseTest.md) + - [EndpointHttpServerInstantTest](docs/EndpointHttpServerInstantTest.md) + - [EndpointHttpServerTest](docs/EndpointHttpServerTest.md) + - [EndpointHttpServerType](docs/EndpointHttpServerType.md) + - [EndpointInstantTest](docs/EndpointInstantTest.md) + - [EndpointScheduledTestType](docs/EndpointScheduledTestType.md) + - [EndpointSpecificAgentsSelectorConfig](docs/EndpointSpecificAgentsSelectorConfig.md) + - [EndpointTest](docs/EndpointTest.md) + - [EndpointTestAgentSelectorType](docs/EndpointTestAgentSelectorType.md) + - [EndpointTestAid](docs/EndpointTestAid.md) + - [EndpointTestAuthType](docs/EndpointTestAuthType.md) + - [EndpointTestLinks](docs/EndpointTestLinks.md) + - [EndpointTestLinksSelf](docs/EndpointTestLinksSelf.md) + - [EndpointTestLinksTestResults](docs/EndpointTestLinksTestResults.md) + - [EndpointTestProtocol](docs/EndpointTestProtocol.md) + - [Error](docs/Error.md) + - [Link](docs/Link.md) + - [SpecificAgentsSelectorType](docs/SpecificAgentsSelectorType.md) + - [TestInterval](docs/TestInterval.md) + - [TestProbeMode](docs/TestProbeMode.md) + - [TestSslVersionId](docs/TestSslVersionId.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/endpoint/instant_tests_api/docs/AccountGroupId.md b/endpoint/instant_tests_api/docs/AccountGroupId.md new file mode 100644 index 00000000..3e2b9169 --- /dev/null +++ b/endpoint/instant_tests_api/docs/AccountGroupId.md @@ -0,0 +1,28 @@ +# AccountGroupId + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] + +## Example + +```python +from instant_tests_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) + + diff --git a/endpoint/instant_tests_api/docs/AgentLabelsSelectorType.md b/endpoint/instant_tests_api/docs/AgentLabelsSelectorType.md new file mode 100644 index 00000000..aa3d0399 --- /dev/null +++ b/endpoint/instant_tests_api/docs/AgentLabelsSelectorType.md @@ -0,0 +1,10 @@ +# AgentLabelsSelectorType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/AgentToServerInstantScheduledTestApi.md b/endpoint/instant_tests_api/docs/AgentToServerInstantScheduledTestApi.md new file mode 100644 index 00000000..69832577 --- /dev/null +++ b/endpoint/instant_tests_api/docs/AgentToServerInstantScheduledTestApi.md @@ -0,0 +1,96 @@ +# instant_tests_api.AgentToServerInstantScheduledTestApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_agent_to_server_instant_test**](AgentToServerInstantScheduledTestApi.md#post_agent_to_server_instant_test) | **POST** /v7/endpoint/tests/scheduled-tests/agent-to-server/instant | Run agent to server instant scheduled test + + +# **post_agent_to_server_instant_test** +> EndpointAgentToServerTest post_agent_to_server_instant_test(endpoint_agent_to_server_instant_test, aid=aid) + +Run agent to server instant scheduled test + +Creates and runs a new endpoint agent to server instant scheduled test in ThousandEyes. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_api.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest +from instant_tests_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.AgentToServerInstantScheduledTestApi(api_client) + endpoint_agent_to_server_instant_test = instant_tests_api.EndpointAgentToServerInstantTest() # EndpointAgentToServerInstantTest | + 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: + # Run agent to server instant scheduled test + api_response = api_instance.post_agent_to_server_instant_test(endpoint_agent_to_server_instant_test, aid=aid) + print("The response of AgentToServerInstantScheduledTestApi->post_agent_to_server_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerInstantScheduledTestApi->post_agent_to_server_instant_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **endpoint_agent_to_server_instant_test** | [**EndpointAgentToServerInstantTest**](EndpointAgentToServerInstantTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointAgentToServerTest**](EndpointAgentToServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/instant_tests_api/docs/AllAgentsSelectorType.md b/endpoint/instant_tests_api/docs/AllAgentsSelectorType.md new file mode 100644 index 00000000..049c7eec --- /dev/null +++ b/endpoint/instant_tests_api/docs/AllAgentsSelectorType.md @@ -0,0 +1,10 @@ +# AllAgentsSelectorType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointAgentLabelsSelectorConfig.md b/endpoint/instant_tests_api/docs/EndpointAgentLabelsSelectorConfig.md new file mode 100644 index 00000000..2c562da2 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointAgentLabelsSelectorConfig.md @@ -0,0 +1,31 @@ +# EndpointAgentLabelsSelectorConfig + +Agent labels selection object. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**AgentLabelsSelectorType**](AgentLabelsSelectorType.md) | | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] + +## Example + +```python +from instant_tests_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentLabelsSelectorConfig from a JSON string +endpoint_agent_labels_selector_config_instance = EndpointAgentLabelsSelectorConfig.from_json(json) +# print the JSON string representation of the object +print EndpointAgentLabelsSelectorConfig.to_json() + +# convert the object into a dict +endpoint_agent_labels_selector_config_dict = endpoint_agent_labels_selector_config_instance.to_dict() +# create an instance of EndpointAgentLabelsSelectorConfig from a dict +endpoint_agent_labels_selector_config_form_dict = endpoint_agent_labels_selector_config.from_dict(endpoint_agent_labels_selector_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointAgentSelectorConfig.md b/endpoint/instant_tests_api/docs/EndpointAgentSelectorConfig.md new file mode 100644 index 00000000..0188ce48 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointAgentSelectorConfig.md @@ -0,0 +1,32 @@ +# EndpointAgentSelectorConfig + +Agents selection object based on agentSelectorType. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**SpecificAgentsSelectorType**](SpecificAgentsSelectorType.md) | | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] + +## Example + +```python +from instant_tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentSelectorConfig from a JSON string +endpoint_agent_selector_config_instance = EndpointAgentSelectorConfig.from_json(json) +# print the JSON string representation of the object +print EndpointAgentSelectorConfig.to_json() + +# convert the object into a dict +endpoint_agent_selector_config_dict = endpoint_agent_selector_config_instance.to_dict() +# create an instance of EndpointAgentSelectorConfig from a dict +endpoint_agent_selector_config_form_dict = endpoint_agent_selector_config.from_dict(endpoint_agent_selector_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointAgentToServerInstantTest.md b/endpoint/instant_tests_api/docs/EndpointAgentToServerInstantTest.md new file mode 100644 index 00000000..d3c1f60e --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointAgentToServerInstantTest.md @@ -0,0 +1,36 @@ +# EndpointAgentToServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**test_name** | **str** | Name of the test. | +**server_name** | **str** | A server address without a protocol or IP address. | + +## Example + +```python +from instant_tests_api.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentToServerInstantTest from a JSON string +endpoint_agent_to_server_instant_test_instance = EndpointAgentToServerInstantTest.from_json(json) +# print the JSON string representation of the object +print EndpointAgentToServerInstantTest.to_json() + +# convert the object into a dict +endpoint_agent_to_server_instant_test_dict = endpoint_agent_to_server_instant_test_instance.to_dict() +# create an instance of EndpointAgentToServerInstantTest from a dict +endpoint_agent_to_server_instant_test_form_dict = endpoint_agent_to_server_instant_test.from_dict(endpoint_agent_to_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointAgentToServerTest.md b/endpoint/instant_tests_api/docs/EndpointAgentToServerTest.md new file mode 100644 index 00000000..9ae110cd --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointAgentToServerTest.md @@ -0,0 +1,43 @@ +# EndpointAgentToServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**EndpointTestLinks**](EndpointTestLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**is_saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**server** | **str** | Target domain name or IP address. | [optional] +**test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] +**type** | [**EndpointAgentToServerType**](EndpointAgentToServerType.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentToServerTest from a JSON string +endpoint_agent_to_server_test_instance = EndpointAgentToServerTest.from_json(json) +# print the JSON string representation of the object +print EndpointAgentToServerTest.to_json() + +# convert the object into a dict +endpoint_agent_to_server_test_dict = endpoint_agent_to_server_test_instance.to_dict() +# create an instance of EndpointAgentToServerTest from a dict +endpoint_agent_to_server_test_form_dict = endpoint_agent_to_server_test.from_dict(endpoint_agent_to_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointAgentToServerType.md b/endpoint/instant_tests_api/docs/EndpointAgentToServerType.md new file mode 100644 index 00000000..a2abd7c3 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointAgentToServerType.md @@ -0,0 +1,11 @@ +# EndpointAgentToServerType + +Type of test being queried. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointAllAgentsSelectorConfig.md b/endpoint/instant_tests_api/docs/EndpointAllAgentsSelectorConfig.md new file mode 100644 index 00000000..c105be9f --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointAllAgentsSelectorConfig.md @@ -0,0 +1,30 @@ +# EndpointAllAgentsSelectorConfig + +Any agent selection object. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**AllAgentsSelectorType**](AllAgentsSelectorType.md) | | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] + +## Example + +```python +from instant_tests_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAllAgentsSelectorConfig from a JSON string +endpoint_all_agents_selector_config_instance = EndpointAllAgentsSelectorConfig.from_json(json) +# print the JSON string representation of the object +print EndpointAllAgentsSelectorConfig.to_json() + +# convert the object into a dict +endpoint_all_agents_selector_config_dict = endpoint_all_agents_selector_config_instance.to_dict() +# create an instance of EndpointAllAgentsSelectorConfig from a dict +endpoint_all_agents_selector_config_form_dict = endpoint_all_agents_selector_config.from_dict(endpoint_all_agents_selector_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointHttpServerBaseTest.md b/endpoint/instant_tests_api/docs/EndpointHttpServerBaseTest.md new file mode 100644 index 00000000..c17e85f8 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointHttpServerBaseTest.md @@ -0,0 +1,36 @@ +# EndpointHttpServerBaseTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] + +## Example + +```python +from instant_tests_api.models.endpoint_http_server_base_test import EndpointHttpServerBaseTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointHttpServerBaseTest from a JSON string +endpoint_http_server_base_test_instance = EndpointHttpServerBaseTest.from_json(json) +# print the JSON string representation of the object +print EndpointHttpServerBaseTest.to_json() + +# convert the object into a dict +endpoint_http_server_base_test_dict = endpoint_http_server_base_test_instance.to_dict() +# create an instance of EndpointHttpServerBaseTest from a dict +endpoint_http_server_base_test_form_dict = endpoint_http_server_base_test.from_dict(endpoint_http_server_base_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointHttpServerInstantTest.md b/endpoint/instant_tests_api/docs/EndpointHttpServerInstantTest.md new file mode 100644 index 00000000..b9a8da72 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointHttpServerInstantTest.md @@ -0,0 +1,46 @@ +# EndpointHttpServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**test_name** | **str** | Name of the test. | +**auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | +**target_response_time** | **int** | Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red). | +**password** | **str** | Password for Basic/NTLM authentication. | [optional] + +## Example + +```python +from instant_tests_api.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointHttpServerInstantTest from a JSON string +endpoint_http_server_instant_test_instance = EndpointHttpServerInstantTest.from_json(json) +# print the JSON string representation of the object +print EndpointHttpServerInstantTest.to_json() + +# convert the object into a dict +endpoint_http_server_instant_test_dict = endpoint_http_server_instant_test_instance.to_dict() +# create an instance of EndpointHttpServerInstantTest from a dict +endpoint_http_server_instant_test_form_dict = endpoint_http_server_instant_test.from_dict(endpoint_http_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointHttpServerTest.md b/endpoint/instant_tests_api/docs/EndpointHttpServerTest.md new file mode 100644 index 00000000..9df472ae --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointHttpServerTest.md @@ -0,0 +1,58 @@ +# EndpointHttpServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**EndpointTestLinks**](EndpointTestLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**is_saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**server** | **str** | Target domain name or IP address. | [optional] +**test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] +**type** | [**EndpointHttpServerType**](EndpointHttpServerType.md) | | [optional] +**auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] +**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] + +## Example + +```python +from instant_tests_api.models.endpoint_http_server_test import EndpointHttpServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointHttpServerTest from a JSON string +endpoint_http_server_test_instance = EndpointHttpServerTest.from_json(json) +# print the JSON string representation of the object +print EndpointHttpServerTest.to_json() + +# convert the object into a dict +endpoint_http_server_test_dict = endpoint_http_server_test_instance.to_dict() +# create an instance of EndpointHttpServerTest from a dict +endpoint_http_server_test_form_dict = endpoint_http_server_test.from_dict(endpoint_http_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointHttpServerType.md b/endpoint/instant_tests_api/docs/EndpointHttpServerType.md new file mode 100644 index 00000000..1cf13c82 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointHttpServerType.md @@ -0,0 +1,11 @@ +# EndpointHttpServerType + +Type of test being queried. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointInstantTest.md b/endpoint/instant_tests_api/docs/EndpointInstantTest.md new file mode 100644 index 00000000..f1465ca9 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointInstantTest.md @@ -0,0 +1,35 @@ +# EndpointInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**test_name** | **str** | Name of the test. | + +## Example + +```python +from instant_tests_api.models.endpoint_instant_test import EndpointInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointInstantTest from a JSON string +endpoint_instant_test_instance = EndpointInstantTest.from_json(json) +# print the JSON string representation of the object +print EndpointInstantTest.to_json() + +# convert the object into a dict +endpoint_instant_test_dict = endpoint_instant_test_instance.to_dict() +# create an instance of EndpointInstantTest from a dict +endpoint_instant_test_form_dict = endpoint_instant_test.from_dict(endpoint_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointScheduledTestType.md b/endpoint/instant_tests_api/docs/EndpointScheduledTestType.md new file mode 100644 index 00000000..4fb1f891 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointScheduledTestType.md @@ -0,0 +1,11 @@ +# EndpointScheduledTestType + +Type of test being queried. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointSpecificAgentsSelectorConfig.md b/endpoint/instant_tests_api/docs/EndpointSpecificAgentsSelectorConfig.md new file mode 100644 index 00000000..cd0d6788 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointSpecificAgentsSelectorConfig.md @@ -0,0 +1,31 @@ +# EndpointSpecificAgentsSelectorConfig + +Specific agents selection object. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**SpecificAgentsSelectorType**](SpecificAgentsSelectorType.md) | | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] + +## Example + +```python +from instant_tests_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointSpecificAgentsSelectorConfig from a JSON string +endpoint_specific_agents_selector_config_instance = EndpointSpecificAgentsSelectorConfig.from_json(json) +# print the JSON string representation of the object +print EndpointSpecificAgentsSelectorConfig.to_json() + +# convert the object into a dict +endpoint_specific_agents_selector_config_dict = endpoint_specific_agents_selector_config_instance.to_dict() +# create an instance of EndpointSpecificAgentsSelectorConfig from a dict +endpoint_specific_agents_selector_config_form_dict = endpoint_specific_agents_selector_config.from_dict(endpoint_specific_agents_selector_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointTest.md b/endpoint/instant_tests_api/docs/EndpointTest.md new file mode 100644 index 00000000..63377120 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointTest.md @@ -0,0 +1,43 @@ +# EndpointTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**EndpointTestLinks**](EndpointTestLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**is_saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**server** | **str** | Target domain name or IP address. | [optional] +**test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] +**type** | [**EndpointScheduledTestType**](EndpointScheduledTestType.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.endpoint_test import EndpointTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTest from a JSON string +endpoint_test_instance = EndpointTest.from_json(json) +# print the JSON string representation of the object +print EndpointTest.to_json() + +# convert the object into a dict +endpoint_test_dict = endpoint_test_instance.to_dict() +# create an instance of EndpointTest from a dict +endpoint_test_form_dict = endpoint_test.from_dict(endpoint_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointTestAgentSelectorType.md b/endpoint/instant_tests_api/docs/EndpointTestAgentSelectorType.md new file mode 100644 index 00000000..cac1391f --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointTestAgentSelectorType.md @@ -0,0 +1,11 @@ +# EndpointTestAgentSelectorType + +Retrieve either all available agents, a specific list of agents, or a list of agent labels. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointTestAid.md b/endpoint/instant_tests_api/docs/EndpointTestAid.md new file mode 100644 index 00000000..7e89bd0d --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointTestAid.md @@ -0,0 +1,28 @@ +# EndpointTestAid + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] + +## Example + +```python +from instant_tests_api.models.endpoint_test_aid import EndpointTestAid + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestAid from a JSON string +endpoint_test_aid_instance = EndpointTestAid.from_json(json) +# print the JSON string representation of the object +print EndpointTestAid.to_json() + +# convert the object into a dict +endpoint_test_aid_dict = endpoint_test_aid_instance.to_dict() +# create an instance of EndpointTestAid from a dict +endpoint_test_aid_form_dict = endpoint_test_aid.from_dict(endpoint_test_aid_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointTestAuthType.md b/endpoint/instant_tests_api/docs/EndpointTestAuthType.md new file mode 100644 index 00000000..979915c2 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointTestAuthType.md @@ -0,0 +1,11 @@ +# EndpointTestAuthType + +HTTP authentication type. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointTestLinks.md b/endpoint/instant_tests_api/docs/EndpointTestLinks.md new file mode 100644 index 00000000..ade77b57 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointTestLinks.md @@ -0,0 +1,30 @@ +# EndpointTestLinks + +A list of links that can be accessed to get more information. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**EndpointTestLinksSelf**](EndpointTestLinksSelf.md) | | [optional] +**test_results** | [**EndpointTestLinksTestResults**](EndpointTestLinksTestResults.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.endpoint_test_links import EndpointTestLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestLinks from a JSON string +endpoint_test_links_instance = EndpointTestLinks.from_json(json) +# print the JSON string representation of the object +print EndpointTestLinks.to_json() + +# convert the object into a dict +endpoint_test_links_dict = endpoint_test_links_instance.to_dict() +# create an instance of EndpointTestLinks from a dict +endpoint_test_links_form_dict = endpoint_test_links.from_dict(endpoint_test_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointTestLinksSelf.md b/endpoint/instant_tests_api/docs/EndpointTestLinksSelf.md new file mode 100644 index 00000000..89cbd87e --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointTestLinksSelf.md @@ -0,0 +1,35 @@ +# EndpointTestLinksSelf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from instant_tests_api.models.endpoint_test_links_self import EndpointTestLinksSelf + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestLinksSelf from a JSON string +endpoint_test_links_self_instance = EndpointTestLinksSelf.from_json(json) +# print the JSON string representation of the object +print EndpointTestLinksSelf.to_json() + +# convert the object into a dict +endpoint_test_links_self_dict = endpoint_test_links_self_instance.to_dict() +# create an instance of EndpointTestLinksSelf from a dict +endpoint_test_links_self_form_dict = endpoint_test_links_self.from_dict(endpoint_test_links_self_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointTestLinksTestResults.md b/endpoint/instant_tests_api/docs/EndpointTestLinksTestResults.md new file mode 100644 index 00000000..437f3828 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointTestLinksTestResults.md @@ -0,0 +1,35 @@ +# EndpointTestLinksTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from instant_tests_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestLinksTestResults from a JSON string +endpoint_test_links_test_results_instance = EndpointTestLinksTestResults.from_json(json) +# print the JSON string representation of the object +print EndpointTestLinksTestResults.to_json() + +# convert the object into a dict +endpoint_test_links_test_results_dict = endpoint_test_links_test_results_instance.to_dict() +# create an instance of EndpointTestLinksTestResults from a dict +endpoint_test_links_test_results_form_dict = endpoint_test_links_test_results.from_dict(endpoint_test_links_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/EndpointTestProtocol.md b/endpoint/instant_tests_api/docs/EndpointTestProtocol.md new file mode 100644 index 00000000..c1e002b3 --- /dev/null +++ b/endpoint/instant_tests_api/docs/EndpointTestProtocol.md @@ -0,0 +1,11 @@ +# EndpointTestProtocol + +Protocol used to perform the test. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/Error.md b/endpoint/instant_tests_api/docs/Error.md new file mode 100644 index 00000000..275b872e --- /dev/null +++ b/endpoint/instant_tests_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from instant_tests_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/HttpServerInstantScheduledTestApi.md b/endpoint/instant_tests_api/docs/HttpServerInstantScheduledTestApi.md new file mode 100644 index 00000000..b54af4c9 --- /dev/null +++ b/endpoint/instant_tests_api/docs/HttpServerInstantScheduledTestApi.md @@ -0,0 +1,96 @@ +# instant_tests_api.HttpServerInstantScheduledTestApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_http_server_instant_test**](HttpServerInstantScheduledTestApi.md#post_http_server_instant_test) | **POST** /v7/endpoint/tests/scheduled-tests/http-server/instant | Run http server instant scheduled test + + +# **post_http_server_instant_test** +> EndpointHttpServerTest post_http_server_instant_test(endpoint_http_server_instant_test, aid=aid) + +Run http server instant scheduled test + +Creates and runs a new endpoint http server instant scheduled test in ThousandEyes. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_api.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest +from instant_tests_api.models.endpoint_http_server_test import EndpointHttpServerTest +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.HttpServerInstantScheduledTestApi(api_client) + endpoint_http_server_instant_test = instant_tests_api.EndpointHttpServerInstantTest() # EndpointHttpServerInstantTest | + 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: + # Run http server instant scheduled test + api_response = api_instance.post_http_server_instant_test(endpoint_http_server_instant_test, aid=aid) + print("The response of HttpServerInstantScheduledTestApi->post_http_server_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HttpServerInstantScheduledTestApi->post_http_server_instant_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **endpoint_http_server_instant_test** | [**EndpointHttpServerInstantTest**](EndpointHttpServerInstantTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointHttpServerTest**](EndpointHttpServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/instant_tests_api/docs/Link.md b/endpoint/instant_tests_api/docs/Link.md new file mode 100644 index 00000000..f51d6f48 --- /dev/null +++ b/endpoint/instant_tests_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from instant_tests_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/RunExistingTestApi.md b/endpoint/instant_tests_api/docs/RunExistingTestApi.md new file mode 100644 index 00000000..9e33012d --- /dev/null +++ b/endpoint/instant_tests_api/docs/RunExistingTestApi.md @@ -0,0 +1,92 @@ +# instant_tests_api.RunExistingTestApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_endpoint_instant_run**](RunExistingTestApi.md#post_endpoint_instant_run) | **POST** /v7/endpoint/tests/scheduled-tests/{testId}/run | Run endpoint instant scheduled test + + +# **post_endpoint_instant_run** +> post_endpoint_instant_run(test_id, aid=aid) + +Run endpoint instant scheduled test + +Runs an existing endpoint instant scheduled test in ThousandEyes. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.RunExistingTestApi(api_client) + test_id = '765231567' # str | ID of the endpoint instant scheduled test to rerun + 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: + # Run endpoint instant scheduled test + api_instance.post_endpoint_instant_run(test_id, aid=aid) + except Exception as e: + print("Exception when calling RunExistingTestApi->post_endpoint_instant_run: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the endpoint instant scheduled test to rerun | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | +|-------------|-------------|------------------| +**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) + diff --git a/endpoint/instant_tests_api/docs/SpecificAgentsSelectorType.md b/endpoint/instant_tests_api/docs/SpecificAgentsSelectorType.md new file mode 100644 index 00000000..e0b875a0 --- /dev/null +++ b/endpoint/instant_tests_api/docs/SpecificAgentsSelectorType.md @@ -0,0 +1,10 @@ +# SpecificAgentsSelectorType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/TestInterval.md b/endpoint/instant_tests_api/docs/TestInterval.md new file mode 100644 index 00000000..e0e57d69 --- /dev/null +++ b/endpoint/instant_tests_api/docs/TestInterval.md @@ -0,0 +1,11 @@ +# TestInterval + +Interval between test runs in seconds. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/TestProbeMode.md b/endpoint/instant_tests_api/docs/TestProbeMode.md new file mode 100644 index 00000000..2e0ad614 --- /dev/null +++ b/endpoint/instant_tests_api/docs/TestProbeMode.md @@ -0,0 +1,11 @@ +# TestProbeMode + +Probe mode used by network test, only valid when the protocol is set to TCP. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/TestSslVersionId.md b/endpoint/instant_tests_api/docs/TestSslVersionId.md new file mode 100644 index 00000000..fb9ac0f8 --- /dev/null +++ b/endpoint/instant_tests_api/docs/TestSslVersionId.md @@ -0,0 +1,11 @@ +# TestSslVersionId + +SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/docs/UnauthorizedError.md b/endpoint/instant_tests_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..cf19fdd4 --- /dev/null +++ b/endpoint/instant_tests_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from instant_tests_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/instant_tests_api/git_push.sh b/endpoint/instant_tests_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/endpoint/instant_tests_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/endpoint/instant_tests_api/instant_tests_api/__init__.py b/endpoint/instant_tests_api/instant_tests_api/__init__.py new file mode 100644 index 00000000..35a17e33 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/__init__.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 instant_tests_api.api.agent_to_server_instant_scheduled_test_api import AgentToServerInstantScheduledTestApi +from instant_tests_api.api.http_server_instant_scheduled_test_api import HttpServerInstantScheduledTestApi +from instant_tests_api.api.run_existing_test_api import RunExistingTestApi + +# import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.api_client import ApiClient +from instant_tests_api.configuration import Configuration +from instant_tests_api.exceptions import OpenApiException +from instant_tests_api.exceptions import ApiTypeError +from instant_tests_api.exceptions import ApiValueError +from instant_tests_api.exceptions import ApiKeyError +from instant_tests_api.exceptions import ApiAttributeError +from instant_tests_api.exceptions import ApiException + +# import models into sdk package +from instant_tests_api.models.account_group_id import AccountGroupId +from instant_tests_api.models.agent_labels_selector_type import AgentLabelsSelectorType +from instant_tests_api.models.all_agents_selector_type import AllAgentsSelectorType +from instant_tests_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig +from instant_tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from instant_tests_api.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest +from instant_tests_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from instant_tests_api.models.endpoint_agent_to_server_type import EndpointAgentToServerType +from instant_tests_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig +from instant_tests_api.models.endpoint_http_server_base_test import EndpointHttpServerBaseTest +from instant_tests_api.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest +from instant_tests_api.models.endpoint_http_server_test import EndpointHttpServerTest +from instant_tests_api.models.endpoint_http_server_type import EndpointHttpServerType +from instant_tests_api.models.endpoint_instant_test import EndpointInstantTest +from instant_tests_api.models.endpoint_scheduled_test_type import EndpointScheduledTestType +from instant_tests_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig +from instant_tests_api.models.endpoint_test import EndpointTest +from instant_tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType +from instant_tests_api.models.endpoint_test_aid import EndpointTestAid +from instant_tests_api.models.endpoint_test_auth_type import EndpointTestAuthType +from instant_tests_api.models.endpoint_test_links import EndpointTestLinks +from instant_tests_api.models.endpoint_test_links_self import EndpointTestLinksSelf +from instant_tests_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults +from instant_tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from instant_tests_api.models.error import Error +from instant_tests_api.models.link import Link +from instant_tests_api.models.specific_agents_selector_type import SpecificAgentsSelectorType +from instant_tests_api.models.test_interval import TestInterval +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId +from instant_tests_api.models.unauthorized_error import UnauthorizedError diff --git a/endpoint/instant_tests_api/instant_tests_api/api/__init__.py b/endpoint/instant_tests_api/instant_tests_api/api/__init__.py new file mode 100644 index 00000000..4265f9c1 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/api/__init__.py @@ -0,0 +1,7 @@ +# flake8: noqa + +# import apis into api package +from instant_tests_api.api.agent_to_server_instant_scheduled_test_api import AgentToServerInstantScheduledTestApi +from instant_tests_api.api.http_server_instant_scheduled_test_api import HttpServerInstantScheduledTestApi +from instant_tests_api.api.run_existing_test_api import RunExistingTestApi + diff --git a/endpoint/instant_tests_api/instant_tests_api/api/agent_to_server_instant_scheduled_test_api.py b/endpoint/instant_tests_api/instant_tests_api/api/agent_to_server_instant_scheduled_test_api.py new file mode 100644 index 00000000..83f1c53f --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/api/agent_to_server_instant_scheduled_test_api.py @@ -0,0 +1,364 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 instant_tests_api.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest +from instant_tests_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest + +from instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class AgentToServerInstantScheduledTestApi: + """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 post_agent_to_server_instant_test( + self, + endpoint_agent_to_server_instant_test: EndpointAgentToServerInstantTest, + 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, + ) -> EndpointAgentToServerTest: + """Run agent to server instant scheduled test + + Creates and runs a new endpoint agent to server instant scheduled test in ThousandEyes. + + :param endpoint_agent_to_server_instant_test: (required) + :type endpoint_agent_to_server_instant_test: EndpointAgentToServerInstantTest + :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._post_agent_to_server_instant_test_serialize( + endpoint_agent_to_server_instant_test=endpoint_agent_to_server_instant_test, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointAgentToServerTest", + '400': "Error", + '401': "UnauthorizedError", + '403': "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 post_agent_to_server_instant_test_with_http_info( + self, + endpoint_agent_to_server_instant_test: EndpointAgentToServerInstantTest, + 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[EndpointAgentToServerTest]: + """Run agent to server instant scheduled test + + Creates and runs a new endpoint agent to server instant scheduled test in ThousandEyes. + + :param endpoint_agent_to_server_instant_test: (required) + :type endpoint_agent_to_server_instant_test: EndpointAgentToServerInstantTest + :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._post_agent_to_server_instant_test_serialize( + endpoint_agent_to_server_instant_test=endpoint_agent_to_server_instant_test, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointAgentToServerTest", + '400': "Error", + '401': "UnauthorizedError", + '403': "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 post_agent_to_server_instant_test_without_preload_content( + self, + endpoint_agent_to_server_instant_test: EndpointAgentToServerInstantTest, + 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: + """Run agent to server instant scheduled test + + Creates and runs a new endpoint agent to server instant scheduled test in ThousandEyes. + + :param endpoint_agent_to_server_instant_test: (required) + :type endpoint_agent_to_server_instant_test: EndpointAgentToServerInstantTest + :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._post_agent_to_server_instant_test_serialize( + endpoint_agent_to_server_instant_test=endpoint_agent_to_server_instant_test, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointAgentToServerTest", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _post_agent_to_server_instant_test_serialize( + self, + endpoint_agent_to_server_instant_test, + 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 + if endpoint_agent_to_server_instant_test is not None: + _body_params = endpoint_agent_to_server_instant_test + + + # 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/endpoint/tests/scheduled-tests/agent-to-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/api/http_server_instant_scheduled_test_api.py b/endpoint/instant_tests_api/instant_tests_api/api/http_server_instant_scheduled_test_api.py new file mode 100644 index 00000000..d059350f --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/api/http_server_instant_scheduled_test_api.py @@ -0,0 +1,364 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 instant_tests_api.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest +from instant_tests_api.models.endpoint_http_server_test import EndpointHttpServerTest + +from instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class HttpServerInstantScheduledTestApi: + """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 post_http_server_instant_test( + self, + endpoint_http_server_instant_test: EndpointHttpServerInstantTest, + 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, + ) -> EndpointHttpServerTest: + """Run http server instant scheduled test + + Creates and runs a new endpoint http server instant scheduled test in ThousandEyes. + + :param endpoint_http_server_instant_test: (required) + :type endpoint_http_server_instant_test: EndpointHttpServerInstantTest + :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._post_http_server_instant_test_serialize( + endpoint_http_server_instant_test=endpoint_http_server_instant_test, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointHttpServerTest", + '400': "Error", + '401': "UnauthorizedError", + '403': "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 post_http_server_instant_test_with_http_info( + self, + endpoint_http_server_instant_test: EndpointHttpServerInstantTest, + 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[EndpointHttpServerTest]: + """Run http server instant scheduled test + + Creates and runs a new endpoint http server instant scheduled test in ThousandEyes. + + :param endpoint_http_server_instant_test: (required) + :type endpoint_http_server_instant_test: EndpointHttpServerInstantTest + :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._post_http_server_instant_test_serialize( + endpoint_http_server_instant_test=endpoint_http_server_instant_test, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointHttpServerTest", + '400': "Error", + '401': "UnauthorizedError", + '403': "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 post_http_server_instant_test_without_preload_content( + self, + endpoint_http_server_instant_test: EndpointHttpServerInstantTest, + 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: + """Run http server instant scheduled test + + Creates and runs a new endpoint http server instant scheduled test in ThousandEyes. + + :param endpoint_http_server_instant_test: (required) + :type endpoint_http_server_instant_test: EndpointHttpServerInstantTest + :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._post_http_server_instant_test_serialize( + endpoint_http_server_instant_test=endpoint_http_server_instant_test, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointHttpServerTest", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _post_http_server_instant_test_serialize( + self, + endpoint_http_server_instant_test, + 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 + if endpoint_http_server_instant_test is not None: + _body_params = endpoint_http_server_instant_test + + + # 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/endpoint/tests/scheduled-tests/http-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/api/run_existing_test_api.py b/endpoint/instant_tests_api/instant_tests_api/api/run_existing_test_api.py new file mode 100644 index 00000000..eee92683 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/api/run_existing_test_api.py @@ -0,0 +1,325 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class RunExistingTestApi: + """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 post_endpoint_instant_run( + self, + test_id: Annotated[StrictStr, Field(description="ID of the endpoint instant scheduled test to rerun")], + 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, + ) -> None: + """Run endpoint instant scheduled test + + Runs an existing endpoint instant scheduled test in ThousandEyes. + + :param test_id: ID of the endpoint instant scheduled test to rerun (required) + :type test_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._post_endpoint_instant_run_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 post_endpoint_instant_run_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the endpoint instant scheduled test to rerun")], + 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[None]: + """Run endpoint instant scheduled test + + Runs an existing endpoint instant scheduled test in ThousandEyes. + + :param test_id: ID of the endpoint instant scheduled test to rerun (required) + :type test_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._post_endpoint_instant_run_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 post_endpoint_instant_run_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the endpoint instant scheduled test to rerun")], + 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: + """Run endpoint instant scheduled test + + Runs an existing endpoint instant scheduled test in ThousandEyes. + + :param test_id: ID of the endpoint instant scheduled test to rerun (required) + :type test_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._post_endpoint_instant_run_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _post_endpoint_instant_run_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v7/endpoint/tests/scheduled-tests/{testId}/run', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/api_client.py b/endpoint/instant_tests_api/instant_tests_api/api_client.py new file mode 100644 index 00000000..775d71cc --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 instant_tests_api.configuration import Configuration +from instant_tests_api.api_response import ApiResponse +import instant_tests_api.models +from instant_tests_api import rest +from instant_tests_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(instant_tests_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) diff --git a/endpoint/instant_tests_api/instant_tests_api/api_response.py b/endpoint/instant_tests_api/instant_tests_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/api_response.py @@ -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 + } diff --git a/endpoint/instant_tests_api/instant_tests_api/configuration.py b/endpoint/instant_tests_api/instant_tests_api/configuration.py new file mode 100644 index 00000000..217ef6c8 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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("instant_tests_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 diff --git a/endpoint/instant_tests_api/instant_tests_api/exceptions.py b/endpoint/instant_tests_api/instant_tests_api/exceptions.py new file mode 100644 index 00000000..1baf4e9d --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 diff --git a/endpoint/instant_tests_api/instant_tests_api/models/__init__.py b/endpoint/instant_tests_api/instant_tests_api/models/__init__.py new file mode 100644 index 00000000..cc5924ce --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/__init__.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +# flake8: noqa +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 instant_tests_api.models.account_group_id import AccountGroupId +from instant_tests_api.models.agent_labels_selector_type import AgentLabelsSelectorType +from instant_tests_api.models.all_agents_selector_type import AllAgentsSelectorType +from instant_tests_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig +from instant_tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from instant_tests_api.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest +from instant_tests_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from instant_tests_api.models.endpoint_agent_to_server_type import EndpointAgentToServerType +from instant_tests_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig +from instant_tests_api.models.endpoint_http_server_base_test import EndpointHttpServerBaseTest +from instant_tests_api.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest +from instant_tests_api.models.endpoint_http_server_test import EndpointHttpServerTest +from instant_tests_api.models.endpoint_http_server_type import EndpointHttpServerType +from instant_tests_api.models.endpoint_instant_test import EndpointInstantTest +from instant_tests_api.models.endpoint_scheduled_test_type import EndpointScheduledTestType +from instant_tests_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig +from instant_tests_api.models.endpoint_test import EndpointTest +from instant_tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType +from instant_tests_api.models.endpoint_test_aid import EndpointTestAid +from instant_tests_api.models.endpoint_test_auth_type import EndpointTestAuthType +from instant_tests_api.models.endpoint_test_links import EndpointTestLinks +from instant_tests_api.models.endpoint_test_links_self import EndpointTestLinksSelf +from instant_tests_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults +from instant_tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from instant_tests_api.models.error import Error +from instant_tests_api.models.link import Link +from instant_tests_api.models.specific_agents_selector_type import SpecificAgentsSelectorType +from instant_tests_api.models.test_interval import TestInterval +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId +from instant_tests_api.models.unauthorized_error import UnauthorizedError diff --git a/endpoint/instant_tests_api/instant_tests_api/models/account_group_id.py b/endpoint/instant_tests_api/instant_tests_api/models/account_group_id.py new file mode 100644 index 00000000..213b3c77 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/account_group_id.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/agent_labels_selector_type.py b/endpoint/instant_tests_api/instant_tests_api/models/agent_labels_selector_type.py new file mode 100644 index 00000000..654f7e4e --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/agent_labels_selector_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 AgentLabelsSelectorType(str, Enum): + """ + AgentLabelsSelectorType + """ + + """ + allowed enum values + """ + AGENT_MINUS_LABELS = 'agent-labels' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AgentLabelsSelectorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/all_agents_selector_type.py b/endpoint/instant_tests_api/instant_tests_api/models/all_agents_selector_type.py new file mode 100644 index 00000000..b4784e1a --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/all_agents_selector_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 AllAgentsSelectorType(str, Enum): + """ + AllAgentsSelectorType + """ + + """ + allowed enum values + """ + ALL_MINUS_AGENTS = 'all-agents' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AllAgentsSelectorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_labels_selector_config.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_labels_selector_config.py new file mode 100644 index 00000000..54829dfd --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_labels_selector_config.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 typing_extensions import Annotated +from instant_tests_api.models.agent_labels_selector_type import AgentLabelsSelectorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentLabelsSelectorConfig(BaseModel): + """ + Agent labels selection object. + """ # noqa: E501 + agent_selector_type: Optional[AgentLabelsSelectorType] = Field(default=None, alias="agentSelectorType") + max_machines: Optional[Annotated[int, Field(le=5000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") + __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines", "endpointAgentLabels"] + + 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 EndpointAgentLabelsSelectorConfig 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 EndpointAgentLabelsSelectorConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "maxMachines": obj.get("maxMachines"), + "endpointAgentLabels": obj.get("endpointAgentLabels") + }) + return _obj + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_selector_config.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_selector_config.py new file mode 100644 index 00000000..fe18d264 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_selector_config.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 instant_tests_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig +from instant_tests_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig +from instant_tests_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig +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 + +ENDPOINTAGENTSELECTORCONFIG_ONE_OF_SCHEMAS = ["EndpointAgentLabelsSelectorConfig", "EndpointAllAgentsSelectorConfig", "EndpointSpecificAgentsSelectorConfig"] + +class EndpointAgentSelectorConfig(BaseModel): + """ + Agents selection object based on agentSelectorType. + """ + # data type: EndpointAllAgentsSelectorConfig + oneof_schema_1_validator: Optional[EndpointAllAgentsSelectorConfig] = None + # data type: EndpointAgentLabelsSelectorConfig + oneof_schema_2_validator: Optional[EndpointAgentLabelsSelectorConfig] = None + # data type: EndpointSpecificAgentsSelectorConfig + oneof_schema_3_validator: Optional[EndpointSpecificAgentsSelectorConfig] = None + actual_instance: Optional[Union[EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig]] = None + one_of_schemas: List[str] = Literal["EndpointAgentLabelsSelectorConfig", "EndpointAllAgentsSelectorConfig", "EndpointSpecificAgentsSelectorConfig"] + + model_config = { + "validate_assignment": True + } + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = EndpointAgentSelectorConfig.model_construct() + error_messages = [] + match = 0 + # validate data type: EndpointAllAgentsSelectorConfig + if not isinstance(v, EndpointAllAgentsSelectorConfig): + error_messages.append(f"Error! Input type `{type(v)}` is not `EndpointAllAgentsSelectorConfig`") + else: + match += 1 + # validate data type: EndpointAgentLabelsSelectorConfig + if not isinstance(v, EndpointAgentLabelsSelectorConfig): + error_messages.append(f"Error! Input type `{type(v)}` is not `EndpointAgentLabelsSelectorConfig`") + else: + match += 1 + # validate data type: EndpointSpecificAgentsSelectorConfig + if not isinstance(v, EndpointSpecificAgentsSelectorConfig): + error_messages.append(f"Error! Input type `{type(v)}` is not `EndpointSpecificAgentsSelectorConfig`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in EndpointAgentSelectorConfig with oneOf schemas: EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in EndpointAgentSelectorConfig with oneOf schemas: EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig. 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 EndpointAllAgentsSelectorConfig + try: + instance.actual_instance = EndpointAllAgentsSelectorConfig.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EndpointAgentLabelsSelectorConfig + try: + instance.actual_instance = EndpointAgentLabelsSelectorConfig.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EndpointSpecificAgentsSelectorConfig + try: + instance.actual_instance = EndpointSpecificAgentsSelectorConfig.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 EndpointAgentSelectorConfig with oneOf schemas: EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into EndpointAgentSelectorConfig with oneOf schemas: EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig. 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()) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_to_server_instant_test.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_to_server_instant_test.py new file mode 100644 index 00000000..0607fb1c --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_to_server_instant_test.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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, StrictInt, StrictStr +from pydantic import Field +from typing_extensions import Annotated +from instant_tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentToServerInstantTest(BaseModel): + """ + EndpointAgentToServerInstantTest + """ # noqa: E501 + agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") + max_machines: Annotated[int, Field(le=5000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + test_name: StrictStr = Field(description="Name of the test.", alias="testName") + server_name: StrictStr = Field(description="A server address without a protocol or IP address.", alias="serverName") + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName", "serverName"] + + 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 EndpointAgentToServerInstantTest 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 EndpointAgentToServerInstantTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "agents": obj.get("agents"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "endpointAgentLabels": obj.get("endpointAgentLabels"), + "maxMachines": obj.get("maxMachines"), + "port": obj.get("port"), + "testName": obj.get("testName"), + "serverName": obj.get("serverName") + }) + return _obj + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_to_server_test.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_to_server_test.py new file mode 100644 index 00000000..42389ec0 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_to_server_test.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 instant_tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from instant_tests_api.models.endpoint_agent_to_server_type import EndpointAgentToServerType +from instant_tests_api.models.endpoint_test_aid import EndpointTestAid +from instant_tests_api.models.endpoint_test_links import EndpointTestLinks +from instant_tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from instant_tests_api.models.test_interval import TestInterval +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentToServerTest(BaseModel): + """ + EndpointAgentToServerTest + """ # noqa: E501 + links: Optional[EndpointTestLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + is_saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="isSavedEvent") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + protocol: Optional[EndpointTestProtocol] = None + server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + type: Optional[EndpointAgentToServerType] = None + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "aid", "testName", "type"] + + 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 EndpointAgentToServerTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_date", + "is_enabled", + "is_saved_event", + "modified_date", + "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() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgentToServerTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": EndpointTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "isSavedEvent": obj.get("isSavedEvent"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName"), + "type": obj.get("type") + }) + return _obj + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_to_server_type.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_to_server_type.py new file mode 100644 index 00000000..b57a88bc --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_agent_to_server_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 EndpointAgentToServerType(str, Enum): + """ + Type of test being queried. + """ + + """ + allowed enum values + """ + AGENT_MINUS_TO_MINUS_SERVER = 'agent-to-server' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointAgentToServerType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_all_agents_selector_config.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_all_agents_selector_config.py new file mode 100644 index 00000000..ed9567fc --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_all_agents_selector_config.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 typing_extensions import Annotated +from instant_tests_api.models.all_agents_selector_type import AllAgentsSelectorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAllAgentsSelectorConfig(BaseModel): + """ + Any agent selection object. + """ # noqa: E501 + agent_selector_type: Optional[AllAgentsSelectorType] = Field(default=None, alias="agentSelectorType") + max_machines: Optional[Annotated[int, Field(le=5000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines"] + + 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 EndpointAllAgentsSelectorConfig 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 EndpointAllAgentsSelectorConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "maxMachines": obj.get("maxMachines") + }) + return _obj + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_http_server_base_test.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_http_server_base_test.py new file mode 100644 index 00000000..b50a0326 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_http_server_base_test.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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, StrictInt, StrictStr +from pydantic import Field +from instant_tests_api.models.endpoint_test_auth_type import EndpointTestAuthType +from instant_tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointHttpServerBaseTest(BaseModel): + """ + EndpointHttpServerBaseTest + """ # noqa: E501 + auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + http_time_limit: Optional[StrictInt] = Field(default=None, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + protocol: Optional[EndpointTestProtocol] = None + url: Optional[StrictStr] = Field(default=None, description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + verify_certificate: Optional[StrictBool] = Field(default=None, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + __properties: ClassVar[List[str]] = ["authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate"] + + 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 EndpointHttpServerBaseTest 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 EndpointHttpServerBaseTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "authType": obj.get("authType"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "httpTimeLimit": obj.get("httpTimeLimit"), + "protocol": obj.get("protocol"), + "url": obj.get("url"), + "username": obj.get("username"), + "sslVersionId": obj.get("sslVersionId"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "verifyCertificate": obj.get("verifyCertificate") + }) + return _obj + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_http_server_instant_test.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_http_server_instant_test.py new file mode 100644 index 00000000..d6d7ec8f --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_http_server_instant_test.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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, StrictInt, StrictStr +from pydantic import Field +from typing_extensions import Annotated +from instant_tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType +from instant_tests_api.models.endpoint_test_auth_type import EndpointTestAuthType +from instant_tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointHttpServerInstantTest(BaseModel): + """ + EndpointHttpServerInstantTest + """ # noqa: E501 + agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") + max_machines: Annotated[int, Field(le=5000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + test_name: StrictStr = Field(description="Name of the test.", alias="testName") + auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + http_time_limit: StrictInt = Field(description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + protocol: Optional[EndpointTestProtocol] = None + url: StrictStr = Field(description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + ssl_version_id: TestSslVersionId = Field(alias="sslVersionId") + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + verify_certificate: StrictBool = Field(description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + target_response_time: StrictInt = Field(description="Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red).", alias="targetResponseTime") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName", "authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "targetResponseTime", "password"] + + 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 EndpointHttpServerInstantTest 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 EndpointHttpServerInstantTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "agents": obj.get("agents"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "endpointAgentLabels": obj.get("endpointAgentLabels"), + "maxMachines": obj.get("maxMachines"), + "port": obj.get("port"), + "testName": obj.get("testName"), + "authType": obj.get("authType"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "httpTimeLimit": obj.get("httpTimeLimit"), + "protocol": obj.get("protocol"), + "url": obj.get("url"), + "username": obj.get("username"), + "sslVersionId": obj.get("sslVersionId"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "verifyCertificate": obj.get("verifyCertificate"), + "targetResponseTime": obj.get("targetResponseTime"), + "password": obj.get("password") + }) + return _obj + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_http_server_test.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_http_server_test.py new file mode 100644 index 00000000..5607c9df --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_http_server_test.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 typing_extensions import Annotated +from instant_tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from instant_tests_api.models.endpoint_http_server_type import EndpointHttpServerType +from instant_tests_api.models.endpoint_test_aid import EndpointTestAid +from instant_tests_api.models.endpoint_test_auth_type import EndpointTestAuthType +from instant_tests_api.models.endpoint_test_links import EndpointTestLinks +from instant_tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from instant_tests_api.models.test_interval import TestInterval +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointHttpServerTest(BaseModel): + """ + EndpointHttpServerTest + """ # noqa: E501 + links: Optional[EndpointTestLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + is_saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="isSavedEvent") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + protocol: Optional[EndpointTestProtocol] = None + server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + type: Optional[EndpointHttpServerType] = None + auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") + http_time_limit: Optional[StrictInt] = Field(default=None, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + url: Optional[StrictStr] = Field(default=None, description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + verify_certificate: Optional[StrictBool] = Field(default=None, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "aid", "testName", "type", "authType", "httpTimeLimit", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "contentRegex", "followRedirects", "httpTargetTime", "httpVersion", "postBody", "sslVersion", "useNtlm", "userAgent"] + + 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 EndpointHttpServerTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_date", + "is_enabled", + "is_saved_event", + "modified_date", + "test_id", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointHttpServerTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": EndpointTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "isSavedEvent": obj.get("isSavedEvent"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName"), + "type": obj.get("type"), + "authType": obj.get("authType"), + "httpTimeLimit": obj.get("httpTimeLimit"), + "url": obj.get("url"), + "username": obj.get("username"), + "sslVersionId": obj.get("sslVersionId"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "verifyCertificate": obj.get("verifyCertificate"), + "contentRegex": obj.get("contentRegex"), + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "postBody": obj.get("postBody"), + "sslVersion": obj.get("sslVersion"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent") + }) + return _obj + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_http_server_type.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_http_server_type.py new file mode 100644 index 00000000..0533c284 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_http_server_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 EndpointHttpServerType(str, Enum): + """ + Type of test being queried. + """ + + """ + allowed enum values + """ + HTTP_MINUS_SERVER = 'http-server' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointHttpServerType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_instant_test.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_instant_test.py new file mode 100644 index 00000000..2feb718f --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_instant_test.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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, StrictInt, StrictStr +from pydantic import Field +from typing_extensions import Annotated +from instant_tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointInstantTest(BaseModel): + """ + EndpointInstantTest + """ # noqa: E501 + agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") + max_machines: Annotated[int, Field(le=5000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + test_name: StrictStr = Field(description="Name of the test.", alias="testName") + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName"] + + 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 EndpointInstantTest 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 EndpointInstantTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "agents": obj.get("agents"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "endpointAgentLabels": obj.get("endpointAgentLabels"), + "maxMachines": obj.get("maxMachines"), + "port": obj.get("port"), + "testName": obj.get("testName") + }) + return _obj + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_scheduled_test_type.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_scheduled_test_type.py new file mode 100644 index 00000000..332f64d6 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_scheduled_test_type.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 EndpointScheduledTestType(str, Enum): + """ + Type of test being queried. + """ + + """ + allowed enum values + """ + AGENT_MINUS_TO_MINUS_SERVER = 'agent-to-server' + HTTP_MINUS_SERVER = 'http-server' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointScheduledTestType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_specific_agents_selector_config.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_specific_agents_selector_config.py new file mode 100644 index 00000000..3013d543 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_specific_agents_selector_config.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 typing_extensions import Annotated +from instant_tests_api.models.specific_agents_selector_type import SpecificAgentsSelectorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointSpecificAgentsSelectorConfig(BaseModel): + """ + Specific agents selection object. + """ # noqa: E501 + agent_selector_type: Optional[SpecificAgentsSelectorType] = Field(default=None, alias="agentSelectorType") + max_machines: Optional[Annotated[int, Field(le=5000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") + __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines", "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 EndpointSpecificAgentsSelectorConfig 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 EndpointSpecificAgentsSelectorConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "maxMachines": obj.get("maxMachines"), + "agents": obj.get("agents") + }) + return _obj + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test.py new file mode 100644 index 00000000..9560318e --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 instant_tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from instant_tests_api.models.endpoint_scheduled_test_type import EndpointScheduledTestType +from instant_tests_api.models.endpoint_test_aid import EndpointTestAid +from instant_tests_api.models.endpoint_test_links import EndpointTestLinks +from instant_tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from instant_tests_api.models.test_interval import TestInterval +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointTest(BaseModel): + """ + EndpointTest + """ # noqa: E501 + links: Optional[EndpointTestLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + is_saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="isSavedEvent") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + protocol: Optional[EndpointTestProtocol] = None + server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + type: Optional[EndpointScheduledTestType] = None + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "aid", "testName", "type"] + + 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 EndpointTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_date", + "is_enabled", + "is_saved_event", + "modified_date", + "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() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": EndpointTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "isSavedEvent": obj.get("isSavedEvent"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName"), + "type": obj.get("type") + }) + return _obj + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_agent_selector_type.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_agent_selector_type.py new file mode 100644 index 00000000..6c14f343 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_agent_selector_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 EndpointTestAgentSelectorType(str, Enum): + """ + Retrieve either all available agents, a specific list of agents, or a list of agent labels. + """ + + """ + allowed enum values + """ + ALL_MINUS_AGENTS = 'all-agents' + SPECIFIC_MINUS_AGENTS = 'specific-agents' + AGENT_MINUS_LABELS = 'agent-labels' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointTestAgentSelectorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_aid.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_aid.py new file mode 100644 index 00000000..5f98ddb3 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_aid.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 EndpointTestAid(BaseModel): + """ + EndpointTestAid + """ # 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 EndpointTestAid 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 EndpointTestAid 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 + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_auth_type.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_auth_type.py new file mode 100644 index 00000000..ab48707c --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_auth_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 EndpointTestAuthType(str, Enum): + """ + HTTP authentication type. + """ + + """ + allowed enum values + """ + NONE = 'none' + BASIC = 'basic' + NTLM = 'ntlm' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointTestAuthType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_links.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_links.py new file mode 100644 index 00000000..3d1e16b9 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_links.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 instant_tests_api.models.endpoint_test_links_self import EndpointTestLinksSelf +from instant_tests_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointTestLinks(BaseModel): + """ + A list of links that can be accessed to get more information. + """ # noqa: E501 + var_self: Optional[EndpointTestLinksSelf] = Field(default=None, alias="self") + test_results: Optional[EndpointTestLinksTestResults] = 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 EndpointTestLinks 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 EndpointTestLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": EndpointTestLinksSelf.from_dict(obj.get("self")) if obj.get("self") is not None else None, + "testResults": EndpointTestLinksTestResults.from_dict(obj.get("testResults")) if obj.get("testResults") is not None else None + }) + return _obj + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_links_self.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_links_self.py new file mode 100644 index 00000000..9ec80aa8 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_links_self.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 EndpointTestLinksSelf(BaseModel): + """ + EndpointTestLinksSelf + """ # 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 EndpointTestLinksSelf 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 EndpointTestLinksSelf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "href": obj.get("href"), + "templated": obj.get("templated"), + "type": obj.get("type"), + "deprecation": obj.get("deprecation"), + "name": obj.get("name"), + "profile": obj.get("profile"), + "title": obj.get("title"), + "hreflang": obj.get("hreflang") + }) + return _obj + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_links_test_results.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_links_test_results.py new file mode 100644 index 00000000..7d45d895 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_links_test_results.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 instant_tests_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 + +ENDPOINTTESTLINKSTESTRESULTS_ONE_OF_SCHEMAS = ["Link", "List[Link]"] + +class EndpointTestLinksTestResults(BaseModel): + """ + EndpointTestLinksTestResults + """ + # 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 = EndpointTestLinksTestResults.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 EndpointTestLinksTestResults 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 EndpointTestLinksTestResults 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 EndpointTestLinksTestResults 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 EndpointTestLinksTestResults 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()) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_protocol.py b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_protocol.py new file mode 100644 index 00000000..1aa6bfca --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/endpoint_test_protocol.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 EndpointTestProtocol(str, Enum): + """ + Protocol used to perform the test. + """ + + """ + allowed enum values + """ + ICMP = 'icmp' + ICMP_MINUS_WITH_MINUS_TCP_MINUS_CONNECT = 'icmp-with-tcp-connect' + TCP = 'tcp' + PREFER_MINUS_TCP = 'prefer-tcp' + AST_MINUS_AUTODETECT = 'ast-autodetect' + AUTODETECT = 'autodetect' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointTestProtocol from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/error.py b/endpoint/instant_tests_api/instant_tests_api/models/error.py new file mode 100644 index 00000000..be49e574 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/link.py b/endpoint/instant_tests_api/instant_tests_api/models/link.py new file mode 100644 index 00000000..6018b8b6 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/specific_agents_selector_type.py b/endpoint/instant_tests_api/instant_tests_api/models/specific_agents_selector_type.py new file mode 100644 index 00000000..2362880f --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/specific_agents_selector_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 SpecificAgentsSelectorType(str, Enum): + """ + SpecificAgentsSelectorType + """ + + """ + allowed enum values + """ + SPECIFIC_MINUS_AGENTS = 'specific-agents' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SpecificAgentsSelectorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/test_interval.py b/endpoint/instant_tests_api/instant_tests_api/models/test_interval.py new file mode 100644 index 00000000..3f1d0b03 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/test_interval.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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)) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/test_probe_mode.py b/endpoint/instant_tests_api/instant_tests_api/models/test_probe_mode.py new file mode 100644 index 00000000..7a1ee76a --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/test_probe_mode.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 TestProbeMode(str, Enum): + """ + Probe mode used by network test, only valid when the protocol is set to TCP. + """ + + """ + allowed enum values + """ + AUTO = 'auto' + SACK = 'sack' + SYN = 'syn' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestProbeMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/test_ssl_version_id.py b/endpoint/instant_tests_api/instant_tests_api/models/test_ssl_version_id.py new file mode 100644 index 00000000..3f20dc07 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/test_ssl_version_id.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 TestSslVersionId(str, Enum): + """ + SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. + """ + + """ + allowed enum values + """ + ENUM_0 = '0' + ENUM_3 = '3' + ENUM_4 = '4' + ENUM_5 = '5' + ENUM_6 = '6' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestSslVersionId from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/instant_tests_api/instant_tests_api/models/unauthorized_error.py b/endpoint/instant_tests_api/instant_tests_api/models/unauthorized_error.py new file mode 100644 index 00000000..0f2da971 --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 + + diff --git a/endpoint/instant_tests_api/instant_tests_api/py.typed b/endpoint/instant_tests_api/instant_tests_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/endpoint/instant_tests_api/instant_tests_api/rest.py b/endpoint/instant_tests_api/instant_tests_api/rest.py new file mode 100644 index 00000000..9e0c3b1e --- /dev/null +++ b/endpoint/instant_tests_api/instant_tests_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 instant_tests_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) diff --git a/endpoint/instant_tests_api/pyproject.toml b/endpoint/instant_tests_api/pyproject.toml new file mode 100644 index 00000000..e4c7fc25 --- /dev/null +++ b/endpoint/instant_tests_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "instant_tests_api" +version = "1.0.0" +description = "Endpoint Instant Scheduled Tests API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Endpoint Instant Scheduled Tests API"] +include = ["instant_tests_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/endpoint/instant_tests_api/requirements.txt b/endpoint/instant_tests_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/endpoint/instant_tests_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/endpoint/instant_tests_api/setup.cfg b/endpoint/instant_tests_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/endpoint/instant_tests_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/endpoint/instant_tests_api/setup.py b/endpoint/instant_tests_api/setup.py new file mode 100644 index 00000000..a5bf6d88 --- /dev/null +++ b/endpoint/instant_tests_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "instant-tests-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Endpoint Instant Scheduled Tests API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Endpoint Instant Scheduled Tests API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + """, # noqa: E501 + package_data={"instant_tests_api": ["py.typed"]}, +) diff --git a/endpoint/instant_tests_api/test-requirements.txt b/endpoint/instant_tests_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/endpoint/instant_tests_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/endpoint/instant_tests_api/test/__init__.py b/endpoint/instant_tests_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/endpoint/instant_tests_api/test/test_account_group_id.py b/endpoint/instant_tests_api/test/test_account_group_id.py new file mode 100644 index 00000000..371df83b --- /dev/null +++ b/endpoint/instant_tests_api/test/test_account_group_id.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.account_group_id import AccountGroupId + +class TestAccountGroupId(unittest.TestCase): + """AccountGroupId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroupId: + """Test AccountGroupId + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroupId` + """ + model = AccountGroupId() + if include_optional: + return AccountGroupId( + aid = '11' + ) + else: + return AccountGroupId( + ) + """ + + def testAccountGroupId(self): + """Test AccountGroupId""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_agent_labels_selector_type.py b/endpoint/instant_tests_api/test/test_agent_labels_selector_type.py new file mode 100644 index 00000000..14f1ef83 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_agent_labels_selector_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.agent_labels_selector_type import AgentLabelsSelectorType + +class TestAgentLabelsSelectorType(unittest.TestCase): + """AgentLabelsSelectorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAgentLabelsSelectorType(self): + """Test AgentLabelsSelectorType""" + # inst = AgentLabelsSelectorType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_agent_to_server_instant_scheduled_test_api.py b/endpoint/instant_tests_api/test/test_agent_to_server_instant_scheduled_test_api.py new file mode 100644 index 00000000..833b2dad --- /dev/null +++ b/endpoint/instant_tests_api/test/test_agent_to_server_instant_scheduled_test_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest + +from instant_tests_api.api.agent_to_server_instant_scheduled_test_api import AgentToServerInstantScheduledTestApi + + +class TestAgentToServerInstantScheduledTestApi(unittest.TestCase): + """AgentToServerInstantScheduledTestApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentToServerInstantScheduledTestApi() + + def tearDown(self) -> None: + pass + + def test_post_agent_to_server_instant_test(self) -> None: + """Test case for post_agent_to_server_instant_test + + Run agent to server instant scheduled test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_all_agents_selector_type.py b/endpoint/instant_tests_api/test/test_all_agents_selector_type.py new file mode 100644 index 00000000..5effab6c --- /dev/null +++ b/endpoint/instant_tests_api/test/test_all_agents_selector_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.all_agents_selector_type import AllAgentsSelectorType + +class TestAllAgentsSelectorType(unittest.TestCase): + """AllAgentsSelectorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAllAgentsSelectorType(self): + """Test AllAgentsSelectorType""" + # inst = AllAgentsSelectorType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_agent_labels_selector_config.py b/endpoint/instant_tests_api/test/test_endpoint_agent_labels_selector_config.py new file mode 100644 index 00000000..2300f12b --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_agent_labels_selector_config.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig + +class TestEndpointAgentLabelsSelectorConfig(unittest.TestCase): + """EndpointAgentLabelsSelectorConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentLabelsSelectorConfig: + """Test EndpointAgentLabelsSelectorConfig + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentLabelsSelectorConfig` + """ + model = EndpointAgentLabelsSelectorConfig() + if include_optional: + return EndpointAgentLabelsSelectorConfig( + agent_selector_type = 'agent-labels', + max_machines = 10, + endpoint_agent_labels = ["567","214"] + ) + else: + return EndpointAgentLabelsSelectorConfig( + ) + """ + + def testEndpointAgentLabelsSelectorConfig(self): + """Test EndpointAgentLabelsSelectorConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_agent_selector_config.py b/endpoint/instant_tests_api/test/test_endpoint_agent_selector_config.py new file mode 100644 index 00000000..58b79aa7 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_agent_selector_config.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig + +class TestEndpointAgentSelectorConfig(unittest.TestCase): + """EndpointAgentSelectorConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentSelectorConfig: + """Test EndpointAgentSelectorConfig + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentSelectorConfig` + """ + model = EndpointAgentSelectorConfig() + if include_optional: + return EndpointAgentSelectorConfig( + agent_selector_type = 'specific-agents', + max_machines = 10, + endpoint_agent_labels = ["567","214"], + agents = ["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"] + ) + else: + return EndpointAgentSelectorConfig( + ) + """ + + def testEndpointAgentSelectorConfig(self): + """Test EndpointAgentSelectorConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_agent_to_server_instant_test.py b/endpoint/instant_tests_api/test/test_endpoint_agent_to_server_instant_test.py new file mode 100644 index 00000000..6da7bff8 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_agent_to_server_instant_test.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest + +class TestEndpointAgentToServerInstantTest(unittest.TestCase): + """EndpointAgentToServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentToServerInstantTest: + """Test EndpointAgentToServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentToServerInstantTest` + """ + model = EndpointAgentToServerInstantTest() + if include_optional: + return EndpointAgentToServerInstantTest( + agent_selector_type = 'all-agents', + agents = ["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"], + has_ping = True, + has_traceroute = True, + endpoint_agent_labels = ["567","214"], + max_machines = 10, + port = 80, + test_name = 'Test name', + server_name = 'www.example.com' + ) + else: + return EndpointAgentToServerInstantTest( + agent_selector_type = 'all-agents', + max_machines = 10, + test_name = 'Test name', + server_name = 'www.example.com', + ) + """ + + def testEndpointAgentToServerInstantTest(self): + """Test EndpointAgentToServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_agent_to_server_test.py b/endpoint/instant_tests_api/test/test_endpoint_agent_to_server_test.py new file mode 100644 index 00000000..f9f5a026 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_agent_to_server_test.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest + +class TestEndpointAgentToServerTest(unittest.TestCase): + """EndpointAgentToServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentToServerTest: + """Test EndpointAgentToServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentToServerTest` + """ + model = EndpointAgentToServerTest() + if include_optional: + return EndpointAgentToServerTest( + links = instant_tests_api.models.endpoint_test_links.EndpointTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}], ), + agent_selector_config = instant_tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = None, + test_name = 'Test name', + type = 'agent-to-server' + ) + else: + return EndpointAgentToServerTest( + ) + """ + + def testEndpointAgentToServerTest(self): + """Test EndpointAgentToServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_agent_to_server_type.py b/endpoint/instant_tests_api/test/test_endpoint_agent_to_server_type.py new file mode 100644 index 00000000..7a387ed9 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_agent_to_server_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_agent_to_server_type import EndpointAgentToServerType + +class TestEndpointAgentToServerType(unittest.TestCase): + """EndpointAgentToServerType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointAgentToServerType(self): + """Test EndpointAgentToServerType""" + # inst = EndpointAgentToServerType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_all_agents_selector_config.py b/endpoint/instant_tests_api/test/test_endpoint_all_agents_selector_config.py new file mode 100644 index 00000000..ef9725cf --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_all_agents_selector_config.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig + +class TestEndpointAllAgentsSelectorConfig(unittest.TestCase): + """EndpointAllAgentsSelectorConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAllAgentsSelectorConfig: + """Test EndpointAllAgentsSelectorConfig + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAllAgentsSelectorConfig` + """ + model = EndpointAllAgentsSelectorConfig() + if include_optional: + return EndpointAllAgentsSelectorConfig( + agent_selector_type = 'all-agents', + max_machines = 10 + ) + else: + return EndpointAllAgentsSelectorConfig( + ) + """ + + def testEndpointAllAgentsSelectorConfig(self): + """Test EndpointAllAgentsSelectorConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_http_server_base_test.py b/endpoint/instant_tests_api/test/test_endpoint_http_server_base_test.py new file mode 100644 index 00000000..9444eb49 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_http_server_base_test.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_http_server_base_test import EndpointHttpServerBaseTest + +class TestEndpointHttpServerBaseTest(unittest.TestCase): + """EndpointHttpServerBaseTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointHttpServerBaseTest: + """Test EndpointHttpServerBaseTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointHttpServerBaseTest` + """ + model = EndpointHttpServerBaseTest() + if include_optional: + return EndpointHttpServerBaseTest( + auth_type = 'none', + has_path_trace_in_session = True, + http_time_limit = 5000, + protocol = 'icmp', + url = 'www.example.com', + username = 'username', + ssl_version_id = '0', + tcp_probe_mode = 'auto', + verify_certificate = False + ) + else: + return EndpointHttpServerBaseTest( + ) + """ + + def testEndpointHttpServerBaseTest(self): + """Test EndpointHttpServerBaseTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_http_server_instant_test.py b/endpoint/instant_tests_api/test/test_endpoint_http_server_instant_test.py new file mode 100644 index 00000000..ea74c40b --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_http_server_instant_test.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest + +class TestEndpointHttpServerInstantTest(unittest.TestCase): + """EndpointHttpServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointHttpServerInstantTest: + """Test EndpointHttpServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointHttpServerInstantTest` + """ + model = EndpointHttpServerInstantTest() + if include_optional: + return EndpointHttpServerInstantTest( + agent_selector_type = 'all-agents', + agents = [0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1, 66eec0f1-72b4-4755-aa83-3aed61d17f3c], + has_ping = True, + has_traceroute = True, + endpoint_agent_labels = [567, 214], + max_machines = 10, + port = 80, + test_name = 'Test name', + auth_type = 'none', + has_path_trace_in_session = True, + http_time_limit = 5000, + protocol = 'icmp', + url = 'www.example.com', + username = 'username', + ssl_version_id = '0', + tcp_probe_mode = 'auto', + verify_certificate = False, + target_response_time = 1000, + password = 'password' + ) + else: + return EndpointHttpServerInstantTest( + agent_selector_type = 'all-agents', + max_machines = 10, + test_name = 'Test name', + http_time_limit = 5000, + url = 'www.example.com', + ssl_version_id = '0', + verify_certificate = False, + target_response_time = 1000, + ) + """ + + def testEndpointHttpServerInstantTest(self): + """Test EndpointHttpServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_http_server_test.py b/endpoint/instant_tests_api/test/test_endpoint_http_server_test.py new file mode 100644 index 00000000..1f201618 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_http_server_test.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_http_server_test import EndpointHttpServerTest + +class TestEndpointHttpServerTest(unittest.TestCase): + """EndpointHttpServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointHttpServerTest: + """Test EndpointHttpServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointHttpServerTest` + """ + model = EndpointHttpServerTest() + if include_optional: + return EndpointHttpServerTest( + links = instant_tests_api.models.endpoint_test_links.EndpointTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}], ), + agent_selector_config = instant_tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = None, + test_name = 'Test name', + type = 'http-server', + auth_type = 'none', + http_time_limit = 5000, + url = 'www.example.com', + username = 'username', + ssl_version_id = '0', + tcp_probe_mode = 'auto', + verify_certificate = False, + content_regex = '(regex)+', + follow_redirects = True, + http_target_time = 100, + http_version = 1, + post_body = 'body', + ssl_version = 'Auto', + use_ntlm = False, + user_agent = 'curl' + ) + else: + return EndpointHttpServerTest( + ) + """ + + def testEndpointHttpServerTest(self): + """Test EndpointHttpServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_http_server_type.py b/endpoint/instant_tests_api/test/test_endpoint_http_server_type.py new file mode 100644 index 00000000..f35e2233 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_http_server_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_http_server_type import EndpointHttpServerType + +class TestEndpointHttpServerType(unittest.TestCase): + """EndpointHttpServerType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointHttpServerType(self): + """Test EndpointHttpServerType""" + # inst = EndpointHttpServerType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_instant_test.py b/endpoint/instant_tests_api/test/test_endpoint_instant_test.py new file mode 100644 index 00000000..c99e4a99 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_instant_test.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_instant_test import EndpointInstantTest + +class TestEndpointInstantTest(unittest.TestCase): + """EndpointInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointInstantTest: + """Test EndpointInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointInstantTest` + """ + model = EndpointInstantTest() + if include_optional: + return EndpointInstantTest( + agent_selector_type = 'all-agents', + agents = ["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"], + has_ping = True, + has_traceroute = True, + endpoint_agent_labels = ["567","214"], + max_machines = 10, + port = 80, + test_name = 'Test name' + ) + else: + return EndpointInstantTest( + agent_selector_type = 'all-agents', + max_machines = 10, + test_name = 'Test name', + ) + """ + + def testEndpointInstantTest(self): + """Test EndpointInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_scheduled_test_type.py b/endpoint/instant_tests_api/test/test_endpoint_scheduled_test_type.py new file mode 100644 index 00000000..1c2d1fe4 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_scheduled_test_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_scheduled_test_type import EndpointScheduledTestType + +class TestEndpointScheduledTestType(unittest.TestCase): + """EndpointScheduledTestType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointScheduledTestType(self): + """Test EndpointScheduledTestType""" + # inst = EndpointScheduledTestType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_specific_agents_selector_config.py b/endpoint/instant_tests_api/test/test_endpoint_specific_agents_selector_config.py new file mode 100644 index 00000000..1389dfa9 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_specific_agents_selector_config.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig + +class TestEndpointSpecificAgentsSelectorConfig(unittest.TestCase): + """EndpointSpecificAgentsSelectorConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointSpecificAgentsSelectorConfig: + """Test EndpointSpecificAgentsSelectorConfig + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointSpecificAgentsSelectorConfig` + """ + model = EndpointSpecificAgentsSelectorConfig() + if include_optional: + return EndpointSpecificAgentsSelectorConfig( + agent_selector_type = 'specific-agents', + max_machines = 10, + agents = ["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"] + ) + else: + return EndpointSpecificAgentsSelectorConfig( + ) + """ + + def testEndpointSpecificAgentsSelectorConfig(self): + """Test EndpointSpecificAgentsSelectorConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_test.py b/endpoint/instant_tests_api/test/test_endpoint_test.py new file mode 100644 index 00000000..42fa339e --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_test.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_test import EndpointTest + +class TestEndpointTest(unittest.TestCase): + """EndpointTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTest: + """Test EndpointTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTest` + """ + model = EndpointTest() + if include_optional: + return EndpointTest( + links = instant_tests_api.models.endpoint_test_links.EndpointTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}], ), + agent_selector_config = instant_tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = None, + test_name = 'Test name', + type = 'agent-to-server' + ) + else: + return EndpointTest( + ) + """ + + def testEndpointTest(self): + """Test EndpointTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_test_agent_selector_type.py b/endpoint/instant_tests_api/test/test_endpoint_test_agent_selector_type.py new file mode 100644 index 00000000..c55ced2f --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_test_agent_selector_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType + +class TestEndpointTestAgentSelectorType(unittest.TestCase): + """EndpointTestAgentSelectorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointTestAgentSelectorType(self): + """Test EndpointTestAgentSelectorType""" + # inst = EndpointTestAgentSelectorType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_test_aid.py b/endpoint/instant_tests_api/test/test_endpoint_test_aid.py new file mode 100644 index 00000000..b9e937bb --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_test_aid.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_test_aid import EndpointTestAid + +class TestEndpointTestAid(unittest.TestCase): + """EndpointTestAid unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTestAid: + """Test EndpointTestAid + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTestAid` + """ + model = EndpointTestAid() + if include_optional: + return EndpointTestAid( + aid = '11' + ) + else: + return EndpointTestAid( + ) + """ + + def testEndpointTestAid(self): + """Test EndpointTestAid""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_test_auth_type.py b/endpoint/instant_tests_api/test/test_endpoint_test_auth_type.py new file mode 100644 index 00000000..5f19881a --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_test_auth_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_test_auth_type import EndpointTestAuthType + +class TestEndpointTestAuthType(unittest.TestCase): + """EndpointTestAuthType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointTestAuthType(self): + """Test EndpointTestAuthType""" + # inst = EndpointTestAuthType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_test_links.py b/endpoint/instant_tests_api/test/test_endpoint_test_links.py new file mode 100644 index 00000000..fe3d8056 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_test_links.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_test_links import EndpointTestLinks + +class TestEndpointTestLinks(unittest.TestCase): + """EndpointTestLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTestLinks: + """Test EndpointTestLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTestLinks` + """ + model = EndpointTestLinks() + if include_optional: + return EndpointTestLinks( + var_self = None, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}] + ) + else: + return EndpointTestLinks( + ) + """ + + def testEndpointTestLinks(self): + """Test EndpointTestLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_test_links_self.py b/endpoint/instant_tests_api/test/test_endpoint_test_links_self.py new file mode 100644 index 00000000..344a2999 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_test_links_self.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_test_links_self import EndpointTestLinksSelf + +class TestEndpointTestLinksSelf(unittest.TestCase): + """EndpointTestLinksSelf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTestLinksSelf: + """Test EndpointTestLinksSelf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTestLinksSelf` + """ + model = EndpointTestLinksSelf() + if include_optional: + return EndpointTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return EndpointTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testEndpointTestLinksSelf(self): + """Test EndpointTestLinksSelf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_test_links_test_results.py b/endpoint/instant_tests_api/test/test_endpoint_test_links_test_results.py new file mode 100644 index 00000000..e3b5a415 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_test_links_test_results.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults + +class TestEndpointTestLinksTestResults(unittest.TestCase): + """EndpointTestLinksTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTestLinksTestResults: + """Test EndpointTestLinksTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTestLinksTestResults` + """ + model = EndpointTestLinksTestResults() + if include_optional: + return EndpointTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return EndpointTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testEndpointTestLinksTestResults(self): + """Test EndpointTestLinksTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_endpoint_test_protocol.py b/endpoint/instant_tests_api/test/test_endpoint_test_protocol.py new file mode 100644 index 00000000..639c1d0f --- /dev/null +++ b/endpoint/instant_tests_api/test/test_endpoint_test_protocol.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.endpoint_test_protocol import EndpointTestProtocol + +class TestEndpointTestProtocol(unittest.TestCase): + """EndpointTestProtocol unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointTestProtocol(self): + """Test EndpointTestProtocol""" + # inst = EndpointTestProtocol() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_error.py b/endpoint/instant_tests_api/test/test_error.py new file mode 100644 index 00000000..2010805d --- /dev/null +++ b/endpoint/instant_tests_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_http_server_instant_scheduled_test_api.py b/endpoint/instant_tests_api/test/test_http_server_instant_scheduled_test_api.py new file mode 100644 index 00000000..bce30f5b --- /dev/null +++ b/endpoint/instant_tests_api/test/test_http_server_instant_scheduled_test_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest + +from instant_tests_api.api.http_server_instant_scheduled_test_api import HttpServerInstantScheduledTestApi + + +class TestHttpServerInstantScheduledTestApi(unittest.TestCase): + """HttpServerInstantScheduledTestApi unit test stubs""" + + def setUp(self) -> None: + self.api = HttpServerInstantScheduledTestApi() + + def tearDown(self) -> None: + pass + + def test_post_http_server_instant_test(self) -> None: + """Test case for post_http_server_instant_test + + Run http server instant scheduled test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_link.py b/endpoint/instant_tests_api/test/test_link.py new file mode 100644 index 00000000..156cd102 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_run_existing_test_api.py b/endpoint/instant_tests_api/test/test_run_existing_test_api.py new file mode 100644 index 00000000..7649e343 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_run_existing_test_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest + +from instant_tests_api.api.run_existing_test_api import RunExistingTestApi + + +class TestRunExistingTestApi(unittest.TestCase): + """RunExistingTestApi unit test stubs""" + + def setUp(self) -> None: + self.api = RunExistingTestApi() + + def tearDown(self) -> None: + pass + + def test_post_endpoint_instant_run(self) -> None: + """Test case for post_endpoint_instant_run + + Run endpoint instant scheduled test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_specific_agents_selector_type.py b/endpoint/instant_tests_api/test/test_specific_agents_selector_type.py new file mode 100644 index 00000000..0887047e --- /dev/null +++ b/endpoint/instant_tests_api/test/test_specific_agents_selector_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.specific_agents_selector_type import SpecificAgentsSelectorType + +class TestSpecificAgentsSelectorType(unittest.TestCase): + """SpecificAgentsSelectorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSpecificAgentsSelectorType(self): + """Test SpecificAgentsSelectorType""" + # inst = SpecificAgentsSelectorType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_test_interval.py b/endpoint/instant_tests_api/test/test_test_interval.py new file mode 100644 index 00000000..9b1c9227 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_test_interval.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.test_interval import TestInterval + +class TestTestInterval(unittest.TestCase): + """TestInterval unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestInterval(self): + """Test TestInterval""" + # inst = TestInterval() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_test_probe_mode.py b/endpoint/instant_tests_api/test/test_test_probe_mode.py new file mode 100644 index 00000000..8f2d6165 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_test_probe_mode.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.test_probe_mode import TestProbeMode + +class TestTestProbeMode(unittest.TestCase): + """TestProbeMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestProbeMode(self): + """Test TestProbeMode""" + # inst = TestProbeMode() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_test_ssl_version_id.py b/endpoint/instant_tests_api/test/test_test_ssl_version_id.py new file mode 100644 index 00000000..442ab1fd --- /dev/null +++ b/endpoint/instant_tests_api/test/test_test_ssl_version_id.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId + +class TestTestSslVersionId(unittest.TestCase): + """TestSslVersionId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestSslVersionId(self): + """Test TestSslVersionId""" + # inst = TestSslVersionId() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/test/test_unauthorized_error.py b/endpoint/instant_tests_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..488939a2 --- /dev/null +++ b/endpoint/instant_tests_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + ### Overview You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + 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 unittest +import datetime + +from instant_tests_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/instant_tests_api/tox.ini b/endpoint/instant_tests_api/tox.ini new file mode 100644 index 00000000..3e5809f2 --- /dev/null +++ b/endpoint/instant_tests_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=instant_tests_api diff --git a/endpoint/labels_api/.github/workflows/python.yml b/endpoint/labels_api/.github/workflows/python.yml new file mode 100644 index 00000000..20120cac --- /dev/null +++ b/endpoint/labels_api/.github/workflows/python.yml @@ -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: labels_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 diff --git a/endpoint/labels_api/.gitignore b/endpoint/labels_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/endpoint/labels_api/.gitignore @@ -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 diff --git a/endpoint/labels_api/.gitlab-ci.yml b/endpoint/labels_api/.gitlab-ci.yml new file mode 100644 index 00000000..bd6c155d --- /dev/null +++ b/endpoint/labels_api/.gitlab-ci.yml @@ -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=labels_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 diff --git a/endpoint/labels_api/.openapi-generator-ignore b/endpoint/labels_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/endpoint/labels_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/endpoint/labels_api/.openapi-generator/FILES b/endpoint/labels_api/.openapi-generator/FILES new file mode 100644 index 00000000..e7063060 --- /dev/null +++ b/endpoint/labels_api/.openapi-generator/FILES @@ -0,0 +1,80 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/EndpointLabelsList200Response.md +docs/Error.md +docs/Expand.md +docs/Filter.md +docs/FilterType.md +docs/Label.md +docs/LabelFilterMode.md +docs/Labels.md +docs/LabelsLabelsInner.md +docs/Link.md +docs/ManageLabelsApi.md +docs/MatchType.md +docs/PaginationNextLink.md +docs/PaginationNextLinkLinks.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/UnauthorizedError.md +docs/V7EndpointLabelsPost201Response.md +docs/V7EndpointLabelsPostRequest.md +git_push.sh +labels_api/__init__.py +labels_api/api/__init__.py +labels_api/api/manage_labels_api.py +labels_api/api_client.py +labels_api/api_response.py +labels_api/configuration.py +labels_api/exceptions.py +labels_api/models/__init__.py +labels_api/models/endpoint_labels_list200_response.py +labels_api/models/error.py +labels_api/models/expand.py +labels_api/models/filter.py +labels_api/models/filter_type.py +labels_api/models/label.py +labels_api/models/label_filter_mode.py +labels_api/models/labels.py +labels_api/models/labels_labels_inner.py +labels_api/models/link.py +labels_api/models/match_type.py +labels_api/models/pagination_next_link.py +labels_api/models/pagination_next_link_links.py +labels_api/models/self_links.py +labels_api/models/self_links_links.py +labels_api/models/unauthorized_error.py +labels_api/models/v7_endpoint_labels_post201_response.py +labels_api/models/v7_endpoint_labels_post_request.py +labels_api/py.typed +labels_api/rest.py +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_endpoint_labels_list200_response.py +test/test_error.py +test/test_expand.py +test/test_filter.py +test/test_filter_type.py +test/test_label.py +test/test_label_filter_mode.py +test/test_labels.py +test/test_labels_labels_inner.py +test/test_link.py +test/test_manage_labels_api.py +test/test_match_type.py +test/test_pagination_next_link.py +test/test_pagination_next_link_links.py +test/test_self_links.py +test/test_self_links_links.py +test/test_unauthorized_error.py +test/test_v7_endpoint_labels_post201_response.py +test/test_v7_endpoint_labels_post_request.py +tox.ini diff --git a/endpoint/labels_api/.openapi-generator/VERSION b/endpoint/labels_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/endpoint/labels_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/endpoint/labels_api/.travis.yml b/endpoint/labels_api/.travis.yml new file mode 100644 index 00000000..d7ebb0c5 --- /dev/null +++ b/endpoint/labels_api/.travis.yml @@ -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=labels_api diff --git a/endpoint/labels_api/README.md b/endpoint/labels_api/README.md new file mode 100644 index 00000000..6a4cefa5 --- /dev/null +++ b/endpoint/labels_api/README.md @@ -0,0 +1,140 @@ +# labels-api +Manage labels applied to endpoint agents using this API. + + +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 labels_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 labels_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 labels_api +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.ManageLabelsApi(api_client) + id = 'id_example' # str | The unique identifier of the label to operate on. + + try: + # Deletes label + api_instance.endpoint_label_delete(id) + except ApiException as e: + print("Exception when calling ManageLabelsApi->endpoint_label_delete: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ManageLabelsApi* | [**endpoint_label_delete**](docs/ManageLabelsApi.md#endpoint_label_delete) | **DELETE** /v7/endpoint/labels/{id} | Deletes label +*ManageLabelsApi* | [**endpoint_label_get**](docs/ManageLabelsApi.md#endpoint_label_get) | **GET** /v7/endpoint/labels/{id} | Retrieve label +*ManageLabelsApi* | [**endpoint_label_update**](docs/ManageLabelsApi.md#endpoint_label_update) | **PATCH** /v7/endpoint/labels/{id} | Update label +*ManageLabelsApi* | [**endpoint_labels_list**](docs/ManageLabelsApi.md#endpoint_labels_list) | **GET** /v7/endpoint/labels | List labels +*ManageLabelsApi* | [**v7_endpoint_labels_post**](docs/ManageLabelsApi.md#v7_endpoint_labels_post) | **POST** /v7/endpoint/labels | Create label + + +## Documentation For Models + + - [EndpointLabelsList200Response](docs/EndpointLabelsList200Response.md) + - [Error](docs/Error.md) + - [Expand](docs/Expand.md) + - [Filter](docs/Filter.md) + - [FilterType](docs/FilterType.md) + - [Label](docs/Label.md) + - [LabelFilterMode](docs/LabelFilterMode.md) + - [Labels](docs/Labels.md) + - [LabelsLabelsInner](docs/LabelsLabelsInner.md) + - [Link](docs/Link.md) + - [MatchType](docs/MatchType.md) + - [PaginationNextLink](docs/PaginationNextLink.md) + - [PaginationNextLinkLinks](docs/PaginationNextLinkLinks.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + - [V7EndpointLabelsPost201Response](docs/V7EndpointLabelsPost201Response.md) + - [V7EndpointLabelsPostRequest](docs/V7EndpointLabelsPostRequest.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/endpoint/labels_api/docs/EndpointLabelsList200Response.md b/endpoint/labels_api/docs/EndpointLabelsList200Response.md new file mode 100644 index 00000000..6e474967 --- /dev/null +++ b/endpoint/labels_api/docs/EndpointLabelsList200Response.md @@ -0,0 +1,29 @@ +# EndpointLabelsList200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**labels** | [**List[LabelsLabelsInner]**](LabelsLabelsInner.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from labels_api.models.endpoint_labels_list200_response import EndpointLabelsList200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointLabelsList200Response from a JSON string +endpoint_labels_list200_response_instance = EndpointLabelsList200Response.from_json(json) +# print the JSON string representation of the object +print EndpointLabelsList200Response.to_json() + +# convert the object into a dict +endpoint_labels_list200_response_dict = endpoint_labels_list200_response_instance.to_dict() +# create an instance of EndpointLabelsList200Response from a dict +endpoint_labels_list200_response_form_dict = endpoint_labels_list200_response.from_dict(endpoint_labels_list200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/Error.md b/endpoint/labels_api/docs/Error.md new file mode 100644 index 00000000..64391133 --- /dev/null +++ b/endpoint/labels_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from labels_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/Expand.md b/endpoint/labels_api/docs/Expand.md new file mode 100644 index 00000000..5d5b5ca2 --- /dev/null +++ b/endpoint/labels_api/docs/Expand.md @@ -0,0 +1,10 @@ +# Expand + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/Filter.md b/endpoint/labels_api/docs/Filter.md new file mode 100644 index 00000000..206119d8 --- /dev/null +++ b/endpoint/labels_api/docs/Filter.md @@ -0,0 +1,30 @@ +# Filter + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | [**FilterType**](FilterType.md) | | [optional] +**values** | **List[str]** | | [optional] +**mode** | [**LabelFilterMode**](LabelFilterMode.md) | | [optional] + +## Example + +```python +from labels_api.models.filter import Filter + +# TODO update the JSON string below +json = "{}" +# create an instance of Filter from a JSON string +filter_instance = Filter.from_json(json) +# print the JSON string representation of the object +print Filter.to_json() + +# convert the object into a dict +filter_dict = filter_instance.to_dict() +# create an instance of Filter from a dict +filter_form_dict = filter.from_dict(filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/FilterType.md b/endpoint/labels_api/docs/FilterType.md new file mode 100644 index 00000000..f0a6da63 --- /dev/null +++ b/endpoint/labels_api/docs/FilterType.md @@ -0,0 +1,11 @@ +# FilterType + +Type of filter - the data that will be used to filter. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/Label.md b/endpoint/labels_api/docs/Label.md new file mode 100644 index 00000000..ea2d89f8 --- /dev/null +++ b/endpoint/labels_api/docs/Label.md @@ -0,0 +1,33 @@ +# Label + +A label definition. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Label identifier. | [optional] [readonly] +**name** | **str** | The label name. | [optional] +**color** | **str** | UI color | [optional] +**match_type** | [**MatchType**](MatchType.md) | | [optional] +**filters** | [**List[Filter]**](Filter.md) | The filters combined using the matchType to determine the label's match. | [optional] + +## Example + +```python +from labels_api.models.label import Label + +# TODO update the JSON string below +json = "{}" +# create an instance of Label from a JSON string +label_instance = Label.from_json(json) +# print the JSON string representation of the object +print Label.to_json() + +# convert the object into a dict +label_dict = label_instance.to_dict() +# create an instance of Label from a dict +label_form_dict = label.from_dict(label_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/LabelFilterMode.md b/endpoint/labels_api/docs/LabelFilterMode.md new file mode 100644 index 00000000..85511eb4 --- /dev/null +++ b/endpoint/labels_api/docs/LabelFilterMode.md @@ -0,0 +1,11 @@ +# LabelFilterMode + +Type of matching to be applied for the values: * `in`: The value on the agent must match one of the list of values provided. * `not-in`: The value on the agent must not match any of the list of values provided. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/Labels.md b/endpoint/labels_api/docs/Labels.md new file mode 100644 index 00000000..60e9ae08 --- /dev/null +++ b/endpoint/labels_api/docs/Labels.md @@ -0,0 +1,29 @@ +# Labels + +A list of Labels. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**labels** | [**List[LabelsLabelsInner]**](LabelsLabelsInner.md) | | [optional] + +## Example + +```python +from labels_api.models.labels import Labels + +# TODO update the JSON string below +json = "{}" +# create an instance of Labels from a JSON string +labels_instance = Labels.from_json(json) +# print the JSON string representation of the object +print Labels.to_json() + +# convert the object into a dict +labels_dict = labels_instance.to_dict() +# create an instance of Labels from a dict +labels_form_dict = labels.from_dict(labels_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/LabelsLabelsInner.md b/endpoint/labels_api/docs/LabelsLabelsInner.md new file mode 100644 index 00000000..c2467397 --- /dev/null +++ b/endpoint/labels_api/docs/LabelsLabelsInner.md @@ -0,0 +1,33 @@ +# LabelsLabelsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**id** | **str** | Label identifier. | [optional] [readonly] +**name** | **str** | The label name. | [optional] +**color** | **str** | UI color | [optional] +**match_type** | [**MatchType**](MatchType.md) | | [optional] +**filters** | [**List[Filter]**](Filter.md) | The filters combined using the matchType to determine the label's match. | [optional] + +## Example + +```python +from labels_api.models.labels_labels_inner import LabelsLabelsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of LabelsLabelsInner from a JSON string +labels_labels_inner_instance = LabelsLabelsInner.from_json(json) +# print the JSON string representation of the object +print LabelsLabelsInner.to_json() + +# convert the object into a dict +labels_labels_inner_dict = labels_labels_inner_instance.to_dict() +# create an instance of LabelsLabelsInner from a dict +labels_labels_inner_form_dict = labels_labels_inner.from_dict(labels_labels_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/Link.md b/endpoint/labels_api/docs/Link.md new file mode 100644 index 00000000..ab89c4f1 --- /dev/null +++ b/endpoint/labels_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from labels_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/ManageLabelsApi.md b/endpoint/labels_api/docs/ManageLabelsApi.md new file mode 100644 index 00000000..fe142766 --- /dev/null +++ b/endpoint/labels_api/docs/ManageLabelsApi.md @@ -0,0 +1,421 @@ +# labels_api.ManageLabelsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**endpoint_label_delete**](ManageLabelsApi.md#endpoint_label_delete) | **DELETE** /v7/endpoint/labels/{id} | Deletes label +[**endpoint_label_get**](ManageLabelsApi.md#endpoint_label_get) | **GET** /v7/endpoint/labels/{id} | Retrieve label +[**endpoint_label_update**](ManageLabelsApi.md#endpoint_label_update) | **PATCH** /v7/endpoint/labels/{id} | Update label +[**endpoint_labels_list**](ManageLabelsApi.md#endpoint_labels_list) | **GET** /v7/endpoint/labels | List labels +[**v7_endpoint_labels_post**](ManageLabelsApi.md#v7_endpoint_labels_post) | **POST** /v7/endpoint/labels | Create label + + +# **endpoint_label_delete** +> endpoint_label_delete(id) + +Deletes label + +Deletes the label from your account. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.ManageLabelsApi(api_client) + id = 'id_example' # str | The unique identifier of the label to operate on. + + try: + # Deletes label + api_instance.endpoint_label_delete(id) + except Exception as e: + print("Exception when calling ManageLabelsApi->endpoint_label_delete: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The unique identifier of the label to operate on. | + +### 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 | - | + +[[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) + +# **endpoint_label_get** +> V7EndpointLabelsPost201Response endpoint_label_get(id, expand=expand) + +Retrieve label + +Returns a single label using its ID. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.expand import Expand +from labels_api.models.v7_endpoint_labels_post201_response import V7EndpointLabelsPost201Response +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.ManageLabelsApi(api_client) + id = 'id_example' # str | The unique identifier of the label to operate on. + expand = [labels_api.Expand()] # List[Expand] | This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. (optional) + + try: + # Retrieve label + api_response = api_instance.endpoint_label_get(id, expand=expand) + print("The response of ManageLabelsApi->endpoint_label_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManageLabelsApi->endpoint_label_get: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The unique identifier of the label to operate on. | + **expand** | [**List[Expand]**](Expand.md)| This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. | [optional] + +### Return type + +[**V7EndpointLabelsPost201Response**](V7EndpointLabelsPost201Response.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 | - | + +[[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) + +# **endpoint_label_update** +> V7EndpointLabelsPost201Response endpoint_label_update(id, label=label) + +Update label + +Updates a label using its ID. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.label import Label +from labels_api.models.v7_endpoint_labels_post201_response import V7EndpointLabelsPost201Response +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.ManageLabelsApi(api_client) + id = 'id_example' # str | The unique identifier of the label to operate on. + label = labels_api.Label() # Label | Fields to change on the agent (optional) + + try: + # Update label + api_response = api_instance.endpoint_label_update(id, label=label) + print("The response of ManageLabelsApi->endpoint_label_update:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManageLabelsApi->endpoint_label_update: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The unique identifier of the label to operate on. | + **label** | [**Label**](Label.md)| Fields to change on the agent | [optional] + +### Return type + +[**V7EndpointLabelsPost201Response**](V7EndpointLabelsPost201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **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 | - | + +[[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) + +# **endpoint_labels_list** +> EndpointLabelsList200Response endpoint_labels_list(max=max, cursor=cursor, expand=expand) + +List labels + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.endpoint_labels_list200_response import EndpointLabelsList200Response +from labels_api.models.expand import Expand +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.ManageLabelsApi(api_client) + max = 5 # float | (Optional) Maximum number of objects to return. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + expand = [labels_api.Expand()] # List[Expand] | This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. (optional) + + try: + # List labels + api_response = api_instance.endpoint_labels_list(max=max, cursor=cursor, expand=expand) + print("The response of ManageLabelsApi->endpoint_labels_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManageLabelsApi->endpoint_labels_list: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **max** | **float**| (Optional) Maximum number of objects to return. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **expand** | [**List[Expand]**](Expand.md)| This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. | [optional] + +### Return type + +[**EndpointLabelsList200Response**](EndpointLabelsList200Response.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 | - | +**429** | Exhausted rate limit for the organization | - | + +[[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) + +# **v7_endpoint_labels_post** +> V7EndpointLabelsPost201Response v7_endpoint_labels_post(v7_endpoint_labels_post_request=v7_endpoint_labels_post_request) + +Create label + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.v7_endpoint_labels_post201_response import V7EndpointLabelsPost201Response +from labels_api.models.v7_endpoint_labels_post_request import V7EndpointLabelsPostRequest +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.ManageLabelsApi(api_client) + v7_endpoint_labels_post_request = labels_api.V7EndpointLabelsPostRequest() # V7EndpointLabelsPostRequest | Label settings (optional) + + try: + # Create label + api_response = api_instance.v7_endpoint_labels_post(v7_endpoint_labels_post_request=v7_endpoint_labels_post_request) + print("The response of ManageLabelsApi->v7_endpoint_labels_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManageLabelsApi->v7_endpoint_labels_post: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **v7_endpoint_labels_post_request** | [**V7EndpointLabelsPostRequest**](V7EndpointLabelsPostRequest.md)| Label settings | [optional] + +### Return type + +[**V7EndpointLabelsPost201Response**](V7EndpointLabelsPost201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | * Location -
| +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/labels_api/docs/MatchType.md b/endpoint/labels_api/docs/MatchType.md new file mode 100644 index 00000000..26fbe2ef --- /dev/null +++ b/endpoint/labels_api/docs/MatchType.md @@ -0,0 +1,11 @@ +# MatchType + +Specifies how the filters are combined for matching this label. * `and`: All filters must be matched. * `or`: Any of the filters should match. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/PaginationNextLink.md b/endpoint/labels_api/docs/PaginationNextLink.md new file mode 100644 index 00000000..ac51975b --- /dev/null +++ b/endpoint/labels_api/docs/PaginationNextLink.md @@ -0,0 +1,29 @@ +# PaginationNextLink + +A links object containing a related link for forward pagination. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**PaginationNextLinkLinks**](PaginationNextLinkLinks.md) | | [optional] + +## Example + +```python +from labels_api.models.pagination_next_link import PaginationNextLink + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationNextLink from a JSON string +pagination_next_link_instance = PaginationNextLink.from_json(json) +# print the JSON string representation of the object +print PaginationNextLink.to_json() + +# convert the object into a dict +pagination_next_link_dict = pagination_next_link_instance.to_dict() +# create an instance of PaginationNextLink from a dict +pagination_next_link_form_dict = pagination_next_link.from_dict(pagination_next_link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/PaginationNextLinkLinks.md b/endpoint/labels_api/docs/PaginationNextLinkLinks.md new file mode 100644 index 00000000..1f857a55 --- /dev/null +++ b/endpoint/labels_api/docs/PaginationNextLinkLinks.md @@ -0,0 +1,28 @@ +# PaginationNextLinkLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from labels_api.models.pagination_next_link_links import PaginationNextLinkLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationNextLinkLinks from a JSON string +pagination_next_link_links_instance = PaginationNextLinkLinks.from_json(json) +# print the JSON string representation of the object +print PaginationNextLinkLinks.to_json() + +# convert the object into a dict +pagination_next_link_links_dict = pagination_next_link_links_instance.to_dict() +# create an instance of PaginationNextLinkLinks from a dict +pagination_next_link_links_form_dict = pagination_next_link_links.from_dict(pagination_next_link_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/SelfLinks.md b/endpoint/labels_api/docs/SelfLinks.md new file mode 100644 index 00000000..bccde48b --- /dev/null +++ b/endpoint/labels_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from labels_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/SelfLinksLinks.md b/endpoint/labels_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..99a51f81 --- /dev/null +++ b/endpoint/labels_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from labels_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/UnauthorizedError.md b/endpoint/labels_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..77e1e6d9 --- /dev/null +++ b/endpoint/labels_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from labels_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/V7EndpointLabelsPost201Response.md b/endpoint/labels_api/docs/V7EndpointLabelsPost201Response.md new file mode 100644 index 00000000..bd80f064 --- /dev/null +++ b/endpoint/labels_api/docs/V7EndpointLabelsPost201Response.md @@ -0,0 +1,33 @@ +# V7EndpointLabelsPost201Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Label identifier. | [optional] [readonly] +**name** | **str** | The label name. | [optional] +**color** | **str** | UI color | [optional] +**match_type** | [**MatchType**](MatchType.md) | | [optional] +**filters** | [**List[Filter]**](Filter.md) | The filters combined using the matchType to determine the label's match. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from labels_api.models.v7_endpoint_labels_post201_response import V7EndpointLabelsPost201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of V7EndpointLabelsPost201Response from a JSON string +v7_endpoint_labels_post201_response_instance = V7EndpointLabelsPost201Response.from_json(json) +# print the JSON string representation of the object +print V7EndpointLabelsPost201Response.to_json() + +# convert the object into a dict +v7_endpoint_labels_post201_response_dict = v7_endpoint_labels_post201_response_instance.to_dict() +# create an instance of V7EndpointLabelsPost201Response from a dict +v7_endpoint_labels_post201_response_form_dict = v7_endpoint_labels_post201_response.from_dict(v7_endpoint_labels_post201_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/labels_api/docs/V7EndpointLabelsPostRequest.md b/endpoint/labels_api/docs/V7EndpointLabelsPostRequest.md new file mode 100644 index 00000000..cee86031 --- /dev/null +++ b/endpoint/labels_api/docs/V7EndpointLabelsPostRequest.md @@ -0,0 +1,32 @@ +# V7EndpointLabelsPostRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Label identifier. | [optional] [readonly] +**name** | **str** | The label name. | +**color** | **str** | UI color | [optional] +**match_type** | [**MatchType**](MatchType.md) | | +**filters** | [**List[Filter]**](Filter.md) | The filters combined using the matchType to determine the label's match. | + +## Example + +```python +from labels_api.models.v7_endpoint_labels_post_request import V7EndpointLabelsPostRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of V7EndpointLabelsPostRequest from a JSON string +v7_endpoint_labels_post_request_instance = V7EndpointLabelsPostRequest.from_json(json) +# print the JSON string representation of the object +print V7EndpointLabelsPostRequest.to_json() + +# convert the object into a dict +v7_endpoint_labels_post_request_dict = v7_endpoint_labels_post_request_instance.to_dict() +# create an instance of V7EndpointLabelsPostRequest from a dict +v7_endpoint_labels_post_request_form_dict = v7_endpoint_labels_post_request.from_dict(v7_endpoint_labels_post_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) + + diff --git a/endpoint/labels_api/git_push.sh b/endpoint/labels_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/endpoint/labels_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/endpoint/labels_api/labels_api/__init__.py b/endpoint/labels_api/labels_api/__init__.py new file mode 100644 index 00000000..e9fd4c2e --- /dev/null +++ b/endpoint/labels_api/labels_api/__init__.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_api.api.manage_labels_api import ManageLabelsApi + +# import ApiClient +from labels_api.api_response import ApiResponse +from labels_api.api_client import ApiClient +from labels_api.configuration import Configuration +from labels_api.exceptions import OpenApiException +from labels_api.exceptions import ApiTypeError +from labels_api.exceptions import ApiValueError +from labels_api.exceptions import ApiKeyError +from labels_api.exceptions import ApiAttributeError +from labels_api.exceptions import ApiException + +# import models into sdk package +from labels_api.models.endpoint_labels_list200_response import EndpointLabelsList200Response +from labels_api.models.error import Error +from labels_api.models.expand import Expand +from labels_api.models.filter import Filter +from labels_api.models.filter_type import FilterType +from labels_api.models.label import Label +from labels_api.models.label_filter_mode import LabelFilterMode +from labels_api.models.labels import Labels +from labels_api.models.labels_labels_inner import LabelsLabelsInner +from labels_api.models.link import Link +from labels_api.models.match_type import MatchType +from labels_api.models.pagination_next_link import PaginationNextLink +from labels_api.models.pagination_next_link_links import PaginationNextLinkLinks +from labels_api.models.self_links import SelfLinks +from labels_api.models.self_links_links import SelfLinksLinks +from labels_api.models.unauthorized_error import UnauthorizedError +from labels_api.models.v7_endpoint_labels_post201_response import V7EndpointLabelsPost201Response +from labels_api.models.v7_endpoint_labels_post_request import V7EndpointLabelsPostRequest diff --git a/endpoint/labels_api/labels_api/api/__init__.py b/endpoint/labels_api/labels_api/api/__init__.py new file mode 100644 index 00000000..8db10fcc --- /dev/null +++ b/endpoint/labels_api/labels_api/api/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa + +# import apis into api package +from labels_api.api.manage_labels_api import ManageLabelsApi + diff --git a/endpoint/labels_api/labels_api/api/manage_labels_api.py b/endpoint/labels_api/labels_api/api/manage_labels_api.py new file mode 100644 index 00000000..168895d8 --- /dev/null +++ b/endpoint/labels_api/labels_api/api/manage_labels_api.py @@ -0,0 +1,1497 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 StrictFloat, StrictInt, StrictStr + +from typing import List, Optional, Union + +from labels_api.models.endpoint_labels_list200_response import EndpointLabelsList200Response +from labels_api.models.expand import Expand +from labels_api.models.label import Label +from labels_api.models.v7_endpoint_labels_post201_response import V7EndpointLabelsPost201Response +from labels_api.models.v7_endpoint_labels_post_request import V7EndpointLabelsPostRequest + +from labels_api.api_client import ApiClient +from labels_api.api_response import ApiResponse +from labels_api.rest import RESTResponseType + + +class ManageLabelsApi: + """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 endpoint_label_delete( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + _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, + ) -> None: + """Deletes label + + Deletes the label from your account. + + :param id: The unique identifier of the label to operate on. (required) + :type id: 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._endpoint_label_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 endpoint_label_delete_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + _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[None]: + """Deletes label + + Deletes the label from your account. + + :param id: The unique identifier of the label to operate on. (required) + :type id: 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._endpoint_label_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 endpoint_label_delete_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + _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: + """Deletes label + + Deletes the label from your account. + + :param id: The unique identifier of the label to operate on. (required) + :type id: 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._endpoint_label_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_label_delete_serialize( + self, + id, + _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 id is not None: + _path_params['id'] = id + # process the query parameters + # 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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/endpoint/labels/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def endpoint_label_get( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + expand: Annotated[Optional[List[Expand]], Field(description="This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times.")] = 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, + ) -> V7EndpointLabelsPost201Response: + """Retrieve label + + Returns a single label using its ID. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param expand: This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. + :type expand: List[Expand] + :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._endpoint_label_get_serialize( + id=id, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "V7EndpointLabelsPost201Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_label_get_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + expand: Annotated[Optional[List[Expand]], Field(description="This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times.")] = 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[V7EndpointLabelsPost201Response]: + """Retrieve label + + Returns a single label using its ID. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param expand: This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. + :type expand: List[Expand] + :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._endpoint_label_get_serialize( + id=id, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "V7EndpointLabelsPost201Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_label_get_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + expand: Annotated[Optional[List[Expand]], Field(description="This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times.")] = 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 label + + Returns a single label using its ID. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param expand: This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. + :type expand: List[Expand] + :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._endpoint_label_get_serialize( + id=id, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "V7EndpointLabelsPost201Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_label_get_serialize( + self, + id, + 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 id is not None: + _path_params['id'] = id + # process the query parameters + if expand is not None: + + _query_params.append(('expand', expand)) + + # 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/endpoint/labels/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def endpoint_label_update( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + label: Annotated[Optional[Label], Field(description="Fields to change on the agent")] = 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, + ) -> V7EndpointLabelsPost201Response: + """Update label + + Updates a label using its ID. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param label: Fields to change on the agent + :type label: Label + :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._endpoint_label_update_serialize( + id=id, + label=label, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "V7EndpointLabelsPost201Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_label_update_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + label: Annotated[Optional[Label], Field(description="Fields to change on the agent")] = 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[V7EndpointLabelsPost201Response]: + """Update label + + Updates a label using its ID. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param label: Fields to change on the agent + :type label: Label + :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._endpoint_label_update_serialize( + id=id, + label=label, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "V7EndpointLabelsPost201Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "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 endpoint_label_update_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + label: Annotated[Optional[Label], Field(description="Fields to change on the agent")] = 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: + """Update label + + Updates a label using its ID. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param label: Fields to change on the agent + :type label: Label + :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._endpoint_label_update_serialize( + id=id, + label=label, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "V7EndpointLabelsPost201Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_label_update_serialize( + self, + id, + label, + _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 id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if label is not None: + _body_params = label + + + # 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='PATCH', + resource_path='/v7/endpoint/labels/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def endpoint_labels_list( + self, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times.")] = 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, + ) -> EndpointLabelsList200Response: + """List labels + + + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. + :type expand: List[Expand] + :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._endpoint_labels_list_serialize( + max=max, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointLabelsList200Response", + '401': "UnauthorizedError", + '403': "Error", + '429': "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 endpoint_labels_list_with_http_info( + self, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times.")] = 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[EndpointLabelsList200Response]: + """List labels + + + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. + :type expand: List[Expand] + :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._endpoint_labels_list_serialize( + max=max, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointLabelsList200Response", + '401': "UnauthorizedError", + '403': "Error", + '429': "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 endpoint_labels_list_without_preload_content( + self, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times.")] = 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 labels + + + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. + :type expand: List[Expand] + :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._endpoint_labels_list_serialize( + max=max, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointLabelsList200Response", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _endpoint_labels_list_serialize( + self, + max, + cursor, + 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 + # process the query parameters + if max is not None: + + _query_params.append(('max', max)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # 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/endpoint/labels', + 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 v7_endpoint_labels_post( + self, + v7_endpoint_labels_post_request: Annotated[Optional[V7EndpointLabelsPostRequest], Field(description="Label settings")] = 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, + ) -> V7EndpointLabelsPost201Response: + """Create label + + + :param v7_endpoint_labels_post_request: Label settings + :type v7_endpoint_labels_post_request: V7EndpointLabelsPostRequest + :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._v7_endpoint_labels_post_serialize( + v7_endpoint_labels_post_request=v7_endpoint_labels_post_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "V7EndpointLabelsPost201Response", + '401': "UnauthorizedError", + '403': "Error", + '429': "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 v7_endpoint_labels_post_with_http_info( + self, + v7_endpoint_labels_post_request: Annotated[Optional[V7EndpointLabelsPostRequest], Field(description="Label settings")] = 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[V7EndpointLabelsPost201Response]: + """Create label + + + :param v7_endpoint_labels_post_request: Label settings + :type v7_endpoint_labels_post_request: V7EndpointLabelsPostRequest + :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._v7_endpoint_labels_post_serialize( + v7_endpoint_labels_post_request=v7_endpoint_labels_post_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "V7EndpointLabelsPost201Response", + '401': "UnauthorizedError", + '403': "Error", + '429': "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 v7_endpoint_labels_post_without_preload_content( + self, + v7_endpoint_labels_post_request: Annotated[Optional[V7EndpointLabelsPostRequest], Field(description="Label settings")] = 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: + """Create label + + + :param v7_endpoint_labels_post_request: Label settings + :type v7_endpoint_labels_post_request: V7EndpointLabelsPostRequest + :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._v7_endpoint_labels_post_serialize( + v7_endpoint_labels_post_request=v7_endpoint_labels_post_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "V7EndpointLabelsPost201Response", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v7_endpoint_labels_post_serialize( + self, + v7_endpoint_labels_post_request, + _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 + # process the header parameters + # process the form parameters + # process the body parameter + if v7_endpoint_labels_post_request is not None: + _body_params = v7_endpoint_labels_post_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/endpoint/labels', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/labels_api/labels_api/api_client.py b/endpoint/labels_api/labels_api/api_client.py new file mode 100644 index 00000000..dd7844f9 --- /dev/null +++ b/endpoint/labels_api/labels_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_api.configuration import Configuration +from labels_api.api_response import ApiResponse +import labels_api.models +from labels_api import rest +from labels_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(labels_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) diff --git a/endpoint/labels_api/labels_api/api_response.py b/endpoint/labels_api/labels_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/endpoint/labels_api/labels_api/api_response.py @@ -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 + } diff --git a/endpoint/labels_api/labels_api/configuration.py b/endpoint/labels_api/labels_api/configuration.py new file mode 100644 index 00000000..9dc37ad2 --- /dev/null +++ b/endpoint/labels_api/labels_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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("labels_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 diff --git a/endpoint/labels_api/labels_api/exceptions.py b/endpoint/labels_api/labels_api/exceptions.py new file mode 100644 index 00000000..7e75afd3 --- /dev/null +++ b/endpoint/labels_api/labels_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 diff --git a/endpoint/labels_api/labels_api/models/__init__.py b/endpoint/labels_api/labels_api/models/__init__.py new file mode 100644 index 00000000..7487f4c9 --- /dev/null +++ b/endpoint/labels_api/labels_api/models/__init__.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +# flake8: noqa +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_api.models.endpoint_labels_list200_response import EndpointLabelsList200Response +from labels_api.models.error import Error +from labels_api.models.expand import Expand +from labels_api.models.filter import Filter +from labels_api.models.filter_type import FilterType +from labels_api.models.label import Label +from labels_api.models.label_filter_mode import LabelFilterMode +from labels_api.models.labels import Labels +from labels_api.models.labels_labels_inner import LabelsLabelsInner +from labels_api.models.link import Link +from labels_api.models.match_type import MatchType +from labels_api.models.pagination_next_link import PaginationNextLink +from labels_api.models.pagination_next_link_links import PaginationNextLinkLinks +from labels_api.models.self_links import SelfLinks +from labels_api.models.self_links_links import SelfLinksLinks +from labels_api.models.unauthorized_error import UnauthorizedError +from labels_api.models.v7_endpoint_labels_post201_response import V7EndpointLabelsPost201Response +from labels_api.models.v7_endpoint_labels_post_request import V7EndpointLabelsPostRequest diff --git a/endpoint/labels_api/labels_api/models/endpoint_labels_list200_response.py b/endpoint/labels_api/labels_api/models/endpoint_labels_list200_response.py new file mode 100644 index 00000000..35177fb5 --- /dev/null +++ b/endpoint/labels_api/labels_api/models/endpoint_labels_list200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_api.models.labels_labels_inner import LabelsLabelsInner +from labels_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointLabelsList200Response(BaseModel): + """ + EndpointLabelsList200Response + """ # noqa: E501 + labels: Optional[List[LabelsLabelsInner]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["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 EndpointLabelsList200Response 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 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 EndpointLabelsList200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "labels": [LabelsLabelsInner.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 + + diff --git a/endpoint/labels_api/labels_api/models/error.py b/endpoint/labels_api/labels_api/models/error.py new file mode 100644 index 00000000..fc627613 --- /dev/null +++ b/endpoint/labels_api/labels_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 + + diff --git a/endpoint/labels_api/labels_api/models/expand.py b/endpoint/labels_api/labels_api/models/expand.py new file mode 100644 index 00000000..235a861f --- /dev/null +++ b/endpoint/labels_api/labels_api/models/expand.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 Expand(str, Enum): + """ + Expand + """ + + """ + allowed enum values + """ + FILTERS = 'filters' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Expand from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/labels_api/labels_api/models/filter.py b/endpoint/labels_api/labels_api/models/filter.py new file mode 100644 index 00000000..4a903a32 --- /dev/null +++ b/endpoint/labels_api/labels_api/models/filter.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_api.models.filter_type import FilterType +from labels_api.models.label_filter_mode import LabelFilterMode +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Filter(BaseModel): + """ + Filter + """ # noqa: E501 + key: Optional[FilterType] = None + values: Optional[List[StrictStr]] = None + mode: Optional[LabelFilterMode] = None + __properties: ClassVar[List[str]] = ["key", "values", "mode"] + + 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 Filter 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 Filter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "key": obj.get("key"), + "values": obj.get("values"), + "mode": obj.get("mode") + }) + return _obj + + diff --git a/endpoint/labels_api/labels_api/models/filter_type.py b/endpoint/labels_api/labels_api/models/filter_type.py new file mode 100644 index 00000000..edc5a932 --- /dev/null +++ b/endpoint/labels_api/labels_api/models/filter_type.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 FilterType(str, Enum): + """ + Type of filter - the data that will be used to filter. + """ + + """ + allowed enum values + """ + AGENT_MINUS_ID = 'agent-id' + PUBLIC_MINUS_NETWORK = 'public-network' + LOCAL_MINUS_NETWORK = 'local-network' + CONNECTION = 'connection' + GATEWAY = 'gateway' + PLATFORM = 'platform' + AGENT_MINUS_TYPE = 'agent-type' + VPN_MINUS_VENDOR = 'vpn-vendor' + VPN_MINUS_GATEWAY_MINUS_ADDRESS = 'vpn-gateway-address' + VPN_MINUS_CLIENT_MINUS_NETWORK = 'vpn-client-network' + VPN_MINUS_CLIENT_MINUS_ADDRESS = 'vpn-client-address' + IP_MINUS_ADDRESS_MINUS_FAMILY = 'ip-address-family' + SSID = 'ssid' + BSSID = 'bssid' + HOSTNAME = 'hostname' + USERNAME = 'username' + ASN = 'asn' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FilterType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/labels_api/labels_api/models/label.py b/endpoint/labels_api/labels_api/models/label.py new file mode 100644 index 00000000..77a7636b --- /dev/null +++ b/endpoint/labels_api/labels_api/models/label.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_api.models.filter import Filter +from labels_api.models.match_type import MatchType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Label(BaseModel): + """ + A label definition. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Label identifier.") + name: Optional[StrictStr] = Field(default=None, description="The label name.") + color: Optional[StrictStr] = Field(default=None, description="UI color") + match_type: Optional[MatchType] = Field(default=None, alias="matchType") + filters: Optional[List[Filter]] = Field(default=None, description="The filters combined using the matchType to determine the label's match.") + __properties: ClassVar[List[str]] = ["id", "name", "color", "matchType", "filters"] + + 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 Label 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={ + "id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in filters (list) + _items = [] + if self.filters: + for _item in self.filters: + if _item: + _items.append(_item.to_dict()) + _dict['filters'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Label from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "color": obj.get("color"), + "matchType": obj.get("matchType"), + "filters": [Filter.from_dict(_item) for _item in obj.get("filters")] if obj.get("filters") is not None else None + }) + return _obj + + diff --git a/endpoint/labels_api/labels_api/models/label_filter_mode.py b/endpoint/labels_api/labels_api/models/label_filter_mode.py new file mode 100644 index 00000000..2b8bcdee --- /dev/null +++ b/endpoint/labels_api/labels_api/models/label_filter_mode.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 LabelFilterMode(str, Enum): + """ + Type of matching to be applied for the values: * `in`: The value on the agent must match one of the list of values provided. * `not-in`: The value on the agent must not match any of the list of values provided. + """ + + """ + allowed enum values + """ + IN = 'in' + NOT_MINUS_IN = 'not-in' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of LabelFilterMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/labels_api/labels_api/models/labels.py b/endpoint/labels_api/labels_api/models/labels.py new file mode 100644 index 00000000..8cb049eb --- /dev/null +++ b/endpoint/labels_api/labels_api/models/labels.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_api.models.labels_labels_inner import LabelsLabelsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Labels(BaseModel): + """ + A list of Labels. + """ # noqa: E501 + labels: Optional[List[LabelsLabelsInner]] = None + __properties: ClassVar[List[str]] = ["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 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, + ) + # 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 Labels from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "labels": [LabelsLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None + }) + return _obj + + diff --git a/endpoint/labels_api/labels_api/models/labels_labels_inner.py b/endpoint/labels_api/labels_api/models/labels_labels_inner.py new file mode 100644 index 00000000..a0106742 --- /dev/null +++ b/endpoint/labels_api/labels_api/models/labels_labels_inner.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_api.models.filter import Filter +from labels_api.models.match_type import MatchType +from labels_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class LabelsLabelsInner(BaseModel): + """ + LabelsLabelsInner + """ # noqa: E501 + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + id: Optional[StrictStr] = Field(default=None, description="Label identifier.") + name: Optional[StrictStr] = Field(default=None, description="The label name.") + color: Optional[StrictStr] = Field(default=None, description="UI color") + match_type: Optional[MatchType] = Field(default=None, alias="matchType") + filters: Optional[List[Filter]] = Field(default=None, description="The filters combined using the matchType to determine the label's match.") + __properties: ClassVar[List[str]] = ["_links", "id", "name", "color", "matchType", "filters"] + + 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 LabelsLabelsInner 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={ + "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() + # override the default output from pydantic by calling `to_dict()` of each item in filters (list) + _items = [] + if self.filters: + for _item in self.filters: + if _item: + _items.append(_item.to_dict()) + _dict['filters'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of LabelsLabelsInner 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, + "id": obj.get("id"), + "name": obj.get("name"), + "color": obj.get("color"), + "matchType": obj.get("matchType"), + "filters": [Filter.from_dict(_item) for _item in obj.get("filters")] if obj.get("filters") is not None else None + }) + return _obj + + diff --git a/endpoint/labels_api/labels_api/models/link.py b/endpoint/labels_api/labels_api/models/link.py new file mode 100644 index 00000000..a7b2f0fe --- /dev/null +++ b/endpoint/labels_api/labels_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 + + diff --git a/endpoint/labels_api/labels_api/models/match_type.py b/endpoint/labels_api/labels_api/models/match_type.py new file mode 100644 index 00000000..711112ae --- /dev/null +++ b/endpoint/labels_api/labels_api/models/match_type.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 MatchType(str, Enum): + """ + Specifies how the filters are combined for matching this label. * `and`: All filters must be matched. * `or`: Any of the filters should match. + """ + + """ + allowed enum values + """ + AND = 'and' + OR = 'or' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of MatchType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/labels_api/labels_api/models/pagination_next_link.py b/endpoint/labels_api/labels_api/models/pagination_next_link.py new file mode 100644 index 00000000..80c8e73a --- /dev/null +++ b/endpoint/labels_api/labels_api/models/pagination_next_link.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_api.models.pagination_next_link_links import PaginationNextLinkLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationNextLink(BaseModel): + """ + A links object containing a related link for forward pagination. + """ # noqa: E501 + links: Optional[PaginationNextLinkLinks] = 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 PaginationNextLink 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 PaginationNextLink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": PaginationNextLinkLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/labels_api/labels_api/models/pagination_next_link_links.py b/endpoint/labels_api/labels_api/models/pagination_next_link_links.py new file mode 100644 index 00000000..21387b32 --- /dev/null +++ b/endpoint/labels_api/labels_api/models/pagination_next_link_links.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_api.models.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationNextLinkLinks(BaseModel): + """ + PaginationNextLinkLinks + """ # noqa: E501 + next: Optional[Link] = None + __properties: ClassVar[List[str]] = ["next"] + + 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 PaginationNextLinkLinks 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 next + if self.next: + _dict['next'] = self.next.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PaginationNextLinkLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "next": Link.from_dict(obj.get("next")) if obj.get("next") is not None else None + }) + return _obj + + diff --git a/endpoint/labels_api/labels_api/models/self_links.py b/endpoint/labels_api/labels_api/models/self_links.py new file mode 100644 index 00000000..de0d800e --- /dev/null +++ b/endpoint/labels_api/labels_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_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 + + diff --git a/endpoint/labels_api/labels_api/models/self_links_links.py b/endpoint/labels_api/labels_api/models/self_links_links.py new file mode 100644 index 00000000..7355b1b8 --- /dev/null +++ b/endpoint/labels_api/labels_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_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 + + diff --git a/endpoint/labels_api/labels_api/models/unauthorized_error.py b/endpoint/labels_api/labels_api/models/unauthorized_error.py new file mode 100644 index 00000000..0dbf0a9f --- /dev/null +++ b/endpoint/labels_api/labels_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 + + diff --git a/endpoint/labels_api/labels_api/models/v7_endpoint_labels_post201_response.py b/endpoint/labels_api/labels_api/models/v7_endpoint_labels_post201_response.py new file mode 100644 index 00000000..41a124a9 --- /dev/null +++ b/endpoint/labels_api/labels_api/models/v7_endpoint_labels_post201_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_api.models.filter import Filter +from labels_api.models.match_type import MatchType +from labels_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class V7EndpointLabelsPost201Response(BaseModel): + """ + V7EndpointLabelsPost201Response + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Label identifier.") + name: Optional[StrictStr] = Field(default=None, description="The label name.") + color: Optional[StrictStr] = Field(default=None, description="UI color") + match_type: Optional[MatchType] = Field(default=None, alias="matchType") + filters: Optional[List[Filter]] = Field(default=None, description="The filters combined using the matchType to determine the label's match.") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["id", "name", "color", "matchType", "filters", "_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 V7EndpointLabelsPost201Response 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={ + "id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in filters (list) + _items = [] + if self.filters: + for _item in self.filters: + if _item: + _items.append(_item.to_dict()) + _dict['filters'] = _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 V7EndpointLabelsPost201Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "color": obj.get("color"), + "matchType": obj.get("matchType"), + "filters": [Filter.from_dict(_item) for _item in obj.get("filters")] if obj.get("filters") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/labels_api/labels_api/models/v7_endpoint_labels_post_request.py b/endpoint/labels_api/labels_api/models/v7_endpoint_labels_post_request.py new file mode 100644 index 00000000..c328ef51 --- /dev/null +++ b/endpoint/labels_api/labels_api/models/v7_endpoint_labels_post_request.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_api.models.filter import Filter +from labels_api.models.match_type import MatchType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class V7EndpointLabelsPostRequest(BaseModel): + """ + V7EndpointLabelsPostRequest + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Label identifier.") + name: StrictStr = Field(description="The label name.") + color: Optional[StrictStr] = Field(default=None, description="UI color") + match_type: MatchType = Field(alias="matchType") + filters: List[Filter] = Field(description="The filters combined using the matchType to determine the label's match.") + __properties: ClassVar[List[str]] = ["id", "name", "color", "matchType", "filters"] + + 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 V7EndpointLabelsPostRequest 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={ + "id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in filters (list) + _items = [] + if self.filters: + for _item in self.filters: + if _item: + _items.append(_item.to_dict()) + _dict['filters'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of V7EndpointLabelsPostRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "color": obj.get("color"), + "matchType": obj.get("matchType"), + "filters": [Filter.from_dict(_item) for _item in obj.get("filters")] if obj.get("filters") is not None else None + }) + return _obj + + diff --git a/endpoint/labels_api/labels_api/py.typed b/endpoint/labels_api/labels_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/endpoint/labels_api/labels_api/rest.py b/endpoint/labels_api/labels_api/rest.py new file mode 100644 index 00000000..f182972f --- /dev/null +++ b/endpoint/labels_api/labels_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 labels_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) diff --git a/endpoint/labels_api/pyproject.toml b/endpoint/labels_api/pyproject.toml new file mode 100644 index 00000000..021db9bc --- /dev/null +++ b/endpoint/labels_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "labels_api" +version = "1.0.0" +description = "Endpoint Agent Labels API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Endpoint Agent Labels API"] +include = ["labels_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/endpoint/labels_api/requirements.txt b/endpoint/labels_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/endpoint/labels_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/endpoint/labels_api/setup.cfg b/endpoint/labels_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/endpoint/labels_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/endpoint/labels_api/setup.py b/endpoint/labels_api/setup.py new file mode 100644 index 00000000..05319250 --- /dev/null +++ b/endpoint/labels_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "labels-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Endpoint Agent Labels API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Endpoint Agent Labels API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + Manage labels applied to endpoint agents using this API. + """, # noqa: E501 + package_data={"labels_api": ["py.typed"]}, +) diff --git a/endpoint/labels_api/test-requirements.txt b/endpoint/labels_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/endpoint/labels_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/endpoint/labels_api/test/__init__.py b/endpoint/labels_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/endpoint/labels_api/test/test_endpoint_labels_list200_response.py b/endpoint/labels_api/test/test_endpoint_labels_list200_response.py new file mode 100644 index 00000000..4988d06d --- /dev/null +++ b/endpoint/labels_api/test/test_endpoint_labels_list200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.endpoint_labels_list200_response import EndpointLabelsList200Response + +class TestEndpointLabelsList200Response(unittest.TestCase): + """EndpointLabelsList200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointLabelsList200Response: + """Test EndpointLabelsList200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointLabelsList200Response` + """ + model = EndpointLabelsList200Response() + if include_optional: + return EndpointLabelsList200Response( + labels = [ + null + ], + links = labels_api.models.self_links__links.SelfLinks__links( + self = labels_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return EndpointLabelsList200Response( + ) + """ + + def testEndpointLabelsList200Response(self): + """Test EndpointLabelsList200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_error.py b/endpoint/labels_api/test/test_error.py new file mode 100644 index 00000000..b3955608 --- /dev/null +++ b/endpoint/labels_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_expand.py b/endpoint/labels_api/test/test_expand.py new file mode 100644 index 00000000..9b408e48 --- /dev/null +++ b/endpoint/labels_api/test/test_expand.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.expand import Expand + +class TestExpand(unittest.TestCase): + """Expand unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testExpand(self): + """Test Expand""" + # inst = Expand() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_filter.py b/endpoint/labels_api/test/test_filter.py new file mode 100644 index 00000000..3283424b --- /dev/null +++ b/endpoint/labels_api/test/test_filter.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.filter import Filter + +class TestFilter(unittest.TestCase): + """Filter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Filter: + """Test Filter + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Filter` + """ + model = Filter() + if include_optional: + return Filter( + key = 'vpn-client-network', + values = ["10.1.1.0/24","192.168.1.0/24"], + mode = 'in' + ) + else: + return Filter( + ) + """ + + def testFilter(self): + """Test Filter""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_filter_type.py b/endpoint/labels_api/test/test_filter_type.py new file mode 100644 index 00000000..6d240f55 --- /dev/null +++ b/endpoint/labels_api/test/test_filter_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.filter_type import FilterType + +class TestFilterType(unittest.TestCase): + """FilterType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFilterType(self): + """Test FilterType""" + # inst = FilterType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_label.py b/endpoint/labels_api/test/test_label.py new file mode 100644 index 00000000..56fd6083 --- /dev/null +++ b/endpoint/labels_api/test/test_label.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.label import Label + +class TestLabel(unittest.TestCase): + """Label unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Label: + """Test Label + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Label` + """ + model = Label() + if include_optional: + return Label( + id = 'abc-123-def', + name = 'Head office meeting rooms', + color = '#ff3333', + match_type = 'and', + filters = [ + labels_api.models.filter.Filter( + key = 'vpn-client-network', + values = ["10.1.1.0/24","192.168.1.0/24"], + mode = 'in', ) + ] + ) + else: + return Label( + ) + """ + + def testLabel(self): + """Test Label""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_label_filter_mode.py b/endpoint/labels_api/test/test_label_filter_mode.py new file mode 100644 index 00000000..df4966be --- /dev/null +++ b/endpoint/labels_api/test/test_label_filter_mode.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.label_filter_mode import LabelFilterMode + +class TestLabelFilterMode(unittest.TestCase): + """LabelFilterMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testLabelFilterMode(self): + """Test LabelFilterMode""" + # inst = LabelFilterMode() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_labels.py b/endpoint/labels_api/test/test_labels.py new file mode 100644 index 00000000..468ce40d --- /dev/null +++ b/endpoint/labels_api/test/test_labels.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.labels import Labels + +class TestLabels(unittest.TestCase): + """Labels unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Labels: + """Test Labels + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Labels` + """ + model = Labels() + if include_optional: + return Labels( + labels = [ + null + ] + ) + else: + return Labels( + ) + """ + + def testLabels(self): + """Test Labels""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_labels_labels_inner.py b/endpoint/labels_api/test/test_labels_labels_inner.py new file mode 100644 index 00000000..707f5ab0 --- /dev/null +++ b/endpoint/labels_api/test/test_labels_labels_inner.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.labels_labels_inner import LabelsLabelsInner + +class TestLabelsLabelsInner(unittest.TestCase): + """LabelsLabelsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LabelsLabelsInner: + """Test LabelsLabelsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LabelsLabelsInner` + """ + model = LabelsLabelsInner() + if include_optional: + return LabelsLabelsInner( + links = labels_api.models.self_links__links.SelfLinks__links( + self = labels_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + id = 'abc-123-def', + name = 'Head office meeting rooms', + color = '#ff3333', + match_type = 'and', + filters = [ + labels_api.models.filter.Filter( + key = 'vpn-client-network', + values = ["10.1.1.0/24","192.168.1.0/24"], + mode = 'in', ) + ] + ) + else: + return LabelsLabelsInner( + ) + """ + + def testLabelsLabelsInner(self): + """Test LabelsLabelsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_link.py b/endpoint/labels_api/test/test_link.py new file mode 100644 index 00000000..6cffe664 --- /dev/null +++ b/endpoint/labels_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_manage_labels_api.py b/endpoint/labels_api/test/test_manage_labels_api.py new file mode 100644 index 00000000..c92d13bf --- /dev/null +++ b/endpoint/labels_api/test/test_manage_labels_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest + +from labels_api.api.manage_labels_api import ManageLabelsApi + + +class TestManageLabelsApi(unittest.TestCase): + """ManageLabelsApi unit test stubs""" + + def setUp(self) -> None: + self.api = ManageLabelsApi() + + def tearDown(self) -> None: + pass + + def test_endpoint_label_delete(self) -> None: + """Test case for endpoint_label_delete + + Deletes label + """ + pass + + def test_endpoint_label_get(self) -> None: + """Test case for endpoint_label_get + + Retrieve label + """ + pass + + def test_endpoint_label_update(self) -> None: + """Test case for endpoint_label_update + + Update label + """ + pass + + def test_endpoint_labels_list(self) -> None: + """Test case for endpoint_labels_list + + List labels + """ + pass + + def test_v7_endpoint_labels_post(self) -> None: + """Test case for v7_endpoint_labels_post + + Create label + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_match_type.py b/endpoint/labels_api/test/test_match_type.py new file mode 100644 index 00000000..825de7bd --- /dev/null +++ b/endpoint/labels_api/test/test_match_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.match_type import MatchType + +class TestMatchType(unittest.TestCase): + """MatchType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMatchType(self): + """Test MatchType""" + # inst = MatchType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_pagination_next_link.py b/endpoint/labels_api/test/test_pagination_next_link.py new file mode 100644 index 00000000..78fcb90d --- /dev/null +++ b/endpoint/labels_api/test/test_pagination_next_link.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.pagination_next_link import PaginationNextLink + +class TestPaginationNextLink(unittest.TestCase): + """PaginationNextLink unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationNextLink: + """Test PaginationNextLink + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationNextLink` + """ + model = PaginationNextLink() + if include_optional: + return PaginationNextLink( + links = labels_api.models.pagination_next_link__links.PaginationNextLink__links( + next = labels_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return PaginationNextLink( + ) + """ + + def testPaginationNextLink(self): + """Test PaginationNextLink""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_pagination_next_link_links.py b/endpoint/labels_api/test/test_pagination_next_link_links.py new file mode 100644 index 00000000..abb6ee9c --- /dev/null +++ b/endpoint/labels_api/test/test_pagination_next_link_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.pagination_next_link_links import PaginationNextLinkLinks + +class TestPaginationNextLinkLinks(unittest.TestCase): + """PaginationNextLinkLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationNextLinkLinks: + """Test PaginationNextLinkLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationNextLinkLinks` + """ + model = PaginationNextLinkLinks() + if include_optional: + return PaginationNextLinkLinks( + next = labels_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return PaginationNextLinkLinks( + ) + """ + + def testPaginationNextLinkLinks(self): + """Test PaginationNextLinkLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_self_links.py b/endpoint/labels_api/test/test_self_links.py new file mode 100644 index 00000000..314419c2 --- /dev/null +++ b/endpoint/labels_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = labels_api.models.self_links__links.SelfLinks__links( + self = labels_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_self_links_links.py b/endpoint/labels_api/test/test_self_links_links.py new file mode 100644 index 00000000..e921396d --- /dev/null +++ b/endpoint/labels_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = labels_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_unauthorized_error.py b/endpoint/labels_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..c3eec945 --- /dev/null +++ b/endpoint/labels_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_v7_endpoint_labels_post201_response.py b/endpoint/labels_api/test/test_v7_endpoint_labels_post201_response.py new file mode 100644 index 00000000..79807755 --- /dev/null +++ b/endpoint/labels_api/test/test_v7_endpoint_labels_post201_response.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.v7_endpoint_labels_post201_response import V7EndpointLabelsPost201Response + +class TestV7EndpointLabelsPost201Response(unittest.TestCase): + """V7EndpointLabelsPost201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> V7EndpointLabelsPost201Response: + """Test V7EndpointLabelsPost201Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `V7EndpointLabelsPost201Response` + """ + model = V7EndpointLabelsPost201Response() + if include_optional: + return V7EndpointLabelsPost201Response( + id = 'abc-123-def', + name = 'Head office meeting rooms', + color = '#ff3333', + match_type = 'and', + filters = [ + labels_api.models.filter.Filter( + key = 'vpn-client-network', + values = ["10.1.1.0/24","192.168.1.0/24"], + mode = 'in', ) + ], + links = labels_api.models.self_links__links.SelfLinks__links( + self = labels_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return V7EndpointLabelsPost201Response( + ) + """ + + def testV7EndpointLabelsPost201Response(self): + """Test V7EndpointLabelsPost201Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/test/test_v7_endpoint_labels_post_request.py b/endpoint/labels_api/test/test_v7_endpoint_labels_post_request.py new file mode 100644 index 00000000..b23c3d6f --- /dev/null +++ b/endpoint/labels_api/test/test_v7_endpoint_labels_post_request.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + 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 unittest +import datetime + +from labels_api.models.v7_endpoint_labels_post_request import V7EndpointLabelsPostRequest + +class TestV7EndpointLabelsPostRequest(unittest.TestCase): + """V7EndpointLabelsPostRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> V7EndpointLabelsPostRequest: + """Test V7EndpointLabelsPostRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `V7EndpointLabelsPostRequest` + """ + model = V7EndpointLabelsPostRequest() + if include_optional: + return V7EndpointLabelsPostRequest( + id = 'abc-123-def', + name = 'Head office meeting rooms', + color = '#ff3333', + match_type = 'and', + filters = [ + labels_api.models.filter.Filter( + key = 'vpn-client-network', + values = ["10.1.1.0/24","192.168.1.0/24"], + mode = 'in', ) + ] + ) + else: + return V7EndpointLabelsPostRequest( + name = 'Head office meeting rooms', + match_type = 'and', + filters = [ + labels_api.models.filter.Filter( + key = 'vpn-client-network', + values = ["10.1.1.0/24","192.168.1.0/24"], + mode = 'in', ) + ], + ) + """ + + def testV7EndpointLabelsPostRequest(self): + """Test V7EndpointLabelsPostRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/labels_api/tox.ini b/endpoint/labels_api/tox.ini new file mode 100644 index 00000000..61ac7d6b --- /dev/null +++ b/endpoint/labels_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=labels_api diff --git a/endpoint/test_results_api/.github/workflows/python.yml b/endpoint/test_results_api/.github/workflows/python.yml new file mode 100644 index 00000000..f2ad1718 --- /dev/null +++ b/endpoint/test_results_api/.github/workflows/python.yml @@ -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: test_results_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 diff --git a/endpoint/test_results_api/.gitignore b/endpoint/test_results_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/endpoint/test_results_api/.gitignore @@ -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 diff --git a/endpoint/test_results_api/.gitlab-ci.yml b/endpoint/test_results_api/.gitlab-ci.yml new file mode 100644 index 00000000..90ae7365 --- /dev/null +++ b/endpoint/test_results_api/.gitlab-ci.yml @@ -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=test_results_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 diff --git a/endpoint/test_results_api/.openapi-generator-ignore b/endpoint/test_results_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/endpoint/test_results_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/endpoint/test_results_api/.openapi-generator/FILES b/endpoint/test_results_api/.openapi-generator/FILES new file mode 100644 index 00000000..ff5600a4 --- /dev/null +++ b/endpoint/test_results_api/.openapi-generator/FILES @@ -0,0 +1,482 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/AccountGroupId.md +docs/AgentLabelsSelectorType.md +docs/AllAgentsSelectorType.md +docs/ApplicationScoreQuality.md +docs/AsnDetails.md +docs/ConditionalOperator.md +docs/CpuUtilization.md +docs/DynamicBaseTestResult.md +docs/DynamicBaseTestResultWebex.md +docs/DynamicTest.md +docs/DynamicTestApplication.md +docs/DynamicTestLinks.md +docs/DynamicTestLinksSelf.md +docs/DynamicTestLinksTestResults.md +docs/DynamicTestsDataRoundSearch.md +docs/DynamicTestsDataSearchFilter.md +docs/EndpointAgentLabelsSelectorConfig.md +docs/EndpointAgentSelectorConfig.md +docs/EndpointAgentToServerTest.md +docs/EndpointAgentToServerType.md +docs/EndpointAllAgentsSelectorConfig.md +docs/EndpointBrowser.md +docs/EndpointHttpDataPointScore.md +docs/EndpointHttpServerBaseTest.md +docs/EndpointHttpServerTest.md +docs/EndpointHttpServerType.md +docs/EndpointNetworkTopologyResultRequestFilter.md +docs/EndpointPingDataPointScore.md +docs/EndpointRealUserTest.md +docs/EndpointRealUserTestBase.md +docs/EndpointRealUserTestDetail.md +docs/EndpointRealUserTestDetailResults.md +docs/EndpointRealUserTestResultRequestFilter.md +docs/EndpointRealUserTestResults.md +docs/EndpointResultRequestFilter.md +docs/EndpointScheduledTest.md +docs/EndpointScheduledTestType.md +docs/EndpointSpecificAgentsSelectorConfig.md +docs/EndpointTest.md +docs/EndpointTestAid.md +docs/EndpointTestAuthType.md +docs/EndpointTestLinks.md +docs/EndpointTestLinksSelf.md +docs/EndpointTestLinksTestResults.md +docs/EndpointTestProtocol.md +docs/Error.md +docs/EthernetProfile.md +docs/Expand.md +docs/GetDynamicTestResultNetworkPathvis200Response.md +docs/GetDynamicTestResultPathvisAgentRound200Response.md +docs/GetEndpointLocalNetworkTopologyDetails200Response.md +docs/GetEndpointLocalNetworks200Response.md +docs/GetEndpointLocalNetworksTopologies200Response.md +docs/GetEndpointLocalNetworksTopologiesRequest.md +docs/GetEndpointRealUserTestDetails200Response.md +docs/GetEndpointRealUserTestPagesDetails200Response.md +docs/GetEndpointRealUserTests200Response.md +docs/GetEndpointRealUserTestsNetwork200Response.md +docs/GetEndpointRealUserTestsPages200Response.md +docs/GetEndpointRealUserTestsRequest.md +docs/GetTestResultHttpServer200Response.md +docs/GetTestResultNetworkPathvis200Response.md +docs/GetTestResultPathvisAgentRound200Response.md +docs/Hop.md +docs/HttpErrorType.md +docs/HttpTestResult.md +docs/HttpTestResultHeaders.md +docs/HttpTestResults.md +docs/InterfaceHardwareType.md +docs/Link.md +docs/LocalNetworkResult.md +docs/LocalNetworkResults.md +docs/LocalNetworkTestsResultsApi.md +docs/LocalNetworkTopologyDetailResults.md +docs/LocalNetworkTopologyResult.md +docs/LocalNetworkTopologyResultBase.md +docs/LocalNetworkTopologyResults.md +docs/MultiTestIdNetworkTestResults.md +docs/MultiTestIdTestsDataRoundsSearch.md +docs/MultiTestIdTestsDataSearchFilter.md +docs/NetworkDynamicTestResult.md +docs/NetworkDynamicTestResults.md +docs/NetworkDynamicTestsResultsApi.md +docs/NetworkInterface.md +docs/NetworkMetrics.md +docs/NetworkPing.md +docs/NetworkProfile.md +docs/NetworkProxyProfile.md +docs/NetworkProxyProfileProxiesInner.md +docs/NetworkScheduledTestsResultsApi.md +docs/NetworkTestResult.md +docs/NetworkTestResults.md +docs/NetworkTopologyType.md +docs/NetworkWirelessProfile.md +docs/PaginationNextLink.md +docs/PaginationNextLinkLinks.md +docs/PathVisBaseTestResult.md +docs/PathVisDetailDynamicTestResult.md +docs/PathVisDetailDynamicTestResults.md +docs/PathVisDetailTestResult.md +docs/PathVisDetailTestResults.md +docs/PathVisDynamicTestResult.md +docs/PathVisDynamicTestResults.md +docs/PathVisEndpoint.md +docs/PathVisHop.md +docs/PathVisRoute.md +docs/PathVisTestResult.md +docs/PathVisTestResults.md +docs/PhysicalMemoryUsedBytes.md +docs/Platform.md +docs/PostFetchDynamicTestResultMetrics200Response.md +docs/PostFetchTestResultMetrics200Response.md +docs/PostFetchTestResultMetricsMultiTest200Response.md +docs/QueryWindow.md +docs/RealUserTestCoordinates.md +docs/RealUserTestNetwork.md +docs/RealUserTestNetworkGatewayPing.md +docs/RealUserTestNetworkPing.md +docs/RealUserTestNetworkResult.md +docs/RealUserTestNetworkResults.md +docs/RealUserTestNetworkTraceroute.md +docs/RealUserTestNetworkVpnPing.md +docs/RealUserTestNetworkVpnTraceroute.md +docs/RealUserTestPage.md +docs/RealUserTestPagePageTimings.md +docs/RealUserTestPageResult.md +docs/RealUserTestPageResults.md +docs/RealUserTestsResultsApi.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/SortOrder.md +docs/SpecificAgentsSelectorType.md +docs/SystemMetrics.md +docs/TcpConnect.md +docs/TestInterval.md +docs/TestProbeMode.md +docs/TestResult.md +docs/TestSslVersionId.md +docs/TestsDataRoundsSearch.md +docs/TestsDataSearchFilter.md +docs/TestsDataSearchSort.md +docs/TestsDataSearchSortKey.md +docs/TestsDataThresholdFilter.md +docs/TestsDataThresholdFilters.md +docs/ThresholdFilterName.md +docs/ThresholdFilterOperator.md +docs/Traceroute.md +docs/TracerouteHop.md +docs/Trigger.md +docs/UnauthorizedError.md +docs/VpnProfile.md +docs/VpnType.md +docs/WebHTTPServerScheduledTestResultsApi.md +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_account_group_id.py +test/test_agent_labels_selector_type.py +test/test_all_agents_selector_type.py +test/test_application_score_quality.py +test/test_asn_details.py +test/test_conditional_operator.py +test/test_cpu_utilization.py +test/test_dynamic_base_test_result.py +test/test_dynamic_base_test_result_webex.py +test/test_dynamic_test.py +test/test_dynamic_test_application.py +test/test_dynamic_test_links.py +test/test_dynamic_test_links_self.py +test/test_dynamic_test_links_test_results.py +test/test_dynamic_tests_data_round_search.py +test/test_dynamic_tests_data_search_filter.py +test/test_endpoint_agent_labels_selector_config.py +test/test_endpoint_agent_selector_config.py +test/test_endpoint_agent_to_server_test.py +test/test_endpoint_agent_to_server_type.py +test/test_endpoint_all_agents_selector_config.py +test/test_endpoint_browser.py +test/test_endpoint_http_data_point_score.py +test/test_endpoint_http_server_base_test.py +test/test_endpoint_http_server_test.py +test/test_endpoint_http_server_type.py +test/test_endpoint_network_topology_result_request_filter.py +test/test_endpoint_ping_data_point_score.py +test/test_endpoint_real_user_test.py +test/test_endpoint_real_user_test_base.py +test/test_endpoint_real_user_test_detail.py +test/test_endpoint_real_user_test_detail_results.py +test/test_endpoint_real_user_test_result_request_filter.py +test/test_endpoint_real_user_test_results.py +test/test_endpoint_result_request_filter.py +test/test_endpoint_scheduled_test.py +test/test_endpoint_scheduled_test_type.py +test/test_endpoint_specific_agents_selector_config.py +test/test_endpoint_test.py +test/test_endpoint_test_aid.py +test/test_endpoint_test_auth_type.py +test/test_endpoint_test_links.py +test/test_endpoint_test_links_self.py +test/test_endpoint_test_links_test_results.py +test/test_endpoint_test_protocol.py +test/test_error.py +test/test_ethernet_profile.py +test/test_expand.py +test/test_get_dynamic_test_result_network_pathvis200_response.py +test/test_get_dynamic_test_result_pathvis_agent_round200_response.py +test/test_get_endpoint_local_network_topology_details200_response.py +test/test_get_endpoint_local_networks200_response.py +test/test_get_endpoint_local_networks_topologies200_response.py +test/test_get_endpoint_local_networks_topologies_request.py +test/test_get_endpoint_real_user_test_details200_response.py +test/test_get_endpoint_real_user_test_pages_details200_response.py +test/test_get_endpoint_real_user_tests200_response.py +test/test_get_endpoint_real_user_tests_network200_response.py +test/test_get_endpoint_real_user_tests_pages200_response.py +test/test_get_endpoint_real_user_tests_request.py +test/test_get_test_result_http_server200_response.py +test/test_get_test_result_network_pathvis200_response.py +test/test_get_test_result_pathvis_agent_round200_response.py +test/test_hop.py +test/test_http_error_type.py +test/test_http_test_result.py +test/test_http_test_result_headers.py +test/test_http_test_results.py +test/test_interface_hardware_type.py +test/test_link.py +test/test_local_network_result.py +test/test_local_network_results.py +test/test_local_network_tests_results_api.py +test/test_local_network_topology_detail_results.py +test/test_local_network_topology_result.py +test/test_local_network_topology_result_base.py +test/test_local_network_topology_results.py +test/test_multi_test_id_network_test_results.py +test/test_multi_test_id_tests_data_rounds_search.py +test/test_multi_test_id_tests_data_search_filter.py +test/test_network_dynamic_test_result.py +test/test_network_dynamic_test_results.py +test/test_network_dynamic_tests_results_api.py +test/test_network_interface.py +test/test_network_metrics.py +test/test_network_ping.py +test/test_network_profile.py +test/test_network_proxy_profile.py +test/test_network_proxy_profile_proxies_inner.py +test/test_network_scheduled_tests_results_api.py +test/test_network_test_result.py +test/test_network_test_results.py +test/test_network_topology_type.py +test/test_network_wireless_profile.py +test/test_pagination_next_link.py +test/test_pagination_next_link_links.py +test/test_path_vis_base_test_result.py +test/test_path_vis_detail_dynamic_test_result.py +test/test_path_vis_detail_dynamic_test_results.py +test/test_path_vis_detail_test_result.py +test/test_path_vis_detail_test_results.py +test/test_path_vis_dynamic_test_result.py +test/test_path_vis_dynamic_test_results.py +test/test_path_vis_endpoint.py +test/test_path_vis_hop.py +test/test_path_vis_route.py +test/test_path_vis_test_result.py +test/test_path_vis_test_results.py +test/test_physical_memory_used_bytes.py +test/test_platform.py +test/test_post_fetch_dynamic_test_result_metrics200_response.py +test/test_post_fetch_test_result_metrics200_response.py +test/test_post_fetch_test_result_metrics_multi_test200_response.py +test/test_query_window.py +test/test_real_user_test_coordinates.py +test/test_real_user_test_network.py +test/test_real_user_test_network_gateway_ping.py +test/test_real_user_test_network_ping.py +test/test_real_user_test_network_result.py +test/test_real_user_test_network_results.py +test/test_real_user_test_network_traceroute.py +test/test_real_user_test_network_vpn_ping.py +test/test_real_user_test_network_vpn_traceroute.py +test/test_real_user_test_page.py +test/test_real_user_test_page_page_timings.py +test/test_real_user_test_page_result.py +test/test_real_user_test_page_results.py +test/test_real_user_tests_results_api.py +test/test_self_links.py +test/test_self_links_links.py +test/test_sort_order.py +test/test_specific_agents_selector_type.py +test/test_system_metrics.py +test/test_tcp_connect.py +test/test_test_interval.py +test/test_test_probe_mode.py +test/test_test_result.py +test/test_test_ssl_version_id.py +test/test_tests_data_rounds_search.py +test/test_tests_data_search_filter.py +test/test_tests_data_search_sort.py +test/test_tests_data_search_sort_key.py +test/test_tests_data_threshold_filter.py +test/test_tests_data_threshold_filters.py +test/test_threshold_filter_name.py +test/test_threshold_filter_operator.py +test/test_traceroute.py +test/test_traceroute_hop.py +test/test_trigger.py +test/test_unauthorized_error.py +test/test_vpn_profile.py +test/test_vpn_type.py +test/test_web_http_server_scheduled_test_results_api.py +test_results_api/__init__.py +test_results_api/api/__init__.py +test_results_api/api/local_network_tests_results_api.py +test_results_api/api/network_dynamic_tests_results_api.py +test_results_api/api/network_scheduled_tests_results_api.py +test_results_api/api/real_user_tests_results_api.py +test_results_api/api/web_http_server_scheduled_test_results_api.py +test_results_api/api_client.py +test_results_api/api_response.py +test_results_api/configuration.py +test_results_api/exceptions.py +test_results_api/models/__init__.py +test_results_api/models/account_group_id.py +test_results_api/models/agent_labels_selector_type.py +test_results_api/models/all_agents_selector_type.py +test_results_api/models/application_score_quality.py +test_results_api/models/asn_details.py +test_results_api/models/conditional_operator.py +test_results_api/models/cpu_utilization.py +test_results_api/models/dynamic_base_test_result.py +test_results_api/models/dynamic_base_test_result_webex.py +test_results_api/models/dynamic_test.py +test_results_api/models/dynamic_test_application.py +test_results_api/models/dynamic_test_links.py +test_results_api/models/dynamic_test_links_self.py +test_results_api/models/dynamic_test_links_test_results.py +test_results_api/models/dynamic_tests_data_round_search.py +test_results_api/models/dynamic_tests_data_search_filter.py +test_results_api/models/endpoint_agent_labels_selector_config.py +test_results_api/models/endpoint_agent_selector_config.py +test_results_api/models/endpoint_agent_to_server_test.py +test_results_api/models/endpoint_agent_to_server_type.py +test_results_api/models/endpoint_all_agents_selector_config.py +test_results_api/models/endpoint_browser.py +test_results_api/models/endpoint_http_data_point_score.py +test_results_api/models/endpoint_http_server_base_test.py +test_results_api/models/endpoint_http_server_test.py +test_results_api/models/endpoint_http_server_type.py +test_results_api/models/endpoint_network_topology_result_request_filter.py +test_results_api/models/endpoint_ping_data_point_score.py +test_results_api/models/endpoint_real_user_test.py +test_results_api/models/endpoint_real_user_test_base.py +test_results_api/models/endpoint_real_user_test_detail.py +test_results_api/models/endpoint_real_user_test_detail_results.py +test_results_api/models/endpoint_real_user_test_result_request_filter.py +test_results_api/models/endpoint_real_user_test_results.py +test_results_api/models/endpoint_result_request_filter.py +test_results_api/models/endpoint_scheduled_test.py +test_results_api/models/endpoint_scheduled_test_type.py +test_results_api/models/endpoint_specific_agents_selector_config.py +test_results_api/models/endpoint_test.py +test_results_api/models/endpoint_test_aid.py +test_results_api/models/endpoint_test_auth_type.py +test_results_api/models/endpoint_test_links.py +test_results_api/models/endpoint_test_links_self.py +test_results_api/models/endpoint_test_links_test_results.py +test_results_api/models/endpoint_test_protocol.py +test_results_api/models/error.py +test_results_api/models/ethernet_profile.py +test_results_api/models/expand.py +test_results_api/models/get_dynamic_test_result_network_pathvis200_response.py +test_results_api/models/get_dynamic_test_result_pathvis_agent_round200_response.py +test_results_api/models/get_endpoint_local_network_topology_details200_response.py +test_results_api/models/get_endpoint_local_networks200_response.py +test_results_api/models/get_endpoint_local_networks_topologies200_response.py +test_results_api/models/get_endpoint_local_networks_topologies_request.py +test_results_api/models/get_endpoint_real_user_test_details200_response.py +test_results_api/models/get_endpoint_real_user_test_pages_details200_response.py +test_results_api/models/get_endpoint_real_user_tests200_response.py +test_results_api/models/get_endpoint_real_user_tests_network200_response.py +test_results_api/models/get_endpoint_real_user_tests_pages200_response.py +test_results_api/models/get_endpoint_real_user_tests_request.py +test_results_api/models/get_test_result_http_server200_response.py +test_results_api/models/get_test_result_network_pathvis200_response.py +test_results_api/models/get_test_result_pathvis_agent_round200_response.py +test_results_api/models/hop.py +test_results_api/models/http_error_type.py +test_results_api/models/http_test_result.py +test_results_api/models/http_test_result_headers.py +test_results_api/models/http_test_results.py +test_results_api/models/interface_hardware_type.py +test_results_api/models/link.py +test_results_api/models/local_network_result.py +test_results_api/models/local_network_results.py +test_results_api/models/local_network_topology_detail_results.py +test_results_api/models/local_network_topology_result.py +test_results_api/models/local_network_topology_result_base.py +test_results_api/models/local_network_topology_results.py +test_results_api/models/multi_test_id_network_test_results.py +test_results_api/models/multi_test_id_tests_data_rounds_search.py +test_results_api/models/multi_test_id_tests_data_search_filter.py +test_results_api/models/network_dynamic_test_result.py +test_results_api/models/network_dynamic_test_results.py +test_results_api/models/network_interface.py +test_results_api/models/network_metrics.py +test_results_api/models/network_ping.py +test_results_api/models/network_profile.py +test_results_api/models/network_proxy_profile.py +test_results_api/models/network_proxy_profile_proxies_inner.py +test_results_api/models/network_test_result.py +test_results_api/models/network_test_results.py +test_results_api/models/network_topology_type.py +test_results_api/models/network_wireless_profile.py +test_results_api/models/pagination_next_link.py +test_results_api/models/pagination_next_link_links.py +test_results_api/models/path_vis_base_test_result.py +test_results_api/models/path_vis_detail_dynamic_test_result.py +test_results_api/models/path_vis_detail_dynamic_test_results.py +test_results_api/models/path_vis_detail_test_result.py +test_results_api/models/path_vis_detail_test_results.py +test_results_api/models/path_vis_dynamic_test_result.py +test_results_api/models/path_vis_dynamic_test_results.py +test_results_api/models/path_vis_endpoint.py +test_results_api/models/path_vis_hop.py +test_results_api/models/path_vis_route.py +test_results_api/models/path_vis_test_result.py +test_results_api/models/path_vis_test_results.py +test_results_api/models/physical_memory_used_bytes.py +test_results_api/models/platform.py +test_results_api/models/post_fetch_dynamic_test_result_metrics200_response.py +test_results_api/models/post_fetch_test_result_metrics200_response.py +test_results_api/models/post_fetch_test_result_metrics_multi_test200_response.py +test_results_api/models/query_window.py +test_results_api/models/real_user_test_coordinates.py +test_results_api/models/real_user_test_network.py +test_results_api/models/real_user_test_network_gateway_ping.py +test_results_api/models/real_user_test_network_ping.py +test_results_api/models/real_user_test_network_result.py +test_results_api/models/real_user_test_network_results.py +test_results_api/models/real_user_test_network_traceroute.py +test_results_api/models/real_user_test_network_vpn_ping.py +test_results_api/models/real_user_test_network_vpn_traceroute.py +test_results_api/models/real_user_test_page.py +test_results_api/models/real_user_test_page_page_timings.py +test_results_api/models/real_user_test_page_result.py +test_results_api/models/real_user_test_page_results.py +test_results_api/models/self_links.py +test_results_api/models/self_links_links.py +test_results_api/models/sort_order.py +test_results_api/models/specific_agents_selector_type.py +test_results_api/models/system_metrics.py +test_results_api/models/tcp_connect.py +test_results_api/models/test_interval.py +test_results_api/models/test_probe_mode.py +test_results_api/models/test_result.py +test_results_api/models/test_ssl_version_id.py +test_results_api/models/tests_data_rounds_search.py +test_results_api/models/tests_data_search_filter.py +test_results_api/models/tests_data_search_sort.py +test_results_api/models/tests_data_search_sort_key.py +test_results_api/models/tests_data_threshold_filter.py +test_results_api/models/tests_data_threshold_filters.py +test_results_api/models/threshold_filter_name.py +test_results_api/models/threshold_filter_operator.py +test_results_api/models/traceroute.py +test_results_api/models/traceroute_hop.py +test_results_api/models/trigger.py +test_results_api/models/unauthorized_error.py +test_results_api/models/vpn_profile.py +test_results_api/models/vpn_type.py +test_results_api/py.typed +test_results_api/rest.py +tox.ini diff --git a/endpoint/test_results_api/.openapi-generator/VERSION b/endpoint/test_results_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/endpoint/test_results_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/endpoint/test_results_api/.travis.yml b/endpoint/test_results_api/.travis.yml new file mode 100644 index 00000000..bebf5aee --- /dev/null +++ b/endpoint/test_results_api/.travis.yml @@ -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=test_results_api diff --git a/endpoint/test_results_api/README.md b/endpoint/test_results_api/README.md new file mode 100644 index 00000000..35744707 --- /dev/null +++ b/endpoint/test_results_api/README.md @@ -0,0 +1,283 @@ +# test-results-api +Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_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 test_results_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 test_results_api +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.LocalNetworkTestsResultsApi(api_client) + network_topology_id = '00160:39c518560de9:1491651900:236e6f18' # str | The network topology ID. + 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 endpoint local network topology + api_response = api_instance.get_endpoint_local_network_topology_details(network_topology_id, aid=aid) + print("The response of LocalNetworkTestsResultsApi->get_endpoint_local_network_topology_details:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling LocalNetworkTestsResultsApi->get_endpoint_local_network_topology_details: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*LocalNetworkTestsResultsApi* | [**get_endpoint_local_network_topology_details**](docs/LocalNetworkTestsResultsApi.md#get_endpoint_local_network_topology_details) | **GET** /v7/endpoint/test-results/local-networks/topologies/{networkTopologyId} | Retrieve endpoint local network topology +*LocalNetworkTestsResultsApi* | [**get_endpoint_local_networks**](docs/LocalNetworkTestsResultsApi.md#get_endpoint_local_networks) | **GET** /v7/endpoint/test-results/local-networks | List local networks +*LocalNetworkTestsResultsApi* | [**get_endpoint_local_networks_topologies**](docs/LocalNetworkTestsResultsApi.md#get_endpoint_local_networks_topologies) | **POST** /v7/endpoint/test-results/local-networks/topologies/filter | List endpoint network topologies probes +*NetworkDynamicTestsResultsApi* | [**get_dynamic_test_result_network_pathvis**](docs/NetworkDynamicTestsResultsApi.md#get_dynamic_test_result_network_pathvis) | **GET** /v7/endpoint/test-results/dynamic-tests/{testId}/pathvis | Retrieve pathvis network dynamic test results +*NetworkDynamicTestsResultsApi* | [**get_dynamic_test_result_pathvis_agent_round**](docs/NetworkDynamicTestsResultsApi.md#get_dynamic_test_result_pathvis_agent_round) | **GET** /v7/endpoint/test-results/dynamic-tests/{testId}/pathvis/agent/{agentId}/round/{roundId} | Retrieve pathvis network dynamic test results details +*NetworkDynamicTestsResultsApi* | [**post_fetch_dynamic_test_result_metrics**](docs/NetworkDynamicTestsResultsApi.md#post_fetch_dynamic_test_result_metrics) | **POST** /v7/endpoint/test-results/dynamic-tests/{testId}/network/filter | Retrieve network dynamic test results +*NetworkScheduledTestsResultsApi* | [**get_test_result_network_pathvis**](docs/NetworkScheduledTestsResultsApi.md#get_test_result_network_pathvis) | **GET** /v7/endpoint/test-results/scheduled-tests/{testId}/pathvis | Retrieve pathvis network scheduled test results +*NetworkScheduledTestsResultsApi* | [**get_test_result_pathvis_agent_round**](docs/NetworkScheduledTestsResultsApi.md#get_test_result_pathvis_agent_round) | **GET** /v7/endpoint/test-results/scheduled-tests/{testId}/pathvis/agent/{agentId}/round/{roundId} | Retrieve pathvis network scheduled test results details +*NetworkScheduledTestsResultsApi* | [**post_fetch_test_result_metrics**](docs/NetworkScheduledTestsResultsApi.md#post_fetch_test_result_metrics) | **POST** /v7/endpoint/test-results/scheduled-tests/{testId}/network/filter | Retrieve network scheduled test results +*NetworkScheduledTestsResultsApi* | [**post_fetch_test_result_metrics_multi_test**](docs/NetworkScheduledTestsResultsApi.md#post_fetch_test_result_metrics_multi_test) | **POST** /v7/endpoint/test-results/scheduled-tests/network/filter | Retrieve network scheduled test results from multiple tests +*RealUserTestsResultsApi* | [**get_endpoint_real_user_test_details**](docs/RealUserTestsResultsApi.md#get_endpoint_real_user_test_details) | **GET** /v7/endpoint/test-results/real-user-tests/{id} | Retrieve endpoint real user test +*RealUserTestsResultsApi* | [**get_endpoint_real_user_test_pages_details**](docs/RealUserTestsResultsApi.md#get_endpoint_real_user_test_pages_details) | **GET** /v7/endpoint/test-results/real-user-tests/{id}/pages/{pageId} | Retrieve endpoint real user test page +*RealUserTestsResultsApi* | [**get_endpoint_real_user_tests**](docs/RealUserTestsResultsApi.md#get_endpoint_real_user_tests) | **POST** /v7/endpoint/test-results/real-user-tests/filter | List endpoint real user tests +*RealUserTestsResultsApi* | [**get_endpoint_real_user_tests_network**](docs/RealUserTestsResultsApi.md#get_endpoint_real_user_tests_network) | **POST** /v7/endpoint/test-results/real-user-tests/networks/filter | List endpoint real user tests +*RealUserTestsResultsApi* | [**get_endpoint_real_user_tests_pages**](docs/RealUserTestsResultsApi.md#get_endpoint_real_user_tests_pages) | **POST** /v7/endpoint/test-results/real-user-tests/pages/filter | List endpoint real user tests visited pages +*WebHTTPServerScheduledTestResultsApi* | [**get_test_result_http_server**](docs/WebHTTPServerScheduledTestResultsApi.md#get_test_result_http_server) | **GET** /v7/endpoint/test-results/scheduled-tests/{testId}/http-server | Retrieve HTTP server scheduled test results + + +## Documentation For Models + + - [AccountGroupId](docs/AccountGroupId.md) + - [AgentLabelsSelectorType](docs/AgentLabelsSelectorType.md) + - [AllAgentsSelectorType](docs/AllAgentsSelectorType.md) + - [ApplicationScoreQuality](docs/ApplicationScoreQuality.md) + - [AsnDetails](docs/AsnDetails.md) + - [ConditionalOperator](docs/ConditionalOperator.md) + - [CpuUtilization](docs/CpuUtilization.md) + - [DynamicBaseTestResult](docs/DynamicBaseTestResult.md) + - [DynamicBaseTestResultWebex](docs/DynamicBaseTestResultWebex.md) + - [DynamicTest](docs/DynamicTest.md) + - [DynamicTestApplication](docs/DynamicTestApplication.md) + - [DynamicTestLinks](docs/DynamicTestLinks.md) + - [DynamicTestLinksSelf](docs/DynamicTestLinksSelf.md) + - [DynamicTestLinksTestResults](docs/DynamicTestLinksTestResults.md) + - [DynamicTestsDataRoundSearch](docs/DynamicTestsDataRoundSearch.md) + - [DynamicTestsDataSearchFilter](docs/DynamicTestsDataSearchFilter.md) + - [EndpointAgentLabelsSelectorConfig](docs/EndpointAgentLabelsSelectorConfig.md) + - [EndpointAgentSelectorConfig](docs/EndpointAgentSelectorConfig.md) + - [EndpointAgentToServerTest](docs/EndpointAgentToServerTest.md) + - [EndpointAgentToServerType](docs/EndpointAgentToServerType.md) + - [EndpointAllAgentsSelectorConfig](docs/EndpointAllAgentsSelectorConfig.md) + - [EndpointBrowser](docs/EndpointBrowser.md) + - [EndpointHttpDataPointScore](docs/EndpointHttpDataPointScore.md) + - [EndpointHttpServerBaseTest](docs/EndpointHttpServerBaseTest.md) + - [EndpointHttpServerTest](docs/EndpointHttpServerTest.md) + - [EndpointHttpServerType](docs/EndpointHttpServerType.md) + - [EndpointNetworkTopologyResultRequestFilter](docs/EndpointNetworkTopologyResultRequestFilter.md) + - [EndpointPingDataPointScore](docs/EndpointPingDataPointScore.md) + - [EndpointRealUserTest](docs/EndpointRealUserTest.md) + - [EndpointRealUserTestBase](docs/EndpointRealUserTestBase.md) + - [EndpointRealUserTestDetail](docs/EndpointRealUserTestDetail.md) + - [EndpointRealUserTestDetailResults](docs/EndpointRealUserTestDetailResults.md) + - [EndpointRealUserTestResultRequestFilter](docs/EndpointRealUserTestResultRequestFilter.md) + - [EndpointRealUserTestResults](docs/EndpointRealUserTestResults.md) + - [EndpointResultRequestFilter](docs/EndpointResultRequestFilter.md) + - [EndpointScheduledTest](docs/EndpointScheduledTest.md) + - [EndpointScheduledTestType](docs/EndpointScheduledTestType.md) + - [EndpointSpecificAgentsSelectorConfig](docs/EndpointSpecificAgentsSelectorConfig.md) + - [EndpointTest](docs/EndpointTest.md) + - [EndpointTestAid](docs/EndpointTestAid.md) + - [EndpointTestAuthType](docs/EndpointTestAuthType.md) + - [EndpointTestLinks](docs/EndpointTestLinks.md) + - [EndpointTestLinksSelf](docs/EndpointTestLinksSelf.md) + - [EndpointTestLinksTestResults](docs/EndpointTestLinksTestResults.md) + - [EndpointTestProtocol](docs/EndpointTestProtocol.md) + - [Error](docs/Error.md) + - [EthernetProfile](docs/EthernetProfile.md) + - [Expand](docs/Expand.md) + - [GetDynamicTestResultNetworkPathvis200Response](docs/GetDynamicTestResultNetworkPathvis200Response.md) + - [GetDynamicTestResultPathvisAgentRound200Response](docs/GetDynamicTestResultPathvisAgentRound200Response.md) + - [GetEndpointLocalNetworkTopologyDetails200Response](docs/GetEndpointLocalNetworkTopologyDetails200Response.md) + - [GetEndpointLocalNetworks200Response](docs/GetEndpointLocalNetworks200Response.md) + - [GetEndpointLocalNetworksTopologies200Response](docs/GetEndpointLocalNetworksTopologies200Response.md) + - [GetEndpointLocalNetworksTopologiesRequest](docs/GetEndpointLocalNetworksTopologiesRequest.md) + - [GetEndpointRealUserTestDetails200Response](docs/GetEndpointRealUserTestDetails200Response.md) + - [GetEndpointRealUserTestPagesDetails200Response](docs/GetEndpointRealUserTestPagesDetails200Response.md) + - [GetEndpointRealUserTests200Response](docs/GetEndpointRealUserTests200Response.md) + - [GetEndpointRealUserTestsNetwork200Response](docs/GetEndpointRealUserTestsNetwork200Response.md) + - [GetEndpointRealUserTestsPages200Response](docs/GetEndpointRealUserTestsPages200Response.md) + - [GetEndpointRealUserTestsRequest](docs/GetEndpointRealUserTestsRequest.md) + - [GetTestResultHttpServer200Response](docs/GetTestResultHttpServer200Response.md) + - [GetTestResultNetworkPathvis200Response](docs/GetTestResultNetworkPathvis200Response.md) + - [GetTestResultPathvisAgentRound200Response](docs/GetTestResultPathvisAgentRound200Response.md) + - [Hop](docs/Hop.md) + - [HttpErrorType](docs/HttpErrorType.md) + - [HttpTestResult](docs/HttpTestResult.md) + - [HttpTestResultHeaders](docs/HttpTestResultHeaders.md) + - [HttpTestResults](docs/HttpTestResults.md) + - [InterfaceHardwareType](docs/InterfaceHardwareType.md) + - [Link](docs/Link.md) + - [LocalNetworkResult](docs/LocalNetworkResult.md) + - [LocalNetworkResults](docs/LocalNetworkResults.md) + - [LocalNetworkTopologyDetailResults](docs/LocalNetworkTopologyDetailResults.md) + - [LocalNetworkTopologyResult](docs/LocalNetworkTopologyResult.md) + - [LocalNetworkTopologyResultBase](docs/LocalNetworkTopologyResultBase.md) + - [LocalNetworkTopologyResults](docs/LocalNetworkTopologyResults.md) + - [MultiTestIdNetworkTestResults](docs/MultiTestIdNetworkTestResults.md) + - [MultiTestIdTestsDataRoundsSearch](docs/MultiTestIdTestsDataRoundsSearch.md) + - [MultiTestIdTestsDataSearchFilter](docs/MultiTestIdTestsDataSearchFilter.md) + - [NetworkDynamicTestResult](docs/NetworkDynamicTestResult.md) + - [NetworkDynamicTestResults](docs/NetworkDynamicTestResults.md) + - [NetworkInterface](docs/NetworkInterface.md) + - [NetworkMetrics](docs/NetworkMetrics.md) + - [NetworkPing](docs/NetworkPing.md) + - [NetworkProfile](docs/NetworkProfile.md) + - [NetworkProxyProfile](docs/NetworkProxyProfile.md) + - [NetworkProxyProfileProxiesInner](docs/NetworkProxyProfileProxiesInner.md) + - [NetworkTestResult](docs/NetworkTestResult.md) + - [NetworkTestResults](docs/NetworkTestResults.md) + - [NetworkTopologyType](docs/NetworkTopologyType.md) + - [NetworkWirelessProfile](docs/NetworkWirelessProfile.md) + - [PaginationNextLink](docs/PaginationNextLink.md) + - [PaginationNextLinkLinks](docs/PaginationNextLinkLinks.md) + - [PathVisBaseTestResult](docs/PathVisBaseTestResult.md) + - [PathVisDetailDynamicTestResult](docs/PathVisDetailDynamicTestResult.md) + - [PathVisDetailDynamicTestResults](docs/PathVisDetailDynamicTestResults.md) + - [PathVisDetailTestResult](docs/PathVisDetailTestResult.md) + - [PathVisDetailTestResults](docs/PathVisDetailTestResults.md) + - [PathVisDynamicTestResult](docs/PathVisDynamicTestResult.md) + - [PathVisDynamicTestResults](docs/PathVisDynamicTestResults.md) + - [PathVisEndpoint](docs/PathVisEndpoint.md) + - [PathVisHop](docs/PathVisHop.md) + - [PathVisRoute](docs/PathVisRoute.md) + - [PathVisTestResult](docs/PathVisTestResult.md) + - [PathVisTestResults](docs/PathVisTestResults.md) + - [PhysicalMemoryUsedBytes](docs/PhysicalMemoryUsedBytes.md) + - [Platform](docs/Platform.md) + - [PostFetchDynamicTestResultMetrics200Response](docs/PostFetchDynamicTestResultMetrics200Response.md) + - [PostFetchTestResultMetrics200Response](docs/PostFetchTestResultMetrics200Response.md) + - [PostFetchTestResultMetricsMultiTest200Response](docs/PostFetchTestResultMetricsMultiTest200Response.md) + - [QueryWindow](docs/QueryWindow.md) + - [RealUserTestCoordinates](docs/RealUserTestCoordinates.md) + - [RealUserTestNetwork](docs/RealUserTestNetwork.md) + - [RealUserTestNetworkGatewayPing](docs/RealUserTestNetworkGatewayPing.md) + - [RealUserTestNetworkPing](docs/RealUserTestNetworkPing.md) + - [RealUserTestNetworkResult](docs/RealUserTestNetworkResult.md) + - [RealUserTestNetworkResults](docs/RealUserTestNetworkResults.md) + - [RealUserTestNetworkTraceroute](docs/RealUserTestNetworkTraceroute.md) + - [RealUserTestNetworkVpnPing](docs/RealUserTestNetworkVpnPing.md) + - [RealUserTestNetworkVpnTraceroute](docs/RealUserTestNetworkVpnTraceroute.md) + - [RealUserTestPage](docs/RealUserTestPage.md) + - [RealUserTestPagePageTimings](docs/RealUserTestPagePageTimings.md) + - [RealUserTestPageResult](docs/RealUserTestPageResult.md) + - [RealUserTestPageResults](docs/RealUserTestPageResults.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [SortOrder](docs/SortOrder.md) + - [SpecificAgentsSelectorType](docs/SpecificAgentsSelectorType.md) + - [SystemMetrics](docs/SystemMetrics.md) + - [TcpConnect](docs/TcpConnect.md) + - [TestInterval](docs/TestInterval.md) + - [TestProbeMode](docs/TestProbeMode.md) + - [TestResult](docs/TestResult.md) + - [TestSslVersionId](docs/TestSslVersionId.md) + - [TestsDataRoundsSearch](docs/TestsDataRoundsSearch.md) + - [TestsDataSearchFilter](docs/TestsDataSearchFilter.md) + - [TestsDataSearchSort](docs/TestsDataSearchSort.md) + - [TestsDataSearchSortKey](docs/TestsDataSearchSortKey.md) + - [TestsDataThresholdFilter](docs/TestsDataThresholdFilter.md) + - [TestsDataThresholdFilters](docs/TestsDataThresholdFilters.md) + - [ThresholdFilterName](docs/ThresholdFilterName.md) + - [ThresholdFilterOperator](docs/ThresholdFilterOperator.md) + - [Traceroute](docs/Traceroute.md) + - [TracerouteHop](docs/TracerouteHop.md) + - [Trigger](docs/Trigger.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + - [VpnProfile](docs/VpnProfile.md) + - [VpnType](docs/VpnType.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/endpoint/test_results_api/docs/AccountGroupId.md b/endpoint/test_results_api/docs/AccountGroupId.md new file mode 100644 index 00000000..b54d72c9 --- /dev/null +++ b/endpoint/test_results_api/docs/AccountGroupId.md @@ -0,0 +1,28 @@ +# AccountGroupId + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] + +## Example + +```python +from test_results_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) + + diff --git a/endpoint/test_results_api/docs/AgentLabelsSelectorType.md b/endpoint/test_results_api/docs/AgentLabelsSelectorType.md new file mode 100644 index 00000000..aa3d0399 --- /dev/null +++ b/endpoint/test_results_api/docs/AgentLabelsSelectorType.md @@ -0,0 +1,10 @@ +# AgentLabelsSelectorType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/AllAgentsSelectorType.md b/endpoint/test_results_api/docs/AllAgentsSelectorType.md new file mode 100644 index 00000000..049c7eec --- /dev/null +++ b/endpoint/test_results_api/docs/AllAgentsSelectorType.md @@ -0,0 +1,10 @@ +# AllAgentsSelectorType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/ApplicationScoreQuality.md b/endpoint/test_results_api/docs/ApplicationScoreQuality.md new file mode 100644 index 00000000..3cba74f0 --- /dev/null +++ b/endpoint/test_results_api/docs/ApplicationScoreQuality.md @@ -0,0 +1,10 @@ +# ApplicationScoreQuality + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/AsnDetails.md b/endpoint/test_results_api/docs/AsnDetails.md new file mode 100644 index 00000000..fba13218 --- /dev/null +++ b/endpoint/test_results_api/docs/AsnDetails.md @@ -0,0 +1,29 @@ +# AsnDetails + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**as_name** | **str** | Name of the provider. | [optional] [readonly] +**as_number** | **float** | Unique number assigned to an organization (also referred to as service provider). | [optional] [readonly] + +## Example + +```python +from test_results_api.models.asn_details import AsnDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of AsnDetails from a JSON string +asn_details_instance = AsnDetails.from_json(json) +# print the JSON string representation of the object +print AsnDetails.to_json() + +# convert the object into a dict +asn_details_dict = asn_details_instance.to_dict() +# create an instance of AsnDetails from a dict +asn_details_form_dict = asn_details.from_dict(asn_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) + + diff --git a/endpoint/test_results_api/docs/ConditionalOperator.md b/endpoint/test_results_api/docs/ConditionalOperator.md new file mode 100644 index 00000000..e2fb7fe6 --- /dev/null +++ b/endpoint/test_results_api/docs/ConditionalOperator.md @@ -0,0 +1,10 @@ +# ConditionalOperator + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/CpuUtilization.md b/endpoint/test_results_api/docs/CpuUtilization.md new file mode 100644 index 00000000..f31d68f0 --- /dev/null +++ b/endpoint/test_results_api/docs/CpuUtilization.md @@ -0,0 +1,33 @@ +# CpuUtilization + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**min** | **float** | The minimum sampled usage value recorded during the monitored period. | [optional] [readonly] +**max** | **float** | The maximum sampled usage value recorded during the monitored period. | [optional] [readonly] +**mean** | **float** | The mean (average) sampled usage value recorded during the monitored period. | [optional] [readonly] +**median** | **float** | The median sampled usage value recorded during the monitored period. | [optional] [readonly] +**std_dev** | **float** | The standard deviation of sampled usage values recorded during the monitored period. | [optional] [readonly] +**count** | **float** | The total number of samples collected during the monitored period. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.cpu_utilization import CpuUtilization + +# TODO update the JSON string below +json = "{}" +# create an instance of CpuUtilization from a JSON string +cpu_utilization_instance = CpuUtilization.from_json(json) +# print the JSON string representation of the object +print CpuUtilization.to_json() + +# convert the object into a dict +cpu_utilization_dict = cpu_utilization_instance.to_dict() +# create an instance of CpuUtilization from a dict +cpu_utilization_form_dict = cpu_utilization.from_dict(cpu_utilization_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/DynamicBaseTestResult.md b/endpoint/test_results_api/docs/DynamicBaseTestResult.md new file mode 100644 index 00000000..1f96d4c1 --- /dev/null +++ b/endpoint/test_results_api/docs/DynamicBaseTestResult.md @@ -0,0 +1,29 @@ +# DynamicBaseTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**application** | [**DynamicTestApplication**](DynamicTestApplication.md) | | [optional] +**webex** | [**DynamicBaseTestResultWebex**](DynamicBaseTestResultWebex.md) | | [optional] + +## Example + +```python +from test_results_api.models.dynamic_base_test_result import DynamicBaseTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicBaseTestResult from a JSON string +dynamic_base_test_result_instance = DynamicBaseTestResult.from_json(json) +# print the JSON string representation of the object +print DynamicBaseTestResult.to_json() + +# convert the object into a dict +dynamic_base_test_result_dict = dynamic_base_test_result_instance.to_dict() +# create an instance of DynamicBaseTestResult from a dict +dynamic_base_test_result_form_dict = dynamic_base_test_result.from_dict(dynamic_base_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/DynamicBaseTestResultWebex.md b/endpoint/test_results_api/docs/DynamicBaseTestResultWebex.md new file mode 100644 index 00000000..f52465ed --- /dev/null +++ b/endpoint/test_results_api/docs/DynamicBaseTestResultWebex.md @@ -0,0 +1,30 @@ +# DynamicBaseTestResultWebex + +Contains object with webex conference information. Only returned when `application` == `webex`. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conference_id** | **str** | Webex conference ID. | [optional] [readonly] +**correlation_id** | **str** | Webex conference correlation ID. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.dynamic_base_test_result_webex import DynamicBaseTestResultWebex + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicBaseTestResultWebex from a JSON string +dynamic_base_test_result_webex_instance = DynamicBaseTestResultWebex.from_json(json) +# print the JSON string representation of the object +print DynamicBaseTestResultWebex.to_json() + +# convert the object into a dict +dynamic_base_test_result_webex_dict = dynamic_base_test_result_webex_instance.to_dict() +# create an instance of DynamicBaseTestResultWebex from a dict +dynamic_base_test_result_webex_form_dict = dynamic_base_test_result_webex.from_dict(dynamic_base_test_result_webex_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/DynamicTest.md b/endpoint/test_results_api/docs/DynamicTest.md new file mode 100644 index 00000000..36ef96cc --- /dev/null +++ b/endpoint/test_results_api/docs/DynamicTest.md @@ -0,0 +1,43 @@ +# DynamicTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**DynamicTestLinks**](DynamicTestLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**application** | [**DynamicTestApplication**](DynamicTestApplication.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] [readonly] +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [readonly] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] [readonly] +**test_id** | **str** | Each test is assigned a unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] + +## Example + +```python +from test_results_api.models.dynamic_test import DynamicTest + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicTest from a JSON string +dynamic_test_instance = DynamicTest.from_json(json) +# print the JSON string representation of the object +print DynamicTest.to_json() + +# convert the object into a dict +dynamic_test_dict = dynamic_test_instance.to_dict() +# create an instance of DynamicTest from a dict +dynamic_test_form_dict = dynamic_test.from_dict(dynamic_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/DynamicTestApplication.md b/endpoint/test_results_api/docs/DynamicTestApplication.md new file mode 100644 index 00000000..f6055344 --- /dev/null +++ b/endpoint/test_results_api/docs/DynamicTestApplication.md @@ -0,0 +1,11 @@ +# DynamicTestApplication + +Which supported application to monitor. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/DynamicTestLinks.md b/endpoint/test_results_api/docs/DynamicTestLinks.md new file mode 100644 index 00000000..77b1a04c --- /dev/null +++ b/endpoint/test_results_api/docs/DynamicTestLinks.md @@ -0,0 +1,30 @@ +# DynamicTestLinks + +A list of links that can be accessed to get more information. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**DynamicTestLinksSelf**](DynamicTestLinksSelf.md) | | [optional] +**test_results** | [**DynamicTestLinksTestResults**](DynamicTestLinksTestResults.md) | | [optional] + +## Example + +```python +from test_results_api.models.dynamic_test_links import DynamicTestLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicTestLinks from a JSON string +dynamic_test_links_instance = DynamicTestLinks.from_json(json) +# print the JSON string representation of the object +print DynamicTestLinks.to_json() + +# convert the object into a dict +dynamic_test_links_dict = dynamic_test_links_instance.to_dict() +# create an instance of DynamicTestLinks from a dict +dynamic_test_links_form_dict = dynamic_test_links.from_dict(dynamic_test_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/DynamicTestLinksSelf.md b/endpoint/test_results_api/docs/DynamicTestLinksSelf.md new file mode 100644 index 00000000..b38b84e5 --- /dev/null +++ b/endpoint/test_results_api/docs/DynamicTestLinksSelf.md @@ -0,0 +1,35 @@ +# DynamicTestLinksSelf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from test_results_api.models.dynamic_test_links_self import DynamicTestLinksSelf + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicTestLinksSelf from a JSON string +dynamic_test_links_self_instance = DynamicTestLinksSelf.from_json(json) +# print the JSON string representation of the object +print DynamicTestLinksSelf.to_json() + +# convert the object into a dict +dynamic_test_links_self_dict = dynamic_test_links_self_instance.to_dict() +# create an instance of DynamicTestLinksSelf from a dict +dynamic_test_links_self_form_dict = dynamic_test_links_self.from_dict(dynamic_test_links_self_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/DynamicTestLinksTestResults.md b/endpoint/test_results_api/docs/DynamicTestLinksTestResults.md new file mode 100644 index 00000000..a7af31c5 --- /dev/null +++ b/endpoint/test_results_api/docs/DynamicTestLinksTestResults.md @@ -0,0 +1,35 @@ +# DynamicTestLinksTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from test_results_api.models.dynamic_test_links_test_results import DynamicTestLinksTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicTestLinksTestResults from a JSON string +dynamic_test_links_test_results_instance = DynamicTestLinksTestResults.from_json(json) +# print the JSON string representation of the object +print DynamicTestLinksTestResults.to_json() + +# convert the object into a dict +dynamic_test_links_test_results_dict = dynamic_test_links_test_results_instance.to_dict() +# create an instance of DynamicTestLinksTestResults from a dict +dynamic_test_links_test_results_form_dict = dynamic_test_links_test_results.from_dict(dynamic_test_links_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/DynamicTestsDataRoundSearch.md b/endpoint/test_results_api/docs/DynamicTestsDataRoundSearch.md new file mode 100644 index 00000000..379ddfd5 --- /dev/null +++ b/endpoint/test_results_api/docs/DynamicTestsDataRoundSearch.md @@ -0,0 +1,30 @@ +# DynamicTestsDataRoundSearch + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**search_sort** | [**List[TestsDataSearchSort]**](TestsDataSearchSort.md) | | [optional] +**threshold_filter** | [**TestsDataThresholdFilters**](TestsDataThresholdFilters.md) | | [optional] +**search_filters** | [**DynamicTestsDataSearchFilter**](DynamicTestsDataSearchFilter.md) | | [optional] + +## Example + +```python +from test_results_api.models.dynamic_tests_data_round_search import DynamicTestsDataRoundSearch + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicTestsDataRoundSearch from a JSON string +dynamic_tests_data_round_search_instance = DynamicTestsDataRoundSearch.from_json(json) +# print the JSON string representation of the object +print DynamicTestsDataRoundSearch.to_json() + +# convert the object into a dict +dynamic_tests_data_round_search_dict = dynamic_tests_data_round_search_instance.to_dict() +# create an instance of DynamicTestsDataRoundSearch from a dict +dynamic_tests_data_round_search_form_dict = dynamic_tests_data_round_search.from_dict(dynamic_tests_data_round_search_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/DynamicTestsDataSearchFilter.md b/endpoint/test_results_api/docs/DynamicTestsDataSearchFilter.md new file mode 100644 index 00000000..4e7d3e00 --- /dev/null +++ b/endpoint/test_results_api/docs/DynamicTestsDataSearchFilter.md @@ -0,0 +1,29 @@ +# DynamicTestsDataSearchFilter + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **List[str]** | Filter using the `agent-id`. | [optional] +**webex_conference_id** | **List[str]** | Filter using the `conference-id` of the webex call. | [optional] + +## Example + +```python +from test_results_api.models.dynamic_tests_data_search_filter import DynamicTestsDataSearchFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicTestsDataSearchFilter from a JSON string +dynamic_tests_data_search_filter_instance = DynamicTestsDataSearchFilter.from_json(json) +# print the JSON string representation of the object +print DynamicTestsDataSearchFilter.to_json() + +# convert the object into a dict +dynamic_tests_data_search_filter_dict = dynamic_tests_data_search_filter_instance.to_dict() +# create an instance of DynamicTestsDataSearchFilter from a dict +dynamic_tests_data_search_filter_form_dict = dynamic_tests_data_search_filter.from_dict(dynamic_tests_data_search_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointAgentLabelsSelectorConfig.md b/endpoint/test_results_api/docs/EndpointAgentLabelsSelectorConfig.md new file mode 100644 index 00000000..90c1fb9e --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointAgentLabelsSelectorConfig.md @@ -0,0 +1,31 @@ +# EndpointAgentLabelsSelectorConfig + +Agent labels selection object. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**AgentLabelsSelectorType**](AgentLabelsSelectorType.md) | | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] + +## Example + +```python +from test_results_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentLabelsSelectorConfig from a JSON string +endpoint_agent_labels_selector_config_instance = EndpointAgentLabelsSelectorConfig.from_json(json) +# print the JSON string representation of the object +print EndpointAgentLabelsSelectorConfig.to_json() + +# convert the object into a dict +endpoint_agent_labels_selector_config_dict = endpoint_agent_labels_selector_config_instance.to_dict() +# create an instance of EndpointAgentLabelsSelectorConfig from a dict +endpoint_agent_labels_selector_config_form_dict = endpoint_agent_labels_selector_config.from_dict(endpoint_agent_labels_selector_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointAgentSelectorConfig.md b/endpoint/test_results_api/docs/EndpointAgentSelectorConfig.md new file mode 100644 index 00000000..977b6f50 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointAgentSelectorConfig.md @@ -0,0 +1,32 @@ +# EndpointAgentSelectorConfig + +Agents selection object based on agentSelectorType. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**SpecificAgentsSelectorType**](SpecificAgentsSelectorType.md) | | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] + +## Example + +```python +from test_results_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentSelectorConfig from a JSON string +endpoint_agent_selector_config_instance = EndpointAgentSelectorConfig.from_json(json) +# print the JSON string representation of the object +print EndpointAgentSelectorConfig.to_json() + +# convert the object into a dict +endpoint_agent_selector_config_dict = endpoint_agent_selector_config_instance.to_dict() +# create an instance of EndpointAgentSelectorConfig from a dict +endpoint_agent_selector_config_form_dict = endpoint_agent_selector_config.from_dict(endpoint_agent_selector_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointAgentToServerTest.md b/endpoint/test_results_api/docs/EndpointAgentToServerTest.md new file mode 100644 index 00000000..fd034719 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointAgentToServerTest.md @@ -0,0 +1,43 @@ +# EndpointAgentToServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**EndpointTestLinks**](EndpointTestLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**is_saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**server** | **str** | Target domain name or IP address. | [optional] +**test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] +**type** | [**EndpointAgentToServerType**](EndpointAgentToServerType.md) | | [optional] + +## Example + +```python +from test_results_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentToServerTest from a JSON string +endpoint_agent_to_server_test_instance = EndpointAgentToServerTest.from_json(json) +# print the JSON string representation of the object +print EndpointAgentToServerTest.to_json() + +# convert the object into a dict +endpoint_agent_to_server_test_dict = endpoint_agent_to_server_test_instance.to_dict() +# create an instance of EndpointAgentToServerTest from a dict +endpoint_agent_to_server_test_form_dict = endpoint_agent_to_server_test.from_dict(endpoint_agent_to_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointAgentToServerType.md b/endpoint/test_results_api/docs/EndpointAgentToServerType.md new file mode 100644 index 00000000..a2abd7c3 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointAgentToServerType.md @@ -0,0 +1,11 @@ +# EndpointAgentToServerType + +Type of test being queried. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointAllAgentsSelectorConfig.md b/endpoint/test_results_api/docs/EndpointAllAgentsSelectorConfig.md new file mode 100644 index 00000000..d8d55c99 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointAllAgentsSelectorConfig.md @@ -0,0 +1,30 @@ +# EndpointAllAgentsSelectorConfig + +Any agent selection object. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**AllAgentsSelectorType**](AllAgentsSelectorType.md) | | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] + +## Example + +```python +from test_results_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAllAgentsSelectorConfig from a JSON string +endpoint_all_agents_selector_config_instance = EndpointAllAgentsSelectorConfig.from_json(json) +# print the JSON string representation of the object +print EndpointAllAgentsSelectorConfig.to_json() + +# convert the object into a dict +endpoint_all_agents_selector_config_dict = endpoint_all_agents_selector_config_instance.to_dict() +# create an instance of EndpointAllAgentsSelectorConfig from a dict +endpoint_all_agents_selector_config_form_dict = endpoint_all_agents_selector_config.from_dict(endpoint_all_agents_selector_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointBrowser.md b/endpoint/test_results_api/docs/EndpointBrowser.md new file mode 100644 index 00000000..41772f09 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointBrowser.md @@ -0,0 +1,29 @@ +# EndpointBrowser + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Browser name. | [optional] [readonly] +**version** | **str** | Browser version. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.endpoint_browser import EndpointBrowser + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointBrowser from a JSON string +endpoint_browser_instance = EndpointBrowser.from_json(json) +# print the JSON string representation of the object +print EndpointBrowser.to_json() + +# convert the object into a dict +endpoint_browser_dict = endpoint_browser_instance.to_dict() +# create an instance of EndpointBrowser from a dict +endpoint_browser_form_dict = endpoint_browser.from_dict(endpoint_browser_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointHttpDataPointScore.md b/endpoint/test_results_api/docs/EndpointHttpDataPointScore.md new file mode 100644 index 00000000..cfd48ce5 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointHttpDataPointScore.md @@ -0,0 +1,29 @@ +# EndpointHttpDataPointScore + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**application_score** | **float** | Fine grained score between 0-100 based on `time to first byte` metric | [optional] +**quality** | [**ApplicationScoreQuality**](ApplicationScoreQuality.md) | | [optional] + +## Example + +```python +from test_results_api.models.endpoint_http_data_point_score import EndpointHttpDataPointScore + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointHttpDataPointScore from a JSON string +endpoint_http_data_point_score_instance = EndpointHttpDataPointScore.from_json(json) +# print the JSON string representation of the object +print EndpointHttpDataPointScore.to_json() + +# convert the object into a dict +endpoint_http_data_point_score_dict = endpoint_http_data_point_score_instance.to_dict() +# create an instance of EndpointHttpDataPointScore from a dict +endpoint_http_data_point_score_form_dict = endpoint_http_data_point_score.from_dict(endpoint_http_data_point_score_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointHttpServerBaseTest.md b/endpoint/test_results_api/docs/EndpointHttpServerBaseTest.md new file mode 100644 index 00000000..38431dad --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointHttpServerBaseTest.md @@ -0,0 +1,36 @@ +# EndpointHttpServerBaseTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] + +## Example + +```python +from test_results_api.models.endpoint_http_server_base_test import EndpointHttpServerBaseTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointHttpServerBaseTest from a JSON string +endpoint_http_server_base_test_instance = EndpointHttpServerBaseTest.from_json(json) +# print the JSON string representation of the object +print EndpointHttpServerBaseTest.to_json() + +# convert the object into a dict +endpoint_http_server_base_test_dict = endpoint_http_server_base_test_instance.to_dict() +# create an instance of EndpointHttpServerBaseTest from a dict +endpoint_http_server_base_test_form_dict = endpoint_http_server_base_test.from_dict(endpoint_http_server_base_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointHttpServerTest.md b/endpoint/test_results_api/docs/EndpointHttpServerTest.md new file mode 100644 index 00000000..02626582 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointHttpServerTest.md @@ -0,0 +1,58 @@ +# EndpointHttpServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**EndpointTestLinks**](EndpointTestLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**is_saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**server** | **str** | Target domain name or IP address. | [optional] +**test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] +**type** | [**EndpointHttpServerType**](EndpointHttpServerType.md) | | [optional] +**auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] +**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] + +## Example + +```python +from test_results_api.models.endpoint_http_server_test import EndpointHttpServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointHttpServerTest from a JSON string +endpoint_http_server_test_instance = EndpointHttpServerTest.from_json(json) +# print the JSON string representation of the object +print EndpointHttpServerTest.to_json() + +# convert the object into a dict +endpoint_http_server_test_dict = endpoint_http_server_test_instance.to_dict() +# create an instance of EndpointHttpServerTest from a dict +endpoint_http_server_test_form_dict = endpoint_http_server_test.from_dict(endpoint_http_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointHttpServerType.md b/endpoint/test_results_api/docs/EndpointHttpServerType.md new file mode 100644 index 00000000..1cf13c82 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointHttpServerType.md @@ -0,0 +1,11 @@ +# EndpointHttpServerType + +Type of test being queried. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointNetworkTopologyResultRequestFilter.md b/endpoint/test_results_api/docs/EndpointNetworkTopologyResultRequestFilter.md new file mode 100644 index 00000000..0060ae7b --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointNetworkTopologyResultRequestFilter.md @@ -0,0 +1,38 @@ +# EndpointNetworkTopologyResultRequestFilter + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**location** | **List[str]** | Location of the endpoint agent. | [optional] +**connection** | [**List[InterfaceHardwareType]**](InterfaceHardwareType.md) | | [optional] +**platform** | [**List[Platform]**](Platform.md) | | [optional] +**gateway** | **List[str]** | Endpoint agent default gateway IP address. | [optional] +**proxy_target** | **List[str]** | Endpoint agent proxy IP address. | [optional] +**vpn_target** | **List[str]** | Endpoint agent VPN endpoint IP address. | [optional] +**agent_id** | **List[str]** | Endpoint agent ID. | [optional] +**network_id** | **List[str]** | Network ID. | [optional] +**ssid** | **List[str]** | WiFi SSID. | [optional] +**bssid** | **List[str]** | WiFi BSSID. | [optional] +**type** | [**List[NetworkTopologyType]**](NetworkTopologyType.md) | Web site base domain visited during the session. | [optional] + +## Example + +```python +from test_results_api.models.endpoint_network_topology_result_request_filter import EndpointNetworkTopologyResultRequestFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointNetworkTopologyResultRequestFilter from a JSON string +endpoint_network_topology_result_request_filter_instance = EndpointNetworkTopologyResultRequestFilter.from_json(json) +# print the JSON string representation of the object +print EndpointNetworkTopologyResultRequestFilter.to_json() + +# convert the object into a dict +endpoint_network_topology_result_request_filter_dict = endpoint_network_topology_result_request_filter_instance.to_dict() +# create an instance of EndpointNetworkTopologyResultRequestFilter from a dict +endpoint_network_topology_result_request_filter_form_dict = endpoint_network_topology_result_request_filter.from_dict(endpoint_network_topology_result_request_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointPingDataPointScore.md b/endpoint/test_results_api/docs/EndpointPingDataPointScore.md new file mode 100644 index 00000000..a6592df4 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointPingDataPointScore.md @@ -0,0 +1,29 @@ +# EndpointPingDataPointScore + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**application_score** | **float** | Fine grained score between 0-100 based on metrics (latency, jitter, loss) | [optional] +**quality** | [**ApplicationScoreQuality**](ApplicationScoreQuality.md) | | [optional] + +## Example + +```python +from test_results_api.models.endpoint_ping_data_point_score import EndpointPingDataPointScore + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointPingDataPointScore from a JSON string +endpoint_ping_data_point_score_instance = EndpointPingDataPointScore.from_json(json) +# print the JSON string representation of the object +print EndpointPingDataPointScore.to_json() + +# convert the object into a dict +endpoint_ping_data_point_score_dict = endpoint_ping_data_point_score_instance.to_dict() +# create an instance of EndpointPingDataPointScore from a dict +endpoint_ping_data_point_score_form_dict = endpoint_ping_data_point_score.from_dict(endpoint_ping_data_point_score_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointRealUserTest.md b/endpoint/test_results_api/docs/EndpointRealUserTest.md new file mode 100644 index 00000000..0e9f00fc --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointRealUserTest.md @@ -0,0 +1,40 @@ +# EndpointRealUserTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**committed** | **datetime** | UTC date when endpoint real user test was committed to the controller (ISO date-time format). | [optional] [readonly] +**var_date** | **datetime** | UTC date when endpoint real user test took place (ISO date-time format). | [optional] [readonly] +**experience_score** | **float** | Score rating a user’s experience when loading a particular page, from 0 (the worst) to 1 (the best). [More details](https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#user-experience-score). | [optional] [readonly] +**number_of_pages** | **int** | Number of web pages visited on target website. | [optional] [readonly] +**organization_name** | **str** | Name of the AS organization `sourceAddress` belongs to. | [optional] [readonly] +**port** | **int** | Port used to visit target website. | [optional] [readonly] +**protocol** | **str** | Protocol used to visit target website. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**source_address** | **str** | Public IP address of the endpoint agent during the session. | [optional] [readonly] +**id** | **str** | Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID. | [optional] [readonly] +**visited_site** | **str** | Domain used to visit target website. | [optional] [readonly] +**page_id** | **str** | Web page ID. The page ID is unique only within an endpoint real user test. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.endpoint_real_user_test import EndpointRealUserTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointRealUserTest from a JSON string +endpoint_real_user_test_instance = EndpointRealUserTest.from_json(json) +# print the JSON string representation of the object +print EndpointRealUserTest.to_json() + +# convert the object into a dict +endpoint_real_user_test_dict = endpoint_real_user_test_instance.to_dict() +# create an instance of EndpointRealUserTest from a dict +endpoint_real_user_test_form_dict = endpoint_real_user_test.from_dict(endpoint_real_user_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointRealUserTestBase.md b/endpoint/test_results_api/docs/EndpointRealUserTestBase.md new file mode 100644 index 00000000..129f4918 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointRealUserTestBase.md @@ -0,0 +1,39 @@ +# EndpointRealUserTestBase + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**committed** | **datetime** | UTC date when endpoint real user test was committed to the controller (ISO date-time format). | [optional] [readonly] +**var_date** | **datetime** | UTC date when endpoint real user test took place (ISO date-time format). | [optional] [readonly] +**experience_score** | **float** | Score rating a user’s experience when loading a particular page, from 0 (the worst) to 1 (the best). [More details](https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#user-experience-score). | [optional] [readonly] +**number_of_pages** | **int** | Number of web pages visited on target website. | [optional] [readonly] +**organization_name** | **str** | Name of the AS organization `sourceAddress` belongs to. | [optional] [readonly] +**port** | **int** | Port used to visit target website. | [optional] [readonly] +**protocol** | **str** | Protocol used to visit target website. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**source_address** | **str** | Public IP address of the endpoint agent during the session. | [optional] [readonly] +**id** | **str** | Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID. | [optional] [readonly] +**visited_site** | **str** | Domain used to visit target website. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.endpoint_real_user_test_base import EndpointRealUserTestBase + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointRealUserTestBase from a JSON string +endpoint_real_user_test_base_instance = EndpointRealUserTestBase.from_json(json) +# print the JSON string representation of the object +print EndpointRealUserTestBase.to_json() + +# convert the object into a dict +endpoint_real_user_test_base_dict = endpoint_real_user_test_base_instance.to_dict() +# create an instance of EndpointRealUserTestBase from a dict +endpoint_real_user_test_base_form_dict = endpoint_real_user_test_base.from_dict(endpoint_real_user_test_base_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointRealUserTestDetail.md b/endpoint/test_results_api/docs/EndpointRealUserTestDetail.md new file mode 100644 index 00000000..ece656b4 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointRealUserTestDetail.md @@ -0,0 +1,43 @@ +# EndpointRealUserTestDetail + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**committed** | **datetime** | UTC date when endpoint real user test was committed to the controller (ISO date-time format). | [optional] [readonly] +**var_date** | **datetime** | UTC date when endpoint real user test took place (ISO date-time format). | [optional] [readonly] +**experience_score** | **float** | Score rating a user’s experience when loading a particular page, from 0 (the worst) to 1 (the best). [More details](https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#user-experience-score). | [optional] [readonly] +**number_of_pages** | **int** | Number of web pages visited on target website. | [optional] [readonly] +**organization_name** | **str** | Name of the AS organization `sourceAddress` belongs to. | [optional] [readonly] +**port** | **int** | Port used to visit target website. | [optional] [readonly] +**protocol** | **str** | Protocol used to visit target website. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**source_address** | **str** | Public IP address of the endpoint agent during the session. | [optional] [readonly] +**id** | **str** | Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID. | [optional] [readonly] +**visited_site** | **str** | Domain used to visit target website. | [optional] [readonly] +**browser** | [**EndpointBrowser**](EndpointBrowser.md) | | [optional] +**coordinates** | [**RealUserTestCoordinates**](RealUserTestCoordinates.md) | | [optional] +**pages** | [**List[RealUserTestPage]**](RealUserTestPage.md) | Web site base domain visited during the session. | [optional] +**network** | [**RealUserTestNetwork**](RealUserTestNetwork.md) | | [optional] + +## Example + +```python +from test_results_api.models.endpoint_real_user_test_detail import EndpointRealUserTestDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointRealUserTestDetail from a JSON string +endpoint_real_user_test_detail_instance = EndpointRealUserTestDetail.from_json(json) +# print the JSON string representation of the object +print EndpointRealUserTestDetail.to_json() + +# convert the object into a dict +endpoint_real_user_test_detail_dict = endpoint_real_user_test_detail_instance.to_dict() +# create an instance of EndpointRealUserTestDetail from a dict +endpoint_real_user_test_detail_form_dict = endpoint_real_user_test_detail.from_dict(endpoint_real_user_test_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointRealUserTestDetailResults.md b/endpoint/test_results_api/docs/EndpointRealUserTestDetailResults.md new file mode 100644 index 00000000..d7cca2f2 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointRealUserTestDetailResults.md @@ -0,0 +1,28 @@ +# EndpointRealUserTestDetailResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[EndpointRealUserTestDetail]**](EndpointRealUserTestDetail.md) | | [optional] + +## Example + +```python +from test_results_api.models.endpoint_real_user_test_detail_results import EndpointRealUserTestDetailResults + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointRealUserTestDetailResults from a JSON string +endpoint_real_user_test_detail_results_instance = EndpointRealUserTestDetailResults.from_json(json) +# print the JSON string representation of the object +print EndpointRealUserTestDetailResults.to_json() + +# convert the object into a dict +endpoint_real_user_test_detail_results_dict = endpoint_real_user_test_detail_results_instance.to_dict() +# create an instance of EndpointRealUserTestDetailResults from a dict +endpoint_real_user_test_detail_results_form_dict = endpoint_real_user_test_detail_results.from_dict(endpoint_real_user_test_detail_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointRealUserTestResultRequestFilter.md b/endpoint/test_results_api/docs/EndpointRealUserTestResultRequestFilter.md new file mode 100644 index 00000000..4e713eb9 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointRealUserTestResultRequestFilter.md @@ -0,0 +1,41 @@ +# EndpointRealUserTestResultRequestFilter + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**location** | **List[str]** | Location of the endpoint agent. | [optional] +**connection** | [**List[InterfaceHardwareType]**](InterfaceHardwareType.md) | | [optional] +**platform** | [**List[Platform]**](Platform.md) | | [optional] +**gateway** | **List[str]** | Endpoint agent default gateway IP address. | [optional] +**proxy_target** | **List[str]** | Endpoint agent proxy IP address. | [optional] +**vpn_target** | **List[str]** | Endpoint agent VPN endpoint IP address. | [optional] +**agent_id** | **List[str]** | Endpoint agent ID. | [optional] +**network_id** | **List[str]** | Network ID. | [optional] +**ssid** | **List[str]** | WiFi SSID. | [optional] +**bssid** | **List[str]** | WiFi BSSID. | [optional] +**destination_ip** | **List[str]** | Web site destination IP address. | [optional] +**domain** | **List[str]** | Web site base domain visited during the session. | [optional] +**trigger** | [**List[Trigger]**](Trigger.md) | Real user test trigger. | [optional] +**visited_site** | **List[str]** | Web site domain visited during the session. | [optional] + +## Example + +```python +from test_results_api.models.endpoint_real_user_test_result_request_filter import EndpointRealUserTestResultRequestFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointRealUserTestResultRequestFilter from a JSON string +endpoint_real_user_test_result_request_filter_instance = EndpointRealUserTestResultRequestFilter.from_json(json) +# print the JSON string representation of the object +print EndpointRealUserTestResultRequestFilter.to_json() + +# convert the object into a dict +endpoint_real_user_test_result_request_filter_dict = endpoint_real_user_test_result_request_filter_instance.to_dict() +# create an instance of EndpointRealUserTestResultRequestFilter from a dict +endpoint_real_user_test_result_request_filter_form_dict = endpoint_real_user_test_result_request_filter.from_dict(endpoint_real_user_test_result_request_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointRealUserTestResults.md b/endpoint/test_results_api/docs/EndpointRealUserTestResults.md new file mode 100644 index 00000000..5e1a69ef --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointRealUserTestResults.md @@ -0,0 +1,28 @@ +# EndpointRealUserTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[EndpointRealUserTest]**](EndpointRealUserTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.endpoint_real_user_test_results import EndpointRealUserTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointRealUserTestResults from a JSON string +endpoint_real_user_test_results_instance = EndpointRealUserTestResults.from_json(json) +# print the JSON string representation of the object +print EndpointRealUserTestResults.to_json() + +# convert the object into a dict +endpoint_real_user_test_results_dict = endpoint_real_user_test_results_instance.to_dict() +# create an instance of EndpointRealUserTestResults from a dict +endpoint_real_user_test_results_form_dict = endpoint_real_user_test_results.from_dict(endpoint_real_user_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointResultRequestFilter.md b/endpoint/test_results_api/docs/EndpointResultRequestFilter.md new file mode 100644 index 00000000..3b1382ce --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointResultRequestFilter.md @@ -0,0 +1,37 @@ +# EndpointResultRequestFilter + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**location** | **List[str]** | Location of the endpoint agent. | [optional] +**connection** | [**List[InterfaceHardwareType]**](InterfaceHardwareType.md) | | [optional] +**platform** | [**List[Platform]**](Platform.md) | | [optional] +**gateway** | **List[str]** | Endpoint agent default gateway IP address. | [optional] +**proxy_target** | **List[str]** | Endpoint agent proxy IP address. | [optional] +**vpn_target** | **List[str]** | Endpoint agent VPN endpoint IP address. | [optional] +**agent_id** | **List[str]** | Endpoint agent ID. | [optional] +**network_id** | **List[str]** | Network ID. | [optional] +**ssid** | **List[str]** | WiFi SSID. | [optional] +**bssid** | **List[str]** | WiFi BSSID. | [optional] + +## Example + +```python +from test_results_api.models.endpoint_result_request_filter import EndpointResultRequestFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointResultRequestFilter from a JSON string +endpoint_result_request_filter_instance = EndpointResultRequestFilter.from_json(json) +# print the JSON string representation of the object +print EndpointResultRequestFilter.to_json() + +# convert the object into a dict +endpoint_result_request_filter_dict = endpoint_result_request_filter_instance.to_dict() +# create an instance of EndpointResultRequestFilter from a dict +endpoint_result_request_filter_form_dict = endpoint_result_request_filter.from_dict(endpoint_result_request_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointScheduledTest.md b/endpoint/test_results_api/docs/EndpointScheduledTest.md new file mode 100644 index 00000000..91c3eacd --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointScheduledTest.md @@ -0,0 +1,58 @@ +# EndpointScheduledTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**EndpointTestLinks**](EndpointTestLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**is_saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**server** | **str** | Target domain name or IP address. | [optional] +**test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] +**type** | [**EndpointHttpServerType**](EndpointHttpServerType.md) | | [optional] +**auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] +**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] + +## Example + +```python +from test_results_api.models.endpoint_scheduled_test import EndpointScheduledTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointScheduledTest from a JSON string +endpoint_scheduled_test_instance = EndpointScheduledTest.from_json(json) +# print the JSON string representation of the object +print EndpointScheduledTest.to_json() + +# convert the object into a dict +endpoint_scheduled_test_dict = endpoint_scheduled_test_instance.to_dict() +# create an instance of EndpointScheduledTest from a dict +endpoint_scheduled_test_form_dict = endpoint_scheduled_test.from_dict(endpoint_scheduled_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointScheduledTestType.md b/endpoint/test_results_api/docs/EndpointScheduledTestType.md new file mode 100644 index 00000000..4fb1f891 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointScheduledTestType.md @@ -0,0 +1,11 @@ +# EndpointScheduledTestType + +Type of test being queried. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointSpecificAgentsSelectorConfig.md b/endpoint/test_results_api/docs/EndpointSpecificAgentsSelectorConfig.md new file mode 100644 index 00000000..7afc7a3c --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointSpecificAgentsSelectorConfig.md @@ -0,0 +1,31 @@ +# EndpointSpecificAgentsSelectorConfig + +Specific agents selection object. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**SpecificAgentsSelectorType**](SpecificAgentsSelectorType.md) | | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] + +## Example + +```python +from test_results_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointSpecificAgentsSelectorConfig from a JSON string +endpoint_specific_agents_selector_config_instance = EndpointSpecificAgentsSelectorConfig.from_json(json) +# print the JSON string representation of the object +print EndpointSpecificAgentsSelectorConfig.to_json() + +# convert the object into a dict +endpoint_specific_agents_selector_config_dict = endpoint_specific_agents_selector_config_instance.to_dict() +# create an instance of EndpointSpecificAgentsSelectorConfig from a dict +endpoint_specific_agents_selector_config_form_dict = endpoint_specific_agents_selector_config.from_dict(endpoint_specific_agents_selector_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointTest.md b/endpoint/test_results_api/docs/EndpointTest.md new file mode 100644 index 00000000..4bb18732 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointTest.md @@ -0,0 +1,43 @@ +# EndpointTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**EndpointTestLinks**](EndpointTestLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**is_saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**server** | **str** | Target domain name or IP address. | [optional] +**test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] +**type** | [**EndpointScheduledTestType**](EndpointScheduledTestType.md) | | [optional] + +## Example + +```python +from test_results_api.models.endpoint_test import EndpointTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTest from a JSON string +endpoint_test_instance = EndpointTest.from_json(json) +# print the JSON string representation of the object +print EndpointTest.to_json() + +# convert the object into a dict +endpoint_test_dict = endpoint_test_instance.to_dict() +# create an instance of EndpointTest from a dict +endpoint_test_form_dict = endpoint_test.from_dict(endpoint_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointTestAid.md b/endpoint/test_results_api/docs/EndpointTestAid.md new file mode 100644 index 00000000..fe67d9dc --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointTestAid.md @@ -0,0 +1,28 @@ +# EndpointTestAid + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] + +## Example + +```python +from test_results_api.models.endpoint_test_aid import EndpointTestAid + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestAid from a JSON string +endpoint_test_aid_instance = EndpointTestAid.from_json(json) +# print the JSON string representation of the object +print EndpointTestAid.to_json() + +# convert the object into a dict +endpoint_test_aid_dict = endpoint_test_aid_instance.to_dict() +# create an instance of EndpointTestAid from a dict +endpoint_test_aid_form_dict = endpoint_test_aid.from_dict(endpoint_test_aid_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointTestAuthType.md b/endpoint/test_results_api/docs/EndpointTestAuthType.md new file mode 100644 index 00000000..979915c2 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointTestAuthType.md @@ -0,0 +1,11 @@ +# EndpointTestAuthType + +HTTP authentication type. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointTestLinks.md b/endpoint/test_results_api/docs/EndpointTestLinks.md new file mode 100644 index 00000000..bbeedb74 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointTestLinks.md @@ -0,0 +1,30 @@ +# EndpointTestLinks + +A list of links that can be accessed to get more information. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**EndpointTestLinksSelf**](EndpointTestLinksSelf.md) | | [optional] +**test_results** | [**EndpointTestLinksTestResults**](EndpointTestLinksTestResults.md) | | [optional] + +## Example + +```python +from test_results_api.models.endpoint_test_links import EndpointTestLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestLinks from a JSON string +endpoint_test_links_instance = EndpointTestLinks.from_json(json) +# print the JSON string representation of the object +print EndpointTestLinks.to_json() + +# convert the object into a dict +endpoint_test_links_dict = endpoint_test_links_instance.to_dict() +# create an instance of EndpointTestLinks from a dict +endpoint_test_links_form_dict = endpoint_test_links.from_dict(endpoint_test_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointTestLinksSelf.md b/endpoint/test_results_api/docs/EndpointTestLinksSelf.md new file mode 100644 index 00000000..fece544b --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointTestLinksSelf.md @@ -0,0 +1,35 @@ +# EndpointTestLinksSelf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from test_results_api.models.endpoint_test_links_self import EndpointTestLinksSelf + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestLinksSelf from a JSON string +endpoint_test_links_self_instance = EndpointTestLinksSelf.from_json(json) +# print the JSON string representation of the object +print EndpointTestLinksSelf.to_json() + +# convert the object into a dict +endpoint_test_links_self_dict = endpoint_test_links_self_instance.to_dict() +# create an instance of EndpointTestLinksSelf from a dict +endpoint_test_links_self_form_dict = endpoint_test_links_self.from_dict(endpoint_test_links_self_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointTestLinksTestResults.md b/endpoint/test_results_api/docs/EndpointTestLinksTestResults.md new file mode 100644 index 00000000..b2e273ef --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointTestLinksTestResults.md @@ -0,0 +1,35 @@ +# EndpointTestLinksTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from test_results_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestLinksTestResults from a JSON string +endpoint_test_links_test_results_instance = EndpointTestLinksTestResults.from_json(json) +# print the JSON string representation of the object +print EndpointTestLinksTestResults.to_json() + +# convert the object into a dict +endpoint_test_links_test_results_dict = endpoint_test_links_test_results_instance.to_dict() +# create an instance of EndpointTestLinksTestResults from a dict +endpoint_test_links_test_results_form_dict = endpoint_test_links_test_results.from_dict(endpoint_test_links_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EndpointTestProtocol.md b/endpoint/test_results_api/docs/EndpointTestProtocol.md new file mode 100644 index 00000000..c1e002b3 --- /dev/null +++ b/endpoint/test_results_api/docs/EndpointTestProtocol.md @@ -0,0 +1,11 @@ +# EndpointTestProtocol + +Protocol used to perform the test. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/Error.md b/endpoint/test_results_api/docs/Error.md new file mode 100644 index 00000000..192750be --- /dev/null +++ b/endpoint/test_results_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from test_results_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/EthernetProfile.md b/endpoint/test_results_api/docs/EthernetProfile.md new file mode 100644 index 00000000..95f9e93b --- /dev/null +++ b/endpoint/test_results_api/docs/EthernetProfile.md @@ -0,0 +1,28 @@ +# EthernetProfile + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**link_speed** | **float** | Ethernet profile link speed | [optional] [readonly] + +## Example + +```python +from test_results_api.models.ethernet_profile import EthernetProfile + +# TODO update the JSON string below +json = "{}" +# create an instance of EthernetProfile from a JSON string +ethernet_profile_instance = EthernetProfile.from_json(json) +# print the JSON string representation of the object +print EthernetProfile.to_json() + +# convert the object into a dict +ethernet_profile_dict = ethernet_profile_instance.to_dict() +# create an instance of EthernetProfile from a dict +ethernet_profile_form_dict = ethernet_profile.from_dict(ethernet_profile_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/Expand.md b/endpoint/test_results_api/docs/Expand.md new file mode 100644 index 00000000..5d5b5ca2 --- /dev/null +++ b/endpoint/test_results_api/docs/Expand.md @@ -0,0 +1,10 @@ +# Expand + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/GetDynamicTestResultNetworkPathvis200Response.md b/endpoint/test_results_api/docs/GetDynamicTestResultNetworkPathvis200Response.md new file mode 100644 index 00000000..442269af --- /dev/null +++ b/endpoint/test_results_api/docs/GetDynamicTestResultNetworkPathvis200Response.md @@ -0,0 +1,32 @@ +# GetDynamicTestResultNetworkPathvis200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisDynamicTestResult]**](PathVisDynamicTestResult.md) | | [optional] +**test** | [**DynamicTest**](DynamicTest.md) | | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_dynamic_test_result_network_pathvis200_response import GetDynamicTestResultNetworkPathvis200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDynamicTestResultNetworkPathvis200Response from a JSON string +get_dynamic_test_result_network_pathvis200_response_instance = GetDynamicTestResultNetworkPathvis200Response.from_json(json) +# print the JSON string representation of the object +print GetDynamicTestResultNetworkPathvis200Response.to_json() + +# convert the object into a dict +get_dynamic_test_result_network_pathvis200_response_dict = get_dynamic_test_result_network_pathvis200_response_instance.to_dict() +# create an instance of GetDynamicTestResultNetworkPathvis200Response from a dict +get_dynamic_test_result_network_pathvis200_response_form_dict = get_dynamic_test_result_network_pathvis200_response.from_dict(get_dynamic_test_result_network_pathvis200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/GetDynamicTestResultPathvisAgentRound200Response.md b/endpoint/test_results_api/docs/GetDynamicTestResultPathvisAgentRound200Response.md new file mode 100644 index 00000000..1b0d3608 --- /dev/null +++ b/endpoint/test_results_api/docs/GetDynamicTestResultPathvisAgentRound200Response.md @@ -0,0 +1,30 @@ +# GetDynamicTestResultPathvisAgentRound200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisDetailDynamicTestResult]**](PathVisDetailDynamicTestResult.md) | | [optional] +**test** | [**DynamicTest**](DynamicTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_dynamic_test_result_pathvis_agent_round200_response import GetDynamicTestResultPathvisAgentRound200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDynamicTestResultPathvisAgentRound200Response from a JSON string +get_dynamic_test_result_pathvis_agent_round200_response_instance = GetDynamicTestResultPathvisAgentRound200Response.from_json(json) +# print the JSON string representation of the object +print GetDynamicTestResultPathvisAgentRound200Response.to_json() + +# convert the object into a dict +get_dynamic_test_result_pathvis_agent_round200_response_dict = get_dynamic_test_result_pathvis_agent_round200_response_instance.to_dict() +# create an instance of GetDynamicTestResultPathvisAgentRound200Response from a dict +get_dynamic_test_result_pathvis_agent_round200_response_form_dict = get_dynamic_test_result_pathvis_agent_round200_response.from_dict(get_dynamic_test_result_pathvis_agent_round200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/GetEndpointLocalNetworkTopologyDetails200Response.md b/endpoint/test_results_api/docs/GetEndpointLocalNetworkTopologyDetails200Response.md new file mode 100644 index 00000000..c55e931f --- /dev/null +++ b/endpoint/test_results_api/docs/GetEndpointLocalNetworkTopologyDetails200Response.md @@ -0,0 +1,29 @@ +# GetEndpointLocalNetworkTopologyDetails200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[LocalNetworkTopologyResult]**](LocalNetworkTopologyResult.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_endpoint_local_network_topology_details200_response import GetEndpointLocalNetworkTopologyDetails200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointLocalNetworkTopologyDetails200Response from a JSON string +get_endpoint_local_network_topology_details200_response_instance = GetEndpointLocalNetworkTopologyDetails200Response.from_json(json) +# print the JSON string representation of the object +print GetEndpointLocalNetworkTopologyDetails200Response.to_json() + +# convert the object into a dict +get_endpoint_local_network_topology_details200_response_dict = get_endpoint_local_network_topology_details200_response_instance.to_dict() +# create an instance of GetEndpointLocalNetworkTopologyDetails200Response from a dict +get_endpoint_local_network_topology_details200_response_form_dict = get_endpoint_local_network_topology_details200_response.from_dict(get_endpoint_local_network_topology_details200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/GetEndpointLocalNetworks200Response.md b/endpoint/test_results_api/docs/GetEndpointLocalNetworks200Response.md new file mode 100644 index 00000000..b4bc9e23 --- /dev/null +++ b/endpoint/test_results_api/docs/GetEndpointLocalNetworks200Response.md @@ -0,0 +1,29 @@ +# GetEndpointLocalNetworks200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**local_networks** | [**List[LocalNetworkResult]**](LocalNetworkResult.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_endpoint_local_networks200_response import GetEndpointLocalNetworks200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointLocalNetworks200Response from a JSON string +get_endpoint_local_networks200_response_instance = GetEndpointLocalNetworks200Response.from_json(json) +# print the JSON string representation of the object +print GetEndpointLocalNetworks200Response.to_json() + +# convert the object into a dict +get_endpoint_local_networks200_response_dict = get_endpoint_local_networks200_response_instance.to_dict() +# create an instance of GetEndpointLocalNetworks200Response from a dict +get_endpoint_local_networks200_response_form_dict = get_endpoint_local_networks200_response.from_dict(get_endpoint_local_networks200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/GetEndpointLocalNetworksTopologies200Response.md b/endpoint/test_results_api/docs/GetEndpointLocalNetworksTopologies200Response.md new file mode 100644 index 00000000..2739b201 --- /dev/null +++ b/endpoint/test_results_api/docs/GetEndpointLocalNetworksTopologies200Response.md @@ -0,0 +1,31 @@ +# GetEndpointLocalNetworksTopologies200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[LocalNetworkTopologyResultBase]**](LocalNetworkTopologyResultBase.md) | | [optional] +**links** | [**PaginationNextLinkLinks**](PaginationNextLinkLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_endpoint_local_networks_topologies200_response import GetEndpointLocalNetworksTopologies200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointLocalNetworksTopologies200Response from a JSON string +get_endpoint_local_networks_topologies200_response_instance = GetEndpointLocalNetworksTopologies200Response.from_json(json) +# print the JSON string representation of the object +print GetEndpointLocalNetworksTopologies200Response.to_json() + +# convert the object into a dict +get_endpoint_local_networks_topologies200_response_dict = get_endpoint_local_networks_topologies200_response_instance.to_dict() +# create an instance of GetEndpointLocalNetworksTopologies200Response from a dict +get_endpoint_local_networks_topologies200_response_form_dict = get_endpoint_local_networks_topologies200_response.from_dict(get_endpoint_local_networks_topologies200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/GetEndpointLocalNetworksTopologiesRequest.md b/endpoint/test_results_api/docs/GetEndpointLocalNetworksTopologiesRequest.md new file mode 100644 index 00000000..9fc76a92 --- /dev/null +++ b/endpoint/test_results_api/docs/GetEndpointLocalNetworksTopologiesRequest.md @@ -0,0 +1,28 @@ +# GetEndpointLocalNetworksTopologiesRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**search_filters** | [**EndpointNetworkTopologyResultRequestFilter**](EndpointNetworkTopologyResultRequestFilter.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_endpoint_local_networks_topologies_request import GetEndpointLocalNetworksTopologiesRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointLocalNetworksTopologiesRequest from a JSON string +get_endpoint_local_networks_topologies_request_instance = GetEndpointLocalNetworksTopologiesRequest.from_json(json) +# print the JSON string representation of the object +print GetEndpointLocalNetworksTopologiesRequest.to_json() + +# convert the object into a dict +get_endpoint_local_networks_topologies_request_dict = get_endpoint_local_networks_topologies_request_instance.to_dict() +# create an instance of GetEndpointLocalNetworksTopologiesRequest from a dict +get_endpoint_local_networks_topologies_request_form_dict = get_endpoint_local_networks_topologies_request.from_dict(get_endpoint_local_networks_topologies_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) + + diff --git a/endpoint/test_results_api/docs/GetEndpointRealUserTestDetails200Response.md b/endpoint/test_results_api/docs/GetEndpointRealUserTestDetails200Response.md new file mode 100644 index 00000000..ed26caad --- /dev/null +++ b/endpoint/test_results_api/docs/GetEndpointRealUserTestDetails200Response.md @@ -0,0 +1,29 @@ +# GetEndpointRealUserTestDetails200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[EndpointRealUserTestDetail]**](EndpointRealUserTestDetail.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_endpoint_real_user_test_details200_response import GetEndpointRealUserTestDetails200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointRealUserTestDetails200Response from a JSON string +get_endpoint_real_user_test_details200_response_instance = GetEndpointRealUserTestDetails200Response.from_json(json) +# print the JSON string representation of the object +print GetEndpointRealUserTestDetails200Response.to_json() + +# convert the object into a dict +get_endpoint_real_user_test_details200_response_dict = get_endpoint_real_user_test_details200_response_instance.to_dict() +# create an instance of GetEndpointRealUserTestDetails200Response from a dict +get_endpoint_real_user_test_details200_response_form_dict = get_endpoint_real_user_test_details200_response.from_dict(get_endpoint_real_user_test_details200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/GetEndpointRealUserTestPagesDetails200Response.md b/endpoint/test_results_api/docs/GetEndpointRealUserTestPagesDetails200Response.md new file mode 100644 index 00000000..e195e2c5 --- /dev/null +++ b/endpoint/test_results_api/docs/GetEndpointRealUserTestPagesDetails200Response.md @@ -0,0 +1,28 @@ +# GetEndpointRealUserTestPagesDetails200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_endpoint_real_user_test_pages_details200_response import GetEndpointRealUserTestPagesDetails200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointRealUserTestPagesDetails200Response from a JSON string +get_endpoint_real_user_test_pages_details200_response_instance = GetEndpointRealUserTestPagesDetails200Response.from_json(json) +# print the JSON string representation of the object +print GetEndpointRealUserTestPagesDetails200Response.to_json() + +# convert the object into a dict +get_endpoint_real_user_test_pages_details200_response_dict = get_endpoint_real_user_test_pages_details200_response_instance.to_dict() +# create an instance of GetEndpointRealUserTestPagesDetails200Response from a dict +get_endpoint_real_user_test_pages_details200_response_form_dict = get_endpoint_real_user_test_pages_details200_response.from_dict(get_endpoint_real_user_test_pages_details200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/GetEndpointRealUserTests200Response.md b/endpoint/test_results_api/docs/GetEndpointRealUserTests200Response.md new file mode 100644 index 00000000..ca241c24 --- /dev/null +++ b/endpoint/test_results_api/docs/GetEndpointRealUserTests200Response.md @@ -0,0 +1,31 @@ +# GetEndpointRealUserTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[EndpointRealUserTest]**](EndpointRealUserTest.md) | | [optional] +**links** | [**PaginationNextLinkLinks**](PaginationNextLinkLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_endpoint_real_user_tests200_response import GetEndpointRealUserTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointRealUserTests200Response from a JSON string +get_endpoint_real_user_tests200_response_instance = GetEndpointRealUserTests200Response.from_json(json) +# print the JSON string representation of the object +print GetEndpointRealUserTests200Response.to_json() + +# convert the object into a dict +get_endpoint_real_user_tests200_response_dict = get_endpoint_real_user_tests200_response_instance.to_dict() +# create an instance of GetEndpointRealUserTests200Response from a dict +get_endpoint_real_user_tests200_response_form_dict = get_endpoint_real_user_tests200_response.from_dict(get_endpoint_real_user_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/GetEndpointRealUserTestsNetwork200Response.md b/endpoint/test_results_api/docs/GetEndpointRealUserTestsNetwork200Response.md new file mode 100644 index 00000000..0a39d45e --- /dev/null +++ b/endpoint/test_results_api/docs/GetEndpointRealUserTestsNetwork200Response.md @@ -0,0 +1,31 @@ +# GetEndpointRealUserTestsNetwork200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[RealUserTestNetworkResult]**](RealUserTestNetworkResult.md) | | [optional] +**links** | [**PaginationNextLinkLinks**](PaginationNextLinkLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_endpoint_real_user_tests_network200_response import GetEndpointRealUserTestsNetwork200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointRealUserTestsNetwork200Response from a JSON string +get_endpoint_real_user_tests_network200_response_instance = GetEndpointRealUserTestsNetwork200Response.from_json(json) +# print the JSON string representation of the object +print GetEndpointRealUserTestsNetwork200Response.to_json() + +# convert the object into a dict +get_endpoint_real_user_tests_network200_response_dict = get_endpoint_real_user_tests_network200_response_instance.to_dict() +# create an instance of GetEndpointRealUserTestsNetwork200Response from a dict +get_endpoint_real_user_tests_network200_response_form_dict = get_endpoint_real_user_tests_network200_response.from_dict(get_endpoint_real_user_tests_network200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/GetEndpointRealUserTestsPages200Response.md b/endpoint/test_results_api/docs/GetEndpointRealUserTestsPages200Response.md new file mode 100644 index 00000000..7cb3a2dc --- /dev/null +++ b/endpoint/test_results_api/docs/GetEndpointRealUserTestsPages200Response.md @@ -0,0 +1,31 @@ +# GetEndpointRealUserTestsPages200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[RealUserTestPageResult]**](RealUserTestPageResult.md) | | [optional] +**links** | [**PaginationNextLinkLinks**](PaginationNextLinkLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_endpoint_real_user_tests_pages200_response import GetEndpointRealUserTestsPages200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointRealUserTestsPages200Response from a JSON string +get_endpoint_real_user_tests_pages200_response_instance = GetEndpointRealUserTestsPages200Response.from_json(json) +# print the JSON string representation of the object +print GetEndpointRealUserTestsPages200Response.to_json() + +# convert the object into a dict +get_endpoint_real_user_tests_pages200_response_dict = get_endpoint_real_user_tests_pages200_response_instance.to_dict() +# create an instance of GetEndpointRealUserTestsPages200Response from a dict +get_endpoint_real_user_tests_pages200_response_form_dict = get_endpoint_real_user_tests_pages200_response.from_dict(get_endpoint_real_user_tests_pages200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/GetEndpointRealUserTestsRequest.md b/endpoint/test_results_api/docs/GetEndpointRealUserTestsRequest.md new file mode 100644 index 00000000..ba45c8c5 --- /dev/null +++ b/endpoint/test_results_api/docs/GetEndpointRealUserTestsRequest.md @@ -0,0 +1,28 @@ +# GetEndpointRealUserTestsRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**search_filters** | [**EndpointRealUserTestResultRequestFilter**](EndpointRealUserTestResultRequestFilter.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_endpoint_real_user_tests_request import GetEndpointRealUserTestsRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointRealUserTestsRequest from a JSON string +get_endpoint_real_user_tests_request_instance = GetEndpointRealUserTestsRequest.from_json(json) +# print the JSON string representation of the object +print GetEndpointRealUserTestsRequest.to_json() + +# convert the object into a dict +get_endpoint_real_user_tests_request_dict = get_endpoint_real_user_tests_request_instance.to_dict() +# create an instance of GetEndpointRealUserTestsRequest from a dict +get_endpoint_real_user_tests_request_form_dict = get_endpoint_real_user_tests_request.from_dict(get_endpoint_real_user_tests_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) + + diff --git a/endpoint/test_results_api/docs/GetTestResultHttpServer200Response.md b/endpoint/test_results_api/docs/GetTestResultHttpServer200Response.md new file mode 100644 index 00000000..f7748323 --- /dev/null +++ b/endpoint/test_results_api/docs/GetTestResultHttpServer200Response.md @@ -0,0 +1,32 @@ +# GetTestResultHttpServer200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[HttpTestResult]**](HttpTestResult.md) | | [optional] +**test** | [**EndpointHttpServerTest**](EndpointHttpServerTest.md) | | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**PaginationNextLinkLinks**](PaginationNextLinkLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_http_server200_response import GetTestResultHttpServer200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultHttpServer200Response from a JSON string +get_test_result_http_server200_response_instance = GetTestResultHttpServer200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultHttpServer200Response.to_json() + +# convert the object into a dict +get_test_result_http_server200_response_dict = get_test_result_http_server200_response_instance.to_dict() +# create an instance of GetTestResultHttpServer200Response from a dict +get_test_result_http_server200_response_form_dict = get_test_result_http_server200_response.from_dict(get_test_result_http_server200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/GetTestResultNetworkPathvis200Response.md b/endpoint/test_results_api/docs/GetTestResultNetworkPathvis200Response.md new file mode 100644 index 00000000..399751a8 --- /dev/null +++ b/endpoint/test_results_api/docs/GetTestResultNetworkPathvis200Response.md @@ -0,0 +1,32 @@ +# GetTestResultNetworkPathvis200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisTestResult]**](PathVisTestResult.md) | | [optional] +**test** | [**EndpointScheduledTest**](EndpointScheduledTest.md) | | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_network_pathvis200_response import GetTestResultNetworkPathvis200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultNetworkPathvis200Response from a JSON string +get_test_result_network_pathvis200_response_instance = GetTestResultNetworkPathvis200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultNetworkPathvis200Response.to_json() + +# convert the object into a dict +get_test_result_network_pathvis200_response_dict = get_test_result_network_pathvis200_response_instance.to_dict() +# create an instance of GetTestResultNetworkPathvis200Response from a dict +get_test_result_network_pathvis200_response_form_dict = get_test_result_network_pathvis200_response.from_dict(get_test_result_network_pathvis200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/GetTestResultPathvisAgentRound200Response.md b/endpoint/test_results_api/docs/GetTestResultPathvisAgentRound200Response.md new file mode 100644 index 00000000..f80eeded --- /dev/null +++ b/endpoint/test_results_api/docs/GetTestResultPathvisAgentRound200Response.md @@ -0,0 +1,30 @@ +# GetTestResultPathvisAgentRound200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisDetailTestResult]**](PathVisDetailTestResult.md) | | [optional] +**test** | [**EndpointScheduledTest**](EndpointScheduledTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_pathvis_agent_round200_response import GetTestResultPathvisAgentRound200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultPathvisAgentRound200Response from a JSON string +get_test_result_pathvis_agent_round200_response_instance = GetTestResultPathvisAgentRound200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultPathvisAgentRound200Response.to_json() + +# convert the object into a dict +get_test_result_pathvis_agent_round200_response_dict = get_test_result_pathvis_agent_round200_response_instance.to_dict() +# create an instance of GetTestResultPathvisAgentRound200Response from a dict +get_test_result_pathvis_agent_round200_response_form_dict = get_test_result_pathvis_agent_round200_response.from_dict(get_test_result_pathvis_agent_round200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/Hop.md b/endpoint/test_results_api/docs/Hop.md new file mode 100644 index 00000000..bf1b6050 --- /dev/null +++ b/endpoint/test_results_api/docs/Hop.md @@ -0,0 +1,30 @@ +# Hop + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hop** | **int** | The hop index. | [optional] [readonly] +**ip_address** | **str** | IP address of the hop. | [optional] [readonly] +**prefix** | **str** | Prefix of IP address shown in CIDR. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.hop import Hop + +# TODO update the JSON string below +json = "{}" +# create an instance of Hop from a JSON string +hop_instance = Hop.from_json(json) +# print the JSON string representation of the object +print Hop.to_json() + +# convert the object into a dict +hop_dict = hop_instance.to_dict() +# create an instance of Hop from a dict +hop_form_dict = hop.from_dict(hop_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/HttpErrorType.md b/endpoint/test_results_api/docs/HttpErrorType.md new file mode 100644 index 00000000..44c5e0a2 --- /dev/null +++ b/endpoint/test_results_api/docs/HttpErrorType.md @@ -0,0 +1,11 @@ +# HttpErrorType + +Type of error encountered; corresponds to phase of connection. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/HttpTestResult.md b/endpoint/test_results_api/docs/HttpTestResult.md new file mode 100644 index 00000000..7ce11181 --- /dev/null +++ b/endpoint/test_results_api/docs/HttpTestResult.md @@ -0,0 +1,48 @@ +# HttpTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**aid** | [**AccountGroupId**](AccountGroupId.md) | | [optional] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of destination server. | [optional] [readonly] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**connect_time** | **int** | Time required to establish a TCP connection to the server in milliseconds. | [optional] [readonly] +**dns_time** | **int** | Time required to resolve DNS in milliseconds. | [optional] [readonly] +**error_type** | [**HttpErrorType**](HttpErrorType.md) | | [optional] +**error_details** | **str** | Error details, if an error were encountered. | [optional] [readonly] +**headers** | [**HttpTestResultHeaders**](HttpTestResultHeaders.md) | | [optional] +**num_redirects** | **int** | Number of redirects. | [optional] [readonly] +**receive_time** | **int** | Elapsed time between first and last byte of response in milliseconds. | [optional] [readonly] +**redirect_time** | **int** | Cumulative redirect timing in milliseconds. | [optional] [readonly] +**response_code** | **int** | HTTP response code. | [optional] [readonly] +**response_time** | **int** | Time to first byte in milliseconds. | [optional] [readonly] +**ssl_time** | **int** | Time to negotiate SSL/TLS in milliseconds. | [optional] [readonly] +**total_time** | **int** | Total time is the response time + receive time. | [optional] [readonly] +**wait_time** | **int** | Time elapsed between completion of request and first byte of response in milliseconds. | [optional] [readonly] +**wire_size** | **int** | Size of content in bytes. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.http_test_result import HttpTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpTestResult from a JSON string +http_test_result_instance = HttpTestResult.from_json(json) +# print the JSON string representation of the object +print HttpTestResult.to_json() + +# convert the object into a dict +http_test_result_dict = http_test_result_instance.to_dict() +# create an instance of HttpTestResult from a dict +http_test_result_form_dict = http_test_result.from_dict(http_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/HttpTestResultHeaders.md b/endpoint/test_results_api/docs/HttpTestResultHeaders.md new file mode 100644 index 00000000..b7456312 --- /dev/null +++ b/endpoint/test_results_api/docs/HttpTestResultHeaders.md @@ -0,0 +1,30 @@ +# HttpTestResultHeaders + +Expandable object containing both request and response headers. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_headers** | **str** | CRLF-delimited list of request headers in `header: value` format. | [optional] [readonly] +**response_headers** | **str** | CRLF-delimited list of response headers in `header: value` format. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.http_test_result_headers import HttpTestResultHeaders + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpTestResultHeaders from a JSON string +http_test_result_headers_instance = HttpTestResultHeaders.from_json(json) +# print the JSON string representation of the object +print HttpTestResultHeaders.to_json() + +# convert the object into a dict +http_test_result_headers_dict = http_test_result_headers_instance.to_dict() +# create an instance of HttpTestResultHeaders from a dict +http_test_result_headers_form_dict = http_test_result_headers.from_dict(http_test_result_headers_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/HttpTestResults.md b/endpoint/test_results_api/docs/HttpTestResults.md new file mode 100644 index 00000000..e8198182 --- /dev/null +++ b/endpoint/test_results_api/docs/HttpTestResults.md @@ -0,0 +1,29 @@ +# HttpTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[HttpTestResult]**](HttpTestResult.md) | | [optional] +**test** | [**EndpointHttpServerTest**](EndpointHttpServerTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.http_test_results import HttpTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpTestResults from a JSON string +http_test_results_instance = HttpTestResults.from_json(json) +# print the JSON string representation of the object +print HttpTestResults.to_json() + +# convert the object into a dict +http_test_results_dict = http_test_results_instance.to_dict() +# create an instance of HttpTestResults from a dict +http_test_results_form_dict = http_test_results.from_dict(http_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/InterfaceHardwareType.md b/endpoint/test_results_api/docs/InterfaceHardwareType.md new file mode 100644 index 00000000..b4967774 --- /dev/null +++ b/endpoint/test_results_api/docs/InterfaceHardwareType.md @@ -0,0 +1,10 @@ +# InterfaceHardwareType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/Link.md b/endpoint/test_results_api/docs/Link.md new file mode 100644 index 00000000..ceef9be3 --- /dev/null +++ b/endpoint/test_results_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from test_results_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/LocalNetworkResult.md b/endpoint/test_results_api/docs/LocalNetworkResult.md new file mode 100644 index 00000000..87138a95 --- /dev/null +++ b/endpoint/test_results_api/docs/LocalNetworkResult.md @@ -0,0 +1,31 @@ +# LocalNetworkResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**network_id** | **str** | The network ID. Each network occurrence has a unique ID. | [optional] [readonly] +**network_name** | **str** | The network name. | [optional] [readonly] +**local_prefix** | **str** | Network local private address. | [optional] [readonly] +**public_ip_range** | **str** | Network public IP range. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.local_network_result import LocalNetworkResult + +# TODO update the JSON string below +json = "{}" +# create an instance of LocalNetworkResult from a JSON string +local_network_result_instance = LocalNetworkResult.from_json(json) +# print the JSON string representation of the object +print LocalNetworkResult.to_json() + +# convert the object into a dict +local_network_result_dict = local_network_result_instance.to_dict() +# create an instance of LocalNetworkResult from a dict +local_network_result_form_dict = local_network_result.from_dict(local_network_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/LocalNetworkResults.md b/endpoint/test_results_api/docs/LocalNetworkResults.md new file mode 100644 index 00000000..20ce0e6f --- /dev/null +++ b/endpoint/test_results_api/docs/LocalNetworkResults.md @@ -0,0 +1,28 @@ +# LocalNetworkResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**local_networks** | [**List[LocalNetworkResult]**](LocalNetworkResult.md) | | [optional] + +## Example + +```python +from test_results_api.models.local_network_results import LocalNetworkResults + +# TODO update the JSON string below +json = "{}" +# create an instance of LocalNetworkResults from a JSON string +local_network_results_instance = LocalNetworkResults.from_json(json) +# print the JSON string representation of the object +print LocalNetworkResults.to_json() + +# convert the object into a dict +local_network_results_dict = local_network_results_instance.to_dict() +# create an instance of LocalNetworkResults from a dict +local_network_results_form_dict = local_network_results.from_dict(local_network_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/LocalNetworkTestsResultsApi.md b/endpoint/test_results_api/docs/LocalNetworkTestsResultsApi.md new file mode 100644 index 00000000..33ba9a38 --- /dev/null +++ b/endpoint/test_results_api/docs/LocalNetworkTestsResultsApi.md @@ -0,0 +1,274 @@ +# test_results_api.LocalNetworkTestsResultsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_endpoint_local_network_topology_details**](LocalNetworkTestsResultsApi.md#get_endpoint_local_network_topology_details) | **GET** /v7/endpoint/test-results/local-networks/topologies/{networkTopologyId} | Retrieve endpoint local network topology +[**get_endpoint_local_networks**](LocalNetworkTestsResultsApi.md#get_endpoint_local_networks) | **GET** /v7/endpoint/test-results/local-networks | List local networks +[**get_endpoint_local_networks_topologies**](LocalNetworkTestsResultsApi.md#get_endpoint_local_networks_topologies) | **POST** /v7/endpoint/test-results/local-networks/topologies/filter | List endpoint network topologies probes + + +# **get_endpoint_local_network_topology_details** +> GetEndpointLocalNetworkTopologyDetails200Response get_endpoint_local_network_topology_details(network_topology_id, aid=aid) + +Retrieve endpoint local network topology + +Returns detailed data of a local network topology. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_endpoint_local_network_topology_details200_response import GetEndpointLocalNetworkTopologyDetails200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.LocalNetworkTestsResultsApi(api_client) + network_topology_id = '00160:39c518560de9:1491651900:236e6f18' # str | The network topology ID. + 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 endpoint local network topology + api_response = api_instance.get_endpoint_local_network_topology_details(network_topology_id, aid=aid) + print("The response of LocalNetworkTestsResultsApi->get_endpoint_local_network_topology_details:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LocalNetworkTestsResultsApi->get_endpoint_local_network_topology_details: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **network_topology_id** | **str**| The network topology ID. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetEndpointLocalNetworkTopologyDetails200Response**](GetEndpointLocalNetworkTopologyDetails200Response.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 | - | + +[[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_endpoint_local_networks** +> GetEndpointLocalNetworks200Response get_endpoint_local_networks(aid=aid) + +List local networks + +Returns a list of all the networks used by endpoint agents. Sends back a `localNetworks` array. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_endpoint_local_networks200_response import GetEndpointLocalNetworks200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.LocalNetworkTestsResultsApi(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 local networks + api_response = api_instance.get_endpoint_local_networks(aid=aid) + print("The response of LocalNetworkTestsResultsApi->get_endpoint_local_networks:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LocalNetworkTestsResultsApi->get_endpoint_local_networks: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetEndpointLocalNetworks200Response**](GetEndpointLocalNetworks200Response.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 | - | + +[[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_endpoint_local_networks_topologies** +> GetEndpointLocalNetworksTopologies200Response get_endpoint_local_networks_topologies(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, get_endpoint_local_networks_topologies_request=get_endpoint_local_networks_topologies_request) + +List endpoint network topologies probes + +Returns a list of all endpoint local network topologies probes. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter?window=12h' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Warning Note that a maximum of 12h worth of data can be retrieved at once. If you need more, you need to make multiple requests. Returns a `results` array of network topology probes. Network topology probes shown are from the latest round, or based on the time range specified. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_endpoint_local_networks_topologies200_response import GetEndpointLocalNetworksTopologies200Response +from test_results_api.models.get_endpoint_local_networks_topologies_request import GetEndpointLocalNetworksTopologiesRequest +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.LocalNetworkTestsResultsApi(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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + get_endpoint_local_networks_topologies_request = test_results_api.GetEndpointLocalNetworksTopologiesRequest() # GetEndpointLocalNetworksTopologiesRequest | (optional) + + try: + # List endpoint network topologies probes + api_response = api_instance.get_endpoint_local_networks_topologies(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, get_endpoint_local_networks_topologies_request=get_endpoint_local_networks_topologies_request) + print("The response of LocalNetworkTestsResultsApi->get_endpoint_local_networks_topologies:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LocalNetworkTestsResultsApi->get_endpoint_local_networks_topologies: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **get_endpoint_local_networks_topologies_request** | [**GetEndpointLocalNetworksTopologiesRequest**](GetEndpointLocalNetworksTopologiesRequest.md)| | [optional] + +### Return type + +[**GetEndpointLocalNetworksTopologies200Response**](GetEndpointLocalNetworksTopologies200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/test_results_api/docs/LocalNetworkTopologyDetailResults.md b/endpoint/test_results_api/docs/LocalNetworkTopologyDetailResults.md new file mode 100644 index 00000000..c14a8a8a --- /dev/null +++ b/endpoint/test_results_api/docs/LocalNetworkTopologyDetailResults.md @@ -0,0 +1,28 @@ +# LocalNetworkTopologyDetailResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[LocalNetworkTopologyResult]**](LocalNetworkTopologyResult.md) | | [optional] + +## Example + +```python +from test_results_api.models.local_network_topology_detail_results import LocalNetworkTopologyDetailResults + +# TODO update the JSON string below +json = "{}" +# create an instance of LocalNetworkTopologyDetailResults from a JSON string +local_network_topology_detail_results_instance = LocalNetworkTopologyDetailResults.from_json(json) +# print the JSON string representation of the object +print LocalNetworkTopologyDetailResults.to_json() + +# convert the object into a dict +local_network_topology_detail_results_dict = local_network_topology_detail_results_instance.to_dict() +# create an instance of LocalNetworkTopologyDetailResults from a dict +local_network_topology_detail_results_form_dict = local_network_topology_detail_results.from_dict(local_network_topology_detail_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/LocalNetworkTopologyResult.md b/endpoint/test_results_api/docs/LocalNetworkTopologyResult.md new file mode 100644 index 00000000..7645f413 --- /dev/null +++ b/endpoint/test_results_api/docs/LocalNetworkTopologyResult.md @@ -0,0 +1,42 @@ +# LocalNetworkTopologyResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**var_date** | **datetime** | UTC date when endpoint network topology took place (ISO date-time format). | [optional] [readonly] +**network_topology_id** | **str** | Network topology ID. Each network topology occurrence has a unique ID. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**target** | **str** | IP of the target the network topology was performed against. This is typically a default gateway, proxy or VPN endpoint. | [optional] [readonly] +**target_port** | **float** | Port of the target the network topology was performed against. | [optional] [readonly] +**type** | [**NetworkTopologyType**](NetworkTopologyType.md) | | [optional] [readonly] +**icmp_ping** | [**NetworkPing**](NetworkPing.md) | | [optional] +**is_icmp_blocked** | **bool** | Set to `true` if network target is blocking ICMP echo (ping) queries. | [optional] [readonly] +**tcp_connect** | [**TcpConnect**](TcpConnect.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**coordinates** | [**RealUserTestCoordinates**](RealUserTestCoordinates.md) | | [optional] +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**icmp_traceroute** | [**Traceroute**](Traceroute.md) | | [optional] +**icmp_traceroutes** | [**List[Traceroute]**](Traceroute.md) | | [optional] + +## Example + +```python +from test_results_api.models.local_network_topology_result import LocalNetworkTopologyResult + +# TODO update the JSON string below +json = "{}" +# create an instance of LocalNetworkTopologyResult from a JSON string +local_network_topology_result_instance = LocalNetworkTopologyResult.from_json(json) +# print the JSON string representation of the object +print LocalNetworkTopologyResult.to_json() + +# convert the object into a dict +local_network_topology_result_dict = local_network_topology_result_instance.to_dict() +# create an instance of LocalNetworkTopologyResult from a dict +local_network_topology_result_form_dict = local_network_topology_result.from_dict(local_network_topology_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/LocalNetworkTopologyResultBase.md b/endpoint/test_results_api/docs/LocalNetworkTopologyResultBase.md new file mode 100644 index 00000000..ea7b11d3 --- /dev/null +++ b/endpoint/test_results_api/docs/LocalNetworkTopologyResultBase.md @@ -0,0 +1,38 @@ +# LocalNetworkTopologyResultBase + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**var_date** | **datetime** | UTC date when endpoint network topology took place (ISO date-time format). | [optional] [readonly] +**network_topology_id** | **str** | Network topology ID. Each network topology occurrence has a unique ID. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**target** | **str** | IP of the target the network topology was performed against. This is typically a default gateway, proxy or VPN endpoint. | [optional] [readonly] +**target_port** | **float** | Port of the target the network topology was performed against. | [optional] [readonly] +**type** | [**NetworkTopologyType**](NetworkTopologyType.md) | | [optional] [readonly] +**icmp_ping** | [**NetworkPing**](NetworkPing.md) | | [optional] +**is_icmp_blocked** | **bool** | Set to `true` if network target is blocking ICMP echo (ping) queries. | [optional] [readonly] +**tcp_connect** | [**TcpConnect**](TcpConnect.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] + +## Example + +```python +from test_results_api.models.local_network_topology_result_base import LocalNetworkTopologyResultBase + +# TODO update the JSON string below +json = "{}" +# create an instance of LocalNetworkTopologyResultBase from a JSON string +local_network_topology_result_base_instance = LocalNetworkTopologyResultBase.from_json(json) +# print the JSON string representation of the object +print LocalNetworkTopologyResultBase.to_json() + +# convert the object into a dict +local_network_topology_result_base_dict = local_network_topology_result_base_instance.to_dict() +# create an instance of LocalNetworkTopologyResultBase from a dict +local_network_topology_result_base_form_dict = local_network_topology_result_base.from_dict(local_network_topology_result_base_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/LocalNetworkTopologyResults.md b/endpoint/test_results_api/docs/LocalNetworkTopologyResults.md new file mode 100644 index 00000000..e5d865cf --- /dev/null +++ b/endpoint/test_results_api/docs/LocalNetworkTopologyResults.md @@ -0,0 +1,28 @@ +# LocalNetworkTopologyResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[LocalNetworkTopologyResultBase]**](LocalNetworkTopologyResultBase.md) | | [optional] + +## Example + +```python +from test_results_api.models.local_network_topology_results import LocalNetworkTopologyResults + +# TODO update the JSON string below +json = "{}" +# create an instance of LocalNetworkTopologyResults from a JSON string +local_network_topology_results_instance = LocalNetworkTopologyResults.from_json(json) +# print the JSON string representation of the object +print LocalNetworkTopologyResults.to_json() + +# convert the object into a dict +local_network_topology_results_dict = local_network_topology_results_instance.to_dict() +# create an instance of LocalNetworkTopologyResults from a dict +local_network_topology_results_form_dict = local_network_topology_results.from_dict(local_network_topology_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/MultiTestIdNetworkTestResults.md b/endpoint/test_results_api/docs/MultiTestIdNetworkTestResults.md new file mode 100644 index 00000000..d4b87c25 --- /dev/null +++ b/endpoint/test_results_api/docs/MultiTestIdNetworkTestResults.md @@ -0,0 +1,28 @@ +# MultiTestIdNetworkTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[NetworkTestResult]**](NetworkTestResult.md) | | [optional] + +## Example + +```python +from test_results_api.models.multi_test_id_network_test_results import MultiTestIdNetworkTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiTestIdNetworkTestResults from a JSON string +multi_test_id_network_test_results_instance = MultiTestIdNetworkTestResults.from_json(json) +# print the JSON string representation of the object +print MultiTestIdNetworkTestResults.to_json() + +# convert the object into a dict +multi_test_id_network_test_results_dict = multi_test_id_network_test_results_instance.to_dict() +# create an instance of MultiTestIdNetworkTestResults from a dict +multi_test_id_network_test_results_form_dict = multi_test_id_network_test_results.from_dict(multi_test_id_network_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/MultiTestIdTestsDataRoundsSearch.md b/endpoint/test_results_api/docs/MultiTestIdTestsDataRoundsSearch.md new file mode 100644 index 00000000..14aea767 --- /dev/null +++ b/endpoint/test_results_api/docs/MultiTestIdTestsDataRoundsSearch.md @@ -0,0 +1,30 @@ +# MultiTestIdTestsDataRoundsSearch + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**search_sort** | [**List[TestsDataSearchSort]**](TestsDataSearchSort.md) | | [optional] +**threshold_filter** | [**TestsDataThresholdFilters**](TestsDataThresholdFilters.md) | | [optional] +**search_filters** | [**MultiTestIdTestsDataSearchFilter**](MultiTestIdTestsDataSearchFilter.md) | | [optional] + +## Example + +```python +from test_results_api.models.multi_test_id_tests_data_rounds_search import MultiTestIdTestsDataRoundsSearch + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiTestIdTestsDataRoundsSearch from a JSON string +multi_test_id_tests_data_rounds_search_instance = MultiTestIdTestsDataRoundsSearch.from_json(json) +# print the JSON string representation of the object +print MultiTestIdTestsDataRoundsSearch.to_json() + +# convert the object into a dict +multi_test_id_tests_data_rounds_search_dict = multi_test_id_tests_data_rounds_search_instance.to_dict() +# create an instance of MultiTestIdTestsDataRoundsSearch from a dict +multi_test_id_tests_data_rounds_search_form_dict = multi_test_id_tests_data_rounds_search.from_dict(multi_test_id_tests_data_rounds_search_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/MultiTestIdTestsDataSearchFilter.md b/endpoint/test_results_api/docs/MultiTestIdTestsDataSearchFilter.md new file mode 100644 index 00000000..43bdada0 --- /dev/null +++ b/endpoint/test_results_api/docs/MultiTestIdTestsDataSearchFilter.md @@ -0,0 +1,29 @@ +# MultiTestIdTestsDataSearchFilter + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **List[str]** | Filter using the `agent-id`. | [optional] +**test_id** | **List[str]** | | [optional] + +## Example + +```python +from test_results_api.models.multi_test_id_tests_data_search_filter import MultiTestIdTestsDataSearchFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiTestIdTestsDataSearchFilter from a JSON string +multi_test_id_tests_data_search_filter_instance = MultiTestIdTestsDataSearchFilter.from_json(json) +# print the JSON string representation of the object +print MultiTestIdTestsDataSearchFilter.to_json() + +# convert the object into a dict +multi_test_id_tests_data_search_filter_dict = multi_test_id_tests_data_search_filter_instance.to_dict() +# create an instance of MultiTestIdTestsDataSearchFilter from a dict +multi_test_id_tests_data_search_filter_form_dict = multi_test_id_tests_data_search_filter.from_dict(multi_test_id_tests_data_search_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/NetworkDynamicTestResult.md b/endpoint/test_results_api/docs/NetworkDynamicTestResult.md new file mode 100644 index 00000000..e8fe0fbf --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkDynamicTestResult.md @@ -0,0 +1,43 @@ +# NetworkDynamicTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**aid** | [**AccountGroupId**](AccountGroupId.md) | | [optional] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**avg_latency** | **float** | Average RTT for packets sent to destination. | [optional] [readonly] +**error_details** | **str** | Error details, if an error was encountered. | [optional] [readonly] +**jitter** | **float** | Standard deviation of latency. | [optional] [readonly] +**is_icmp_blocked** | **bool** | Set to `true` if network target is blocking ICMP echo (ping) queries. | [optional] [readonly] +**loss** | **float** | Percentage of packets not reaching destination. | [optional] [readonly] +**max_latency** | **float** | Maximum RTT for packets sent to destination. | [optional] [readonly] +**min_latency** | **float** | Minimum RTT for packets sent to destination. | [optional] [readonly] +**application** | [**DynamicTestApplication**](DynamicTestApplication.md) | | [optional] +**webex** | [**DynamicBaseTestResultWebex**](DynamicBaseTestResultWebex.md) | | [optional] + +## Example + +```python +from test_results_api.models.network_dynamic_test_result import NetworkDynamicTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkDynamicTestResult from a JSON string +network_dynamic_test_result_instance = NetworkDynamicTestResult.from_json(json) +# print the JSON string representation of the object +print NetworkDynamicTestResult.to_json() + +# convert the object into a dict +network_dynamic_test_result_dict = network_dynamic_test_result_instance.to_dict() +# create an instance of NetworkDynamicTestResult from a dict +network_dynamic_test_result_form_dict = network_dynamic_test_result.from_dict(network_dynamic_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/NetworkDynamicTestResults.md b/endpoint/test_results_api/docs/NetworkDynamicTestResults.md new file mode 100644 index 00000000..121c00f7 --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkDynamicTestResults.md @@ -0,0 +1,29 @@ +# NetworkDynamicTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[NetworkDynamicTestResult]**](NetworkDynamicTestResult.md) | | [optional] +**test** | [**DynamicTest**](DynamicTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.network_dynamic_test_results import NetworkDynamicTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkDynamicTestResults from a JSON string +network_dynamic_test_results_instance = NetworkDynamicTestResults.from_json(json) +# print the JSON string representation of the object +print NetworkDynamicTestResults.to_json() + +# convert the object into a dict +network_dynamic_test_results_dict = network_dynamic_test_results_instance.to_dict() +# create an instance of NetworkDynamicTestResults from a dict +network_dynamic_test_results_form_dict = network_dynamic_test_results.from_dict(network_dynamic_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/NetworkDynamicTestsResultsApi.md b/endpoint/test_results_api/docs/NetworkDynamicTestsResultsApi.md new file mode 100644 index 00000000..9b6cebdc --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkDynamicTestsResultsApi.md @@ -0,0 +1,290 @@ +# test_results_api.NetworkDynamicTestsResultsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_dynamic_test_result_network_pathvis**](NetworkDynamicTestsResultsApi.md#get_dynamic_test_result_network_pathvis) | **GET** /v7/endpoint/test-results/dynamic-tests/{testId}/pathvis | Retrieve pathvis network dynamic test results +[**get_dynamic_test_result_pathvis_agent_round**](NetworkDynamicTestsResultsApi.md#get_dynamic_test_result_pathvis_agent_round) | **GET** /v7/endpoint/test-results/dynamic-tests/{testId}/pathvis/agent/{agentId}/round/{roundId} | Retrieve pathvis network dynamic test results details +[**post_fetch_dynamic_test_result_metrics**](NetworkDynamicTestsResultsApi.md#post_fetch_dynamic_test_result_metrics) | **POST** /v7/endpoint/test-results/dynamic-tests/{testId}/network/filter | Retrieve network dynamic test results + + +# **get_dynamic_test_result_network_pathvis** +> GetDynamicTestResultNetworkPathvis200Response get_dynamic_test_result_network_pathvis(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Retrieve pathvis network dynamic test results + +Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours will be returned. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_dynamic_test_result_network_pathvis200_response import GetDynamicTestResultNetworkPathvis200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.NetworkDynamicTestsResultsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # Retrieve pathvis network dynamic test results + api_response = api_instance.get_dynamic_test_result_network_pathvis(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of NetworkDynamicTestsResultsApi->get_dynamic_test_result_network_pathvis:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkDynamicTestsResultsApi->get_dynamic_test_result_network_pathvis: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**GetDynamicTestResultNetworkPathvis200Response**](GetDynamicTestResultNetworkPathvis200Response.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 | - | + +[[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_dynamic_test_result_pathvis_agent_round** +> GetDynamicTestResultPathvisAgentRound200Response get_dynamic_test_result_pathvis_agent_round(test_id, agent_id, round_id, aid=aid) + +Retrieve pathvis network dynamic test results details + +Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_dynamic_test_result_pathvis_agent_round200_response import GetDynamicTestResultPathvisAgentRound200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.NetworkDynamicTestsResultsApi(api_client) + test_id = '202701' # str | Test ID + agent_id = '11' # str | Agent ID + round_id = '1384309800' # str | Round ID + 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 pathvis network dynamic test results details + api_response = api_instance.get_dynamic_test_result_pathvis_agent_round(test_id, agent_id, round_id, aid=aid) + print("The response of NetworkDynamicTestsResultsApi->get_dynamic_test_result_pathvis_agent_round:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkDynamicTestsResultsApi->get_dynamic_test_result_pathvis_agent_round: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_id** | **str**| Agent ID | + **round_id** | **str**| Round ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetDynamicTestResultPathvisAgentRound200Response**](GetDynamicTestResultPathvisAgentRound200Response.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 | - | +**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 | - | + +[[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) + +# **post_fetch_dynamic_test_result_metrics** +> PostFetchDynamicTestResultMetrics200Response post_fetch_dynamic_test_result_metrics(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, dynamic_tests_data_round_search=dynamic_tests_data_round_search) + +Retrieve network dynamic test results + +Returns network metrics (`loss`, `latency`, `jitter` and `bandwidth`) from each endpoint agent, for each `roundId` in the requested window. When Time Frame is provided the rounds specific to the time frame is returned and the order is not pre-defined unless a user specifies the sort order in filter. When no time frame is provided the latest rounds are returned. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.dynamic_tests_data_round_search import DynamicTestsDataRoundSearch +from test_results_api.models.post_fetch_dynamic_test_result_metrics200_response import PostFetchDynamicTestResultMetrics200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.NetworkDynamicTestsResultsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + dynamic_tests_data_round_search = test_results_api.DynamicTestsDataRoundSearch() # DynamicTestsDataRoundSearch | Tests data search filters. (optional) + + try: + # Retrieve network dynamic test results + api_response = api_instance.post_fetch_dynamic_test_result_metrics(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, dynamic_tests_data_round_search=dynamic_tests_data_round_search) + print("The response of NetworkDynamicTestsResultsApi->post_fetch_dynamic_test_result_metrics:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkDynamicTestsResultsApi->post_fetch_dynamic_test_result_metrics: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **dynamic_tests_data_round_search** | [**DynamicTestsDataRoundSearch**](DynamicTestsDataRoundSearch.md)| Tests data search filters. | [optional] + +### Return type + +[**PostFetchDynamicTestResultMetrics200Response**](PostFetchDynamicTestResultMetrics200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/test_results_api/docs/NetworkInterface.md b/endpoint/test_results_api/docs/NetworkInterface.md new file mode 100644 index 00000000..826e85c5 --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkInterface.md @@ -0,0 +1,35 @@ +# NetworkInterface + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_address** | **str** | Network IP address. | [optional] [readonly] +**subnet_mask** | **str** | Network subnet mask. | [optional] [readonly] +**public_ip_address** | **str** | Network public IP address. | [optional] [readonly] +**local_prefix** | **str** | Network local prefix. | [optional] [readonly] +**public_ip_range** | **str** | Network public IP range. | [optional] [readonly] +**dns_servers** | **List[str]** | Network DNS servers. | [optional] [readonly] +**hardware_type** | [**InterfaceHardwareType**](InterfaceHardwareType.md) | | [optional] +**interface_name** | **str** | Network interface name. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.network_interface import NetworkInterface + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkInterface from a JSON string +network_interface_instance = NetworkInterface.from_json(json) +# print the JSON string representation of the object +print NetworkInterface.to_json() + +# convert the object into a dict +network_interface_dict = network_interface_instance.to_dict() +# create an instance of NetworkInterface from a dict +network_interface_form_dict = network_interface.from_dict(network_interface_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/NetworkMetrics.md b/endpoint/test_results_api/docs/NetworkMetrics.md new file mode 100644 index 00000000..51508bf2 --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkMetrics.md @@ -0,0 +1,31 @@ +# NetworkMetrics + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**jitter** | **int** | Network jitter. | [optional] [readonly] +**latency** | **int** | Network latency. | [optional] [readonly] +**loss** | **float** | Network loss. | [optional] [readonly] +**target** | **str** | Network target IP address. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.network_metrics import NetworkMetrics + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkMetrics from a JSON string +network_metrics_instance = NetworkMetrics.from_json(json) +# print the JSON string representation of the object +print NetworkMetrics.to_json() + +# convert the object into a dict +network_metrics_dict = network_metrics_instance.to_dict() +# create an instance of NetworkMetrics from a dict +network_metrics_form_dict = network_metrics.from_dict(network_metrics_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/NetworkPing.md b/endpoint/test_results_api/docs/NetworkPing.md new file mode 100644 index 00000000..89ccdc5f --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkPing.md @@ -0,0 +1,35 @@ +# NetworkPing + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avg_rtt** | **int** | Ping average response time. | [optional] [readonly] +**max_rtt** | **int** | Ping maximum response time. | [optional] [readonly] +**mean_dev_rtt** | **int** | Ping mean standard deviation response time. | [optional] [readonly] +**min_rtt** | **int** | Ping minimum response time. | [optional] [readonly] +**pkts_received** | **int** | Ping packets received. | [optional] [readonly] +**pkts_sent** | **int** | Ping packets sent. | [optional] [readonly] +**error** | **str** | Only present when there is an error. | [optional] [readonly] +**info_flags** | **List[str]** | | [optional] [readonly] + +## Example + +```python +from test_results_api.models.network_ping import NetworkPing + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkPing from a JSON string +network_ping_instance = NetworkPing.from_json(json) +# print the JSON string representation of the object +print NetworkPing.to_json() + +# convert the object into a dict +network_ping_dict = network_ping_instance.to_dict() +# create an instance of NetworkPing from a dict +network_ping_form_dict = network_ping.from_dict(network_ping_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/NetworkProfile.md b/endpoint/test_results_api/docs/NetworkProfile.md new file mode 100644 index 00000000..03599b1e --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkProfile.md @@ -0,0 +1,41 @@ +# NetworkProfile + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_address** | **str** | Network IP address. | [optional] [readonly] +**subnet_mask** | **str** | Network subnet mask. | [optional] [readonly] +**public_ip_address** | **str** | Network public IP address. | [optional] [readonly] +**local_prefix** | **str** | Network local prefix. | [optional] [readonly] +**public_ip_range** | **str** | Network public IP range. | [optional] [readonly] +**dns_servers** | **List[str]** | Network DNS servers. | [optional] [readonly] +**hardware_type** | [**InterfaceHardwareType**](InterfaceHardwareType.md) | | [optional] +**interface_name** | **str** | Network interface name. | [optional] [readonly] +**error** | **str** | Only present when there is an error | [optional] [readonly] +**gateway** | **str** | Network gateway address. | [optional] [readonly] +**wireless_profile** | [**NetworkWirelessProfile**](NetworkWirelessProfile.md) | | [optional] +**proxy_profile** | [**NetworkProxyProfile**](NetworkProxyProfile.md) | | [optional] +**ethernet_profile** | [**EthernetProfile**](EthernetProfile.md) | | [optional] +**previous_interface** | [**NetworkInterface**](NetworkInterface.md) | | [optional] + +## Example + +```python +from test_results_api.models.network_profile import NetworkProfile + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkProfile from a JSON string +network_profile_instance = NetworkProfile.from_json(json) +# print the JSON string representation of the object +print NetworkProfile.to_json() + +# convert the object into a dict +network_profile_dict = network_profile_instance.to_dict() +# create an instance of NetworkProfile from a dict +network_profile_form_dict = network_profile.from_dict(network_profile_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/NetworkProxyProfile.md b/endpoint/test_results_api/docs/NetworkProxyProfile.md new file mode 100644 index 00000000..28a11a06 --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkProxyProfile.md @@ -0,0 +1,29 @@ +# NetworkProxyProfile + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**method** | **str** | Proxy profile method. | [optional] [readonly] +**proxies** | [**List[NetworkProxyProfileProxiesInner]**](NetworkProxyProfileProxiesInner.md) | | [optional] + +## Example + +```python +from test_results_api.models.network_proxy_profile import NetworkProxyProfile + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkProxyProfile from a JSON string +network_proxy_profile_instance = NetworkProxyProfile.from_json(json) +# print the JSON string representation of the object +print NetworkProxyProfile.to_json() + +# convert the object into a dict +network_proxy_profile_dict = network_proxy_profile_instance.to_dict() +# create an instance of NetworkProxyProfile from a dict +network_proxy_profile_form_dict = network_proxy_profile.from_dict(network_proxy_profile_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/NetworkProxyProfileProxiesInner.md b/endpoint/test_results_api/docs/NetworkProxyProfileProxiesInner.md new file mode 100644 index 00000000..e02d6f5c --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkProxyProfileProxiesInner.md @@ -0,0 +1,29 @@ +# NetworkProxyProfileProxiesInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bypass** | **str** | Proxy bypass expression. | [optional] [readonly] +**proxy** | **str** | Proxy mode. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.network_proxy_profile_proxies_inner import NetworkProxyProfileProxiesInner + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkProxyProfileProxiesInner from a JSON string +network_proxy_profile_proxies_inner_instance = NetworkProxyProfileProxiesInner.from_json(json) +# print the JSON string representation of the object +print NetworkProxyProfileProxiesInner.to_json() + +# convert the object into a dict +network_proxy_profile_proxies_inner_dict = network_proxy_profile_proxies_inner_instance.to_dict() +# create an instance of NetworkProxyProfileProxiesInner from a dict +network_proxy_profile_proxies_inner_form_dict = network_proxy_profile_proxies_inner.from_dict(network_proxy_profile_proxies_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/NetworkScheduledTestsResultsApi.md b/endpoint/test_results_api/docs/NetworkScheduledTestsResultsApi.md new file mode 100644 index 00000000..465e89da --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkScheduledTestsResultsApi.md @@ -0,0 +1,386 @@ +# test_results_api.NetworkScheduledTestsResultsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_result_network_pathvis**](NetworkScheduledTestsResultsApi.md#get_test_result_network_pathvis) | **GET** /v7/endpoint/test-results/scheduled-tests/{testId}/pathvis | Retrieve pathvis network scheduled test results +[**get_test_result_pathvis_agent_round**](NetworkScheduledTestsResultsApi.md#get_test_result_pathvis_agent_round) | **GET** /v7/endpoint/test-results/scheduled-tests/{testId}/pathvis/agent/{agentId}/round/{roundId} | Retrieve pathvis network scheduled test results details +[**post_fetch_test_result_metrics**](NetworkScheduledTestsResultsApi.md#post_fetch_test_result_metrics) | **POST** /v7/endpoint/test-results/scheduled-tests/{testId}/network/filter | Retrieve network scheduled test results +[**post_fetch_test_result_metrics_multi_test**](NetworkScheduledTestsResultsApi.md#post_fetch_test_result_metrics_multi_test) | **POST** /v7/endpoint/test-results/scheduled-tests/network/filter | Retrieve network scheduled test results from multiple tests + + +# **get_test_result_network_pathvis** +> GetTestResultNetworkPathvis200Response get_test_result_network_pathvis(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Retrieve pathvis network scheduled test results + +Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours is returned. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_network_pathvis200_response import GetTestResultNetworkPathvis200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.NetworkScheduledTestsResultsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # Retrieve pathvis network scheduled test results + api_response = api_instance.get_test_result_network_pathvis(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of NetworkScheduledTestsResultsApi->get_test_result_network_pathvis:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkScheduledTestsResultsApi->get_test_result_network_pathvis: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**GetTestResultNetworkPathvis200Response**](GetTestResultNetworkPathvis200Response.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 | - | + +[[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_test_result_pathvis_agent_round** +> GetTestResultPathvisAgentRound200Response get_test_result_pathvis_agent_round(test_id, agent_id, round_id, aid=aid) + +Retrieve pathvis network scheduled test results details + +Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_pathvis_agent_round200_response import GetTestResultPathvisAgentRound200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.NetworkScheduledTestsResultsApi(api_client) + test_id = '202701' # str | Test ID + agent_id = '11' # str | Agent ID + round_id = '1384309800' # str | Round ID + 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 pathvis network scheduled test results details + api_response = api_instance.get_test_result_pathvis_agent_round(test_id, agent_id, round_id, aid=aid) + print("The response of NetworkScheduledTestsResultsApi->get_test_result_pathvis_agent_round:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkScheduledTestsResultsApi->get_test_result_pathvis_agent_round: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_id** | **str**| Agent ID | + **round_id** | **str**| Round ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetTestResultPathvisAgentRound200Response**](GetTestResultPathvisAgentRound200Response.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 | - | + +[[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) + +# **post_fetch_test_result_metrics** +> PostFetchTestResultMetrics200Response post_fetch_test_result_metrics(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, tests_data_rounds_search=tests_data_rounds_search) + +Retrieve network scheduled test results + +Returns network metrics (loss, latency, and jitter) from each endpoint agent, for each roundId within the specified time window, as determined by search filters. If a time frame is provided, the rounds relevant to that time frame are returned, and the order is not predefined unless the user specifies a sort order in the filter. When no time frame is provided, the latest rounds are returned. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.post_fetch_test_result_metrics200_response import PostFetchTestResultMetrics200Response +from test_results_api.models.tests_data_rounds_search import TestsDataRoundsSearch +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.NetworkScheduledTestsResultsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + tests_data_rounds_search = test_results_api.TestsDataRoundsSearch() # TestsDataRoundsSearch | Tests data search filters. (optional) + + try: + # Retrieve network scheduled test results + api_response = api_instance.post_fetch_test_result_metrics(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, tests_data_rounds_search=tests_data_rounds_search) + print("The response of NetworkScheduledTestsResultsApi->post_fetch_test_result_metrics:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkScheduledTestsResultsApi->post_fetch_test_result_metrics: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **tests_data_rounds_search** | [**TestsDataRoundsSearch**](TestsDataRoundsSearch.md)| Tests data search filters. | [optional] + +### Return type + +[**PostFetchTestResultMetrics200Response**](PostFetchTestResultMetrics200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **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 | - | + +[[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) + +# **post_fetch_test_result_metrics_multi_test** +> PostFetchTestResultMetricsMultiTest200Response post_fetch_test_result_metrics_multi_test(aid=aid, window=window, start_date=start_date, end_date=end_date, max=max, cursor=cursor, multi_test_id_tests_data_rounds_search=multi_test_id_tests_data_rounds_search) + +Retrieve network scheduled test results from multiple tests + +Returns network metrics, including loss, latency, and jitter, for multiple test IDs obtained from each endpoint agent. It allows you to specify a time window using search filters to retrieve metrics for specific round IDs within that time frame. The default order of results is unspecified unless you include a sorting preference in the filter. When no time frame is provided, the API returns metrics for the most recent rounds. Access to all accounts associated with the specified test IDs is required to use this endpoint. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.multi_test_id_tests_data_rounds_search import MultiTestIdTestsDataRoundsSearch +from test_results_api.models.post_fetch_test_result_metrics_multi_test200_response import PostFetchTestResultMetricsMultiTest200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.NetworkScheduledTestsResultsApi(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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + max = 5 # float | (Optional) Maximum number of objects to return. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + multi_test_id_tests_data_rounds_search = test_results_api.MultiTestIdTestsDataRoundsSearch() # MultiTestIdTestsDataRoundsSearch | Test data search filters. (optional) + + try: + # Retrieve network scheduled test results from multiple tests + api_response = api_instance.post_fetch_test_result_metrics_multi_test(aid=aid, window=window, start_date=start_date, end_date=end_date, max=max, cursor=cursor, multi_test_id_tests_data_rounds_search=multi_test_id_tests_data_rounds_search) + print("The response of NetworkScheduledTestsResultsApi->post_fetch_test_result_metrics_multi_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkScheduledTestsResultsApi->post_fetch_test_result_metrics_multi_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **max** | **float**| (Optional) Maximum number of objects to return. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **multi_test_id_tests_data_rounds_search** | [**MultiTestIdTestsDataRoundsSearch**](MultiTestIdTestsDataRoundsSearch.md)| Test data search filters. | [optional] + +### Return type + +[**PostFetchTestResultMetricsMultiTest200Response**](PostFetchTestResultMetricsMultiTest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/test_results_api/docs/NetworkTestResult.md b/endpoint/test_results_api/docs/NetworkTestResult.md new file mode 100644 index 00000000..8e061ffa --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkTestResult.md @@ -0,0 +1,41 @@ +# NetworkTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**aid** | [**AccountGroupId**](AccountGroupId.md) | | [optional] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**avg_latency** | **float** | Average RTT for packets sent to destination. | [optional] [readonly] +**error_details** | **str** | Error details, if an error was encountered. | [optional] [readonly] +**jitter** | **float** | Standard deviation of latency. | [optional] [readonly] +**is_icmp_blocked** | **bool** | Set to `true` if network target is blocking ICMP echo (ping) queries. | [optional] [readonly] +**loss** | **float** | Percentage of packets not reaching destination. | [optional] [readonly] +**max_latency** | **float** | Maximum RTT for packets sent to destination. | [optional] [readonly] +**min_latency** | **float** | Minimum RTT for packets sent to destination. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.network_test_result import NetworkTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkTestResult from a JSON string +network_test_result_instance = NetworkTestResult.from_json(json) +# print the JSON string representation of the object +print NetworkTestResult.to_json() + +# convert the object into a dict +network_test_result_dict = network_test_result_instance.to_dict() +# create an instance of NetworkTestResult from a dict +network_test_result_form_dict = network_test_result.from_dict(network_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/NetworkTestResults.md b/endpoint/test_results_api/docs/NetworkTestResults.md new file mode 100644 index 00000000..a2cfbf0d --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkTestResults.md @@ -0,0 +1,29 @@ +# NetworkTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[NetworkTestResult]**](NetworkTestResult.md) | | [optional] +**test** | [**EndpointScheduledTest**](EndpointScheduledTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.network_test_results import NetworkTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkTestResults from a JSON string +network_test_results_instance = NetworkTestResults.from_json(json) +# print the JSON string representation of the object +print NetworkTestResults.to_json() + +# convert the object into a dict +network_test_results_dict = network_test_results_instance.to_dict() +# create an instance of NetworkTestResults from a dict +network_test_results_form_dict = network_test_results.from_dict(network_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/NetworkTopologyType.md b/endpoint/test_results_api/docs/NetworkTopologyType.md new file mode 100644 index 00000000..66a4cc25 --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkTopologyType.md @@ -0,0 +1,10 @@ +# NetworkTopologyType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/NetworkWirelessProfile.md b/endpoint/test_results_api/docs/NetworkWirelessProfile.md new file mode 100644 index 00000000..7a0bf330 --- /dev/null +++ b/endpoint/test_results_api/docs/NetworkWirelessProfile.md @@ -0,0 +1,36 @@ +# NetworkWirelessProfile + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ssid** | **str** | Wireless network SSID. | [optional] [readonly] +**bssid** | **str** | Wireless network BSSID. | [optional] [readonly] +**channel** | **int** | Wireless network channel. | [optional] [readonly] +**phy_mode** | **str** | Wireless network PHY mode. | [optional] [readonly] +**rssi** | **int** | Wireless network RSSI. | [optional] [readonly] +**noise** | **int** | Wireless network noise. | [optional] [readonly] +**quality** | **int** | Wireless network quality. | [optional] [readonly] +**tx_rate** | **int** | Wireless network transmitted rate. | [optional] [readonly] +**vendor** | **str** | Wireless network device vendor. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.network_wireless_profile import NetworkWirelessProfile + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkWirelessProfile from a JSON string +network_wireless_profile_instance = NetworkWirelessProfile.from_json(json) +# print the JSON string representation of the object +print NetworkWirelessProfile.to_json() + +# convert the object into a dict +network_wireless_profile_dict = network_wireless_profile_instance.to_dict() +# create an instance of NetworkWirelessProfile from a dict +network_wireless_profile_form_dict = network_wireless_profile.from_dict(network_wireless_profile_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PaginationNextLink.md b/endpoint/test_results_api/docs/PaginationNextLink.md new file mode 100644 index 00000000..6560512c --- /dev/null +++ b/endpoint/test_results_api/docs/PaginationNextLink.md @@ -0,0 +1,29 @@ +# PaginationNextLink + +A links object containing a related link for forward pagination. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**PaginationNextLinkLinks**](PaginationNextLinkLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.pagination_next_link import PaginationNextLink + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationNextLink from a JSON string +pagination_next_link_instance = PaginationNextLink.from_json(json) +# print the JSON string representation of the object +print PaginationNextLink.to_json() + +# convert the object into a dict +pagination_next_link_dict = pagination_next_link_instance.to_dict() +# create an instance of PaginationNextLink from a dict +pagination_next_link_form_dict = pagination_next_link.from_dict(pagination_next_link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PaginationNextLinkLinks.md b/endpoint/test_results_api/docs/PaginationNextLinkLinks.md new file mode 100644 index 00000000..30aa9e37 --- /dev/null +++ b/endpoint/test_results_api/docs/PaginationNextLinkLinks.md @@ -0,0 +1,28 @@ +# PaginationNextLinkLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from test_results_api.models.pagination_next_link_links import PaginationNextLinkLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationNextLinkLinks from a JSON string +pagination_next_link_links_instance = PaginationNextLinkLinks.from_json(json) +# print the JSON string representation of the object +print PaginationNextLinkLinks.to_json() + +# convert the object into a dict +pagination_next_link_links_dict = pagination_next_link_links_instance.to_dict() +# create an instance of PaginationNextLinkLinks from a dict +pagination_next_link_links_form_dict = pagination_next_link_links.from_dict(pagination_next_link_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PathVisBaseTestResult.md b/endpoint/test_results_api/docs/PathVisBaseTestResult.md new file mode 100644 index 00000000..115b970c --- /dev/null +++ b/endpoint/test_results_api/docs/PathVisBaseTestResult.md @@ -0,0 +1,37 @@ +# PathVisBaseTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**aid** | [**AccountGroupId**](AccountGroupId.md) | | [optional] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**asn_details** | [**AsnDetails**](AsnDetails.md) | | [optional] +**server** | **str** | Target server, including port. | [optional] [readonly] +**source_ip** | **str** | IP address of source endpoint agent. | [optional] [readonly] +**source_prefix** | **str** | IP prefix of source endpoint agent. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.path_vis_base_test_result import PathVisBaseTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisBaseTestResult from a JSON string +path_vis_base_test_result_instance = PathVisBaseTestResult.from_json(json) +# print the JSON string representation of the object +print PathVisBaseTestResult.to_json() + +# convert the object into a dict +path_vis_base_test_result_dict = path_vis_base_test_result_instance.to_dict() +# create an instance of PathVisBaseTestResult from a dict +path_vis_base_test_result_form_dict = path_vis_base_test_result.from_dict(path_vis_base_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PathVisDetailDynamicTestResult.md b/endpoint/test_results_api/docs/PathVisDetailDynamicTestResult.md new file mode 100644 index 00000000..b64a17c4 --- /dev/null +++ b/endpoint/test_results_api/docs/PathVisDetailDynamicTestResult.md @@ -0,0 +1,41 @@ +# PathVisDetailDynamicTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**aid** | [**AccountGroupId**](AccountGroupId.md) | | [optional] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**asn_details** | [**AsnDetails**](AsnDetails.md) | | [optional] +**server** | **str** | Target server, including port. | [optional] [readonly] +**source_ip** | **str** | IP address of source endpoint agent. | [optional] [readonly] +**source_prefix** | **str** | IP prefix of source endpoint agent. | [optional] [readonly] +**routes** | [**List[PathVisRoute]**](PathVisRoute.md) | Shows iterations of path trace, with each iteration specified by a pathId. | [optional] +**vpn_routes** | [**List[PathVisRoute]**](PathVisRoute.md) | Shows iterations of the VPN path trace, with each iteration specified by a pathId. | [optional] +**application** | [**DynamicTestApplication**](DynamicTestApplication.md) | | [optional] +**webex** | [**DynamicBaseTestResultWebex**](DynamicBaseTestResultWebex.md) | | [optional] + +## Example + +```python +from test_results_api.models.path_vis_detail_dynamic_test_result import PathVisDetailDynamicTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDetailDynamicTestResult from a JSON string +path_vis_detail_dynamic_test_result_instance = PathVisDetailDynamicTestResult.from_json(json) +# print the JSON string representation of the object +print PathVisDetailDynamicTestResult.to_json() + +# convert the object into a dict +path_vis_detail_dynamic_test_result_dict = path_vis_detail_dynamic_test_result_instance.to_dict() +# create an instance of PathVisDetailDynamicTestResult from a dict +path_vis_detail_dynamic_test_result_form_dict = path_vis_detail_dynamic_test_result.from_dict(path_vis_detail_dynamic_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PathVisDetailDynamicTestResults.md b/endpoint/test_results_api/docs/PathVisDetailDynamicTestResults.md new file mode 100644 index 00000000..7a45bcd1 --- /dev/null +++ b/endpoint/test_results_api/docs/PathVisDetailDynamicTestResults.md @@ -0,0 +1,29 @@ +# PathVisDetailDynamicTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisDetailDynamicTestResult]**](PathVisDetailDynamicTestResult.md) | | [optional] +**test** | [**DynamicTest**](DynamicTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.path_vis_detail_dynamic_test_results import PathVisDetailDynamicTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDetailDynamicTestResults from a JSON string +path_vis_detail_dynamic_test_results_instance = PathVisDetailDynamicTestResults.from_json(json) +# print the JSON string representation of the object +print PathVisDetailDynamicTestResults.to_json() + +# convert the object into a dict +path_vis_detail_dynamic_test_results_dict = path_vis_detail_dynamic_test_results_instance.to_dict() +# create an instance of PathVisDetailDynamicTestResults from a dict +path_vis_detail_dynamic_test_results_form_dict = path_vis_detail_dynamic_test_results.from_dict(path_vis_detail_dynamic_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PathVisDetailTestResult.md b/endpoint/test_results_api/docs/PathVisDetailTestResult.md new file mode 100644 index 00000000..a2b44ff4 --- /dev/null +++ b/endpoint/test_results_api/docs/PathVisDetailTestResult.md @@ -0,0 +1,39 @@ +# PathVisDetailTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**aid** | [**AccountGroupId**](AccountGroupId.md) | | [optional] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**asn_details** | [**AsnDetails**](AsnDetails.md) | | [optional] +**server** | **str** | Target server, including port. | [optional] [readonly] +**source_ip** | **str** | IP address of source endpoint agent. | [optional] [readonly] +**source_prefix** | **str** | IP prefix of source endpoint agent. | [optional] [readonly] +**routes** | [**List[PathVisRoute]**](PathVisRoute.md) | Shows iterations of path trace, with each iteration specified by a pathId. | [optional] +**vpn_routes** | [**List[PathVisRoute]**](PathVisRoute.md) | Shows iterations of the VPN path trace, with each iteration specified by a pathId. | [optional] + +## Example + +```python +from test_results_api.models.path_vis_detail_test_result import PathVisDetailTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDetailTestResult from a JSON string +path_vis_detail_test_result_instance = PathVisDetailTestResult.from_json(json) +# print the JSON string representation of the object +print PathVisDetailTestResult.to_json() + +# convert the object into a dict +path_vis_detail_test_result_dict = path_vis_detail_test_result_instance.to_dict() +# create an instance of PathVisDetailTestResult from a dict +path_vis_detail_test_result_form_dict = path_vis_detail_test_result.from_dict(path_vis_detail_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PathVisDetailTestResults.md b/endpoint/test_results_api/docs/PathVisDetailTestResults.md new file mode 100644 index 00000000..247c7598 --- /dev/null +++ b/endpoint/test_results_api/docs/PathVisDetailTestResults.md @@ -0,0 +1,29 @@ +# PathVisDetailTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisDetailTestResult]**](PathVisDetailTestResult.md) | | [optional] +**test** | [**EndpointScheduledTest**](EndpointScheduledTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.path_vis_detail_test_results import PathVisDetailTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDetailTestResults from a JSON string +path_vis_detail_test_results_instance = PathVisDetailTestResults.from_json(json) +# print the JSON string representation of the object +print PathVisDetailTestResults.to_json() + +# convert the object into a dict +path_vis_detail_test_results_dict = path_vis_detail_test_results_instance.to_dict() +# create an instance of PathVisDetailTestResults from a dict +path_vis_detail_test_results_form_dict = path_vis_detail_test_results.from_dict(path_vis_detail_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PathVisDynamicTestResult.md b/endpoint/test_results_api/docs/PathVisDynamicTestResult.md new file mode 100644 index 00000000..bd89a8ba --- /dev/null +++ b/endpoint/test_results_api/docs/PathVisDynamicTestResult.md @@ -0,0 +1,41 @@ +# PathVisDynamicTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**aid** | [**AccountGroupId**](AccountGroupId.md) | | [optional] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**asn_details** | [**AsnDetails**](AsnDetails.md) | | [optional] +**server** | **str** | Target server, including port. | [optional] [readonly] +**source_ip** | **str** | IP address of source endpoint agent. | [optional] [readonly] +**source_prefix** | **str** | IP prefix of source endpoint agent. | [optional] [readonly] +**application** | [**DynamicTestApplication**](DynamicTestApplication.md) | | [optional] +**webex** | [**DynamicBaseTestResultWebex**](DynamicBaseTestResultWebex.md) | | [optional] +**location** | **str** | Geographic location of the pathvis. | [optional] [readonly] +**endpoints** | [**List[PathVisEndpoint]**](PathVisEndpoint.md) | Shows an iteration of path trace, with each iteration specified by a pathId. | [optional] + +## Example + +```python +from test_results_api.models.path_vis_dynamic_test_result import PathVisDynamicTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDynamicTestResult from a JSON string +path_vis_dynamic_test_result_instance = PathVisDynamicTestResult.from_json(json) +# print the JSON string representation of the object +print PathVisDynamicTestResult.to_json() + +# convert the object into a dict +path_vis_dynamic_test_result_dict = path_vis_dynamic_test_result_instance.to_dict() +# create an instance of PathVisDynamicTestResult from a dict +path_vis_dynamic_test_result_form_dict = path_vis_dynamic_test_result.from_dict(path_vis_dynamic_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PathVisDynamicTestResults.md b/endpoint/test_results_api/docs/PathVisDynamicTestResults.md new file mode 100644 index 00000000..e9069941 --- /dev/null +++ b/endpoint/test_results_api/docs/PathVisDynamicTestResults.md @@ -0,0 +1,29 @@ +# PathVisDynamicTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisDynamicTestResult]**](PathVisDynamicTestResult.md) | | [optional] +**test** | [**DynamicTest**](DynamicTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.path_vis_dynamic_test_results import PathVisDynamicTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDynamicTestResults from a JSON string +path_vis_dynamic_test_results_instance = PathVisDynamicTestResults.from_json(json) +# print the JSON string representation of the object +print PathVisDynamicTestResults.to_json() + +# convert the object into a dict +path_vis_dynamic_test_results_dict = path_vis_dynamic_test_results_instance.to_dict() +# create an instance of PathVisDynamicTestResults from a dict +path_vis_dynamic_test_results_form_dict = path_vis_dynamic_test_results.from_dict(path_vis_dynamic_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PathVisEndpoint.md b/endpoint/test_results_api/docs/PathVisEndpoint.md new file mode 100644 index 00000000..c54cfdc2 --- /dev/null +++ b/endpoint/test_results_api/docs/PathVisEndpoint.md @@ -0,0 +1,31 @@ +# PathVisEndpoint + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_address** | **str** | IP address of the hop destination. | [optional] [readonly] +**number_of_hops** | **int** | Number of hops for path trace to destination. | [optional] [readonly] +**path_id** | **str** | Unique ID of path trace. | [optional] [readonly] +**response_time** | **int** | RTT of the path trace to the destination in milliseconds. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.path_vis_endpoint import PathVisEndpoint + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisEndpoint from a JSON string +path_vis_endpoint_instance = PathVisEndpoint.from_json(json) +# print the JSON string representation of the object +print PathVisEndpoint.to_json() + +# convert the object into a dict +path_vis_endpoint_dict = path_vis_endpoint_instance.to_dict() +# create an instance of PathVisEndpoint from a dict +path_vis_endpoint_form_dict = path_vis_endpoint.from_dict(path_vis_endpoint_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PathVisHop.md b/endpoint/test_results_api/docs/PathVisHop.md new file mode 100644 index 00000000..6e97a415 --- /dev/null +++ b/endpoint/test_results_api/docs/PathVisHop.md @@ -0,0 +1,34 @@ +# PathVisHop + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hop** | **int** | The hop index. | [optional] [readonly] +**ip_address** | **str** | IP address of the hop. | [optional] [readonly] +**prefix** | **str** | Prefix of IP address shown in CIDR. | [optional] [readonly] +**rdns** | **str** | Reverse DNS entry of IP, if available. | [optional] [readonly] +**network** | **str** | Autonomous System originating the prefix. | [optional] [readonly] +**response_time** | **int** | RTT to the hop’s IP in milliseconds. | [optional] [readonly] +**location** | **str** | Location information for the hop. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.path_vis_hop import PathVisHop + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisHop from a JSON string +path_vis_hop_instance = PathVisHop.from_json(json) +# print the JSON string representation of the object +print PathVisHop.to_json() + +# convert the object into a dict +path_vis_hop_dict = path_vis_hop_instance.to_dict() +# create an instance of PathVisHop from a dict +path_vis_hop_form_dict = path_vis_hop.from_dict(path_vis_hop_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PathVisRoute.md b/endpoint/test_results_api/docs/PathVisRoute.md new file mode 100644 index 00000000..9ba2cdfc --- /dev/null +++ b/endpoint/test_results_api/docs/PathVisRoute.md @@ -0,0 +1,29 @@ +# PathVisRoute + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**path_id** | **str** | Unique ID of path trace. | [optional] [readonly] +**hops** | [**List[PathVisHop]**](PathVisHop.md) | Array of hop objects indicating each step in the traceroute. | [optional] + +## Example + +```python +from test_results_api.models.path_vis_route import PathVisRoute + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisRoute from a JSON string +path_vis_route_instance = PathVisRoute.from_json(json) +# print the JSON string representation of the object +print PathVisRoute.to_json() + +# convert the object into a dict +path_vis_route_dict = path_vis_route_instance.to_dict() +# create an instance of PathVisRoute from a dict +path_vis_route_form_dict = path_vis_route.from_dict(path_vis_route_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PathVisTestResult.md b/endpoint/test_results_api/docs/PathVisTestResult.md new file mode 100644 index 00000000..6eee08b9 --- /dev/null +++ b/endpoint/test_results_api/docs/PathVisTestResult.md @@ -0,0 +1,39 @@ +# PathVisTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**aid** | [**AccountGroupId**](AccountGroupId.md) | | [optional] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**asn_details** | [**AsnDetails**](AsnDetails.md) | | [optional] +**server** | **str** | Target server, including port. | [optional] [readonly] +**source_ip** | **str** | IP address of source endpoint agent. | [optional] [readonly] +**source_prefix** | **str** | IP prefix of source endpoint agent. | [optional] [readonly] +**location** | **str** | Geographic location of the pathvis. | [optional] [readonly] +**endpoints** | [**List[PathVisEndpoint]**](PathVisEndpoint.md) | Shows an iteration of path trace, with each iteration specified by a pathId. | [optional] + +## Example + +```python +from test_results_api.models.path_vis_test_result import PathVisTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisTestResult from a JSON string +path_vis_test_result_instance = PathVisTestResult.from_json(json) +# print the JSON string representation of the object +print PathVisTestResult.to_json() + +# convert the object into a dict +path_vis_test_result_dict = path_vis_test_result_instance.to_dict() +# create an instance of PathVisTestResult from a dict +path_vis_test_result_form_dict = path_vis_test_result.from_dict(path_vis_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PathVisTestResults.md b/endpoint/test_results_api/docs/PathVisTestResults.md new file mode 100644 index 00000000..395d221c --- /dev/null +++ b/endpoint/test_results_api/docs/PathVisTestResults.md @@ -0,0 +1,29 @@ +# PathVisTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisTestResult]**](PathVisTestResult.md) | | [optional] +**test** | [**EndpointScheduledTest**](EndpointScheduledTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.path_vis_test_results import PathVisTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisTestResults from a JSON string +path_vis_test_results_instance = PathVisTestResults.from_json(json) +# print the JSON string representation of the object +print PathVisTestResults.to_json() + +# convert the object into a dict +path_vis_test_results_dict = path_vis_test_results_instance.to_dict() +# create an instance of PathVisTestResults from a dict +path_vis_test_results_form_dict = path_vis_test_results.from_dict(path_vis_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PhysicalMemoryUsedBytes.md b/endpoint/test_results_api/docs/PhysicalMemoryUsedBytes.md new file mode 100644 index 00000000..2e66a806 --- /dev/null +++ b/endpoint/test_results_api/docs/PhysicalMemoryUsedBytes.md @@ -0,0 +1,33 @@ +# PhysicalMemoryUsedBytes + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**min** | **float** | The minimum sampled memory usage value recorded during the monitored period. | [optional] [readonly] +**max** | **float** | The maximum sampled memory usage value recorded during the monitored period. | [optional] [readonly] +**mean** | **float** | The mean (average) value of memory usage sampled over the monitored period. | [optional] [readonly] +**median** | **float** | The median value of memory usage sampled over the monitored period. | [optional] [readonly] +**std_dev** | **float** | The standard deviation of memory usage sampled during the monitored period. | [optional] [readonly] +**count** | **float** | The total number of samples collected during the monitored period.. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.physical_memory_used_bytes import PhysicalMemoryUsedBytes + +# TODO update the JSON string below +json = "{}" +# create an instance of PhysicalMemoryUsedBytes from a JSON string +physical_memory_used_bytes_instance = PhysicalMemoryUsedBytes.from_json(json) +# print the JSON string representation of the object +print PhysicalMemoryUsedBytes.to_json() + +# convert the object into a dict +physical_memory_used_bytes_dict = physical_memory_used_bytes_instance.to_dict() +# create an instance of PhysicalMemoryUsedBytes from a dict +physical_memory_used_bytes_form_dict = physical_memory_used_bytes.from_dict(physical_memory_used_bytes_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/Platform.md b/endpoint/test_results_api/docs/Platform.md new file mode 100644 index 00000000..0fda6780 --- /dev/null +++ b/endpoint/test_results_api/docs/Platform.md @@ -0,0 +1,11 @@ +# Platform + +OS platform types + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PostFetchDynamicTestResultMetrics200Response.md b/endpoint/test_results_api/docs/PostFetchDynamicTestResultMetrics200Response.md new file mode 100644 index 00000000..8caa4c6d --- /dev/null +++ b/endpoint/test_results_api/docs/PostFetchDynamicTestResultMetrics200Response.md @@ -0,0 +1,32 @@ +# PostFetchDynamicTestResultMetrics200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[NetworkDynamicTestResult]**](NetworkDynamicTestResult.md) | | [optional] +**test** | [**DynamicTest**](DynamicTest.md) | | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**PaginationNextLinkLinks**](PaginationNextLinkLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.post_fetch_dynamic_test_result_metrics200_response import PostFetchDynamicTestResultMetrics200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of PostFetchDynamicTestResultMetrics200Response from a JSON string +post_fetch_dynamic_test_result_metrics200_response_instance = PostFetchDynamicTestResultMetrics200Response.from_json(json) +# print the JSON string representation of the object +print PostFetchDynamicTestResultMetrics200Response.to_json() + +# convert the object into a dict +post_fetch_dynamic_test_result_metrics200_response_dict = post_fetch_dynamic_test_result_metrics200_response_instance.to_dict() +# create an instance of PostFetchDynamicTestResultMetrics200Response from a dict +post_fetch_dynamic_test_result_metrics200_response_form_dict = post_fetch_dynamic_test_result_metrics200_response.from_dict(post_fetch_dynamic_test_result_metrics200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PostFetchTestResultMetrics200Response.md b/endpoint/test_results_api/docs/PostFetchTestResultMetrics200Response.md new file mode 100644 index 00000000..70c7584b --- /dev/null +++ b/endpoint/test_results_api/docs/PostFetchTestResultMetrics200Response.md @@ -0,0 +1,32 @@ +# PostFetchTestResultMetrics200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[NetworkTestResult]**](NetworkTestResult.md) | | [optional] +**test** | [**EndpointScheduledTest**](EndpointScheduledTest.md) | | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**PaginationNextLinkLinks**](PaginationNextLinkLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.post_fetch_test_result_metrics200_response import PostFetchTestResultMetrics200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of PostFetchTestResultMetrics200Response from a JSON string +post_fetch_test_result_metrics200_response_instance = PostFetchTestResultMetrics200Response.from_json(json) +# print the JSON string representation of the object +print PostFetchTestResultMetrics200Response.to_json() + +# convert the object into a dict +post_fetch_test_result_metrics200_response_dict = post_fetch_test_result_metrics200_response_instance.to_dict() +# create an instance of PostFetchTestResultMetrics200Response from a dict +post_fetch_test_result_metrics200_response_form_dict = post_fetch_test_result_metrics200_response.from_dict(post_fetch_test_result_metrics200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/PostFetchTestResultMetricsMultiTest200Response.md b/endpoint/test_results_api/docs/PostFetchTestResultMetricsMultiTest200Response.md new file mode 100644 index 00000000..9f42a1db --- /dev/null +++ b/endpoint/test_results_api/docs/PostFetchTestResultMetricsMultiTest200Response.md @@ -0,0 +1,31 @@ +# PostFetchTestResultMetricsMultiTest200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[NetworkTestResult]**](NetworkTestResult.md) | | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**PaginationNextLinkLinks**](PaginationNextLinkLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.post_fetch_test_result_metrics_multi_test200_response import PostFetchTestResultMetricsMultiTest200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of PostFetchTestResultMetricsMultiTest200Response from a JSON string +post_fetch_test_result_metrics_multi_test200_response_instance = PostFetchTestResultMetricsMultiTest200Response.from_json(json) +# print the JSON string representation of the object +print PostFetchTestResultMetricsMultiTest200Response.to_json() + +# convert the object into a dict +post_fetch_test_result_metrics_multi_test200_response_dict = post_fetch_test_result_metrics_multi_test200_response_instance.to_dict() +# create an instance of PostFetchTestResultMetricsMultiTest200Response from a dict +post_fetch_test_result_metrics_multi_test200_response_form_dict = post_fetch_test_result_metrics_multi_test200_response.from_dict(post_fetch_test_result_metrics_multi_test200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/QueryWindow.md b/endpoint/test_results_api/docs/QueryWindow.md new file mode 100644 index 00000000..82dc47d1 --- /dev/null +++ b/endpoint/test_results_api/docs/QueryWindow.md @@ -0,0 +1,29 @@ +# QueryWindow + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] + +## Example + +```python +from test_results_api.models.query_window import QueryWindow + +# TODO update the JSON string below +json = "{}" +# create an instance of QueryWindow from a JSON string +query_window_instance = QueryWindow.from_json(json) +# print the JSON string representation of the object +print QueryWindow.to_json() + +# convert the object into a dict +query_window_dict = query_window_instance.to_dict() +# create an instance of QueryWindow from a dict +query_window_form_dict = query_window.from_dict(query_window_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestCoordinates.md b/endpoint/test_results_api/docs/RealUserTestCoordinates.md new file mode 100644 index 00000000..688f5c74 --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestCoordinates.md @@ -0,0 +1,31 @@ +# RealUserTestCoordinates + +Contains approximate GPS location of the endpoint agent, based on endpoint agent’s public IP address. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**latitude** | **float** | Numeric representations of GPS coordinates. | [optional] [readonly] +**location** | **str** | Represents named geographical location. | [optional] [readonly] +**longitude** | **float** | Numeric representations of GPS coordinates. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.real_user_test_coordinates import RealUserTestCoordinates + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserTestCoordinates from a JSON string +real_user_test_coordinates_instance = RealUserTestCoordinates.from_json(json) +# print the JSON string representation of the object +print RealUserTestCoordinates.to_json() + +# convert the object into a dict +real_user_test_coordinates_dict = real_user_test_coordinates_instance.to_dict() +# create an instance of RealUserTestCoordinates from a dict +real_user_test_coordinates_form_dict = real_user_test_coordinates.from_dict(real_user_test_coordinates_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestNetwork.md b/endpoint/test_results_api/docs/RealUserTestNetwork.md new file mode 100644 index 00000000..a4b5e10f --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestNetwork.md @@ -0,0 +1,38 @@ +# RealUserTestNetwork + +Contains details about network profile and conditions during session. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**gateway_ping** | [**RealUserTestNetworkGatewayPing**](RealUserTestNetworkGatewayPing.md) | | [optional] +**ping** | [**RealUserTestNetworkPing**](RealUserTestNetworkPing.md) | | [optional] +**traceroute** | [**RealUserTestNetworkTraceroute**](RealUserTestNetworkTraceroute.md) | | [optional] +**connect_rtt** | **float** | Represents the number of milliseconds required to establish TCP connectivity with the target. | [optional] [readonly] +**is_icmp_blocked** | **bool** | Set to `true` if network target is blocking ICMP echo (ping) queries. | [optional] [readonly] +**errors** | **List[str]** | Array of string representing possible network errors. | [optional] [readonly] +**vpn_ping** | [**RealUserTestNetworkVpnPing**](RealUserTestNetworkVpnPing.md) | | [optional] +**vpn_traceroute** | [**RealUserTestNetworkVpnTraceroute**](RealUserTestNetworkVpnTraceroute.md) | | [optional] + +## Example + +```python +from test_results_api.models.real_user_test_network import RealUserTestNetwork + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserTestNetwork from a JSON string +real_user_test_network_instance = RealUserTestNetwork.from_json(json) +# print the JSON string representation of the object +print RealUserTestNetwork.to_json() + +# convert the object into a dict +real_user_test_network_dict = real_user_test_network_instance.to_dict() +# create an instance of RealUserTestNetwork from a dict +real_user_test_network_form_dict = real_user_test_network.from_dict(real_user_test_network_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestNetworkGatewayPing.md b/endpoint/test_results_api/docs/RealUserTestNetworkGatewayPing.md new file mode 100644 index 00000000..6608030f --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestNetworkGatewayPing.md @@ -0,0 +1,35 @@ +# RealUserTestNetworkGatewayPing + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avg_rtt** | **int** | Ping average response time. | [optional] [readonly] +**max_rtt** | **int** | Ping maximum response time. | [optional] [readonly] +**mean_dev_rtt** | **int** | Ping mean standard deviation response time. | [optional] [readonly] +**min_rtt** | **int** | Ping minimum response time. | [optional] [readonly] +**pkts_received** | **int** | Ping packets received. | [optional] [readonly] +**pkts_sent** | **int** | Ping packets sent. | [optional] [readonly] +**error** | **str** | Only present when there is an error. | [optional] [readonly] +**info_flags** | **List[str]** | | [optional] [readonly] + +## Example + +```python +from test_results_api.models.real_user_test_network_gateway_ping import RealUserTestNetworkGatewayPing + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserTestNetworkGatewayPing from a JSON string +real_user_test_network_gateway_ping_instance = RealUserTestNetworkGatewayPing.from_json(json) +# print the JSON string representation of the object +print RealUserTestNetworkGatewayPing.to_json() + +# convert the object into a dict +real_user_test_network_gateway_ping_dict = real_user_test_network_gateway_ping_instance.to_dict() +# create an instance of RealUserTestNetworkGatewayPing from a dict +real_user_test_network_gateway_ping_form_dict = real_user_test_network_gateway_ping.from_dict(real_user_test_network_gateway_ping_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestNetworkPing.md b/endpoint/test_results_api/docs/RealUserTestNetworkPing.md new file mode 100644 index 00000000..51b679c7 --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestNetworkPing.md @@ -0,0 +1,35 @@ +# RealUserTestNetworkPing + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avg_rtt** | **int** | Ping average response time. | [optional] [readonly] +**max_rtt** | **int** | Ping maximum response time. | [optional] [readonly] +**mean_dev_rtt** | **int** | Ping mean standard deviation response time. | [optional] [readonly] +**min_rtt** | **int** | Ping minimum response time. | [optional] [readonly] +**pkts_received** | **int** | Ping packets received. | [optional] [readonly] +**pkts_sent** | **int** | Ping packets sent. | [optional] [readonly] +**error** | **str** | Only present when there is an error. | [optional] [readonly] +**info_flags** | **List[str]** | | [optional] [readonly] + +## Example + +```python +from test_results_api.models.real_user_test_network_ping import RealUserTestNetworkPing + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserTestNetworkPing from a JSON string +real_user_test_network_ping_instance = RealUserTestNetworkPing.from_json(json) +# print the JSON string representation of the object +print RealUserTestNetworkPing.to_json() + +# convert the object into a dict +real_user_test_network_ping_dict = real_user_test_network_ping_instance.to_dict() +# create an instance of RealUserTestNetworkPing from a dict +real_user_test_network_ping_form_dict = real_user_test_network_ping.from_dict(real_user_test_network_ping_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestNetworkResult.md b/endpoint/test_results_api/docs/RealUserTestNetworkResult.md new file mode 100644 index 00000000..80c47f7a --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestNetworkResult.md @@ -0,0 +1,35 @@ +# RealUserTestNetworkResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**var_date** | **datetime** | UTC date when endpoint real user test took place (ISO date-time format). | [optional] [readonly] +**id** | **str** | Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**destination** | [**NetworkMetrics**](NetworkMetrics.md) | | [optional] +**vpn** | [**NetworkMetrics**](NetworkMetrics.md) | | [optional] +**proxy** | [**NetworkMetrics**](NetworkMetrics.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] + +## Example + +```python +from test_results_api.models.real_user_test_network_result import RealUserTestNetworkResult + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserTestNetworkResult from a JSON string +real_user_test_network_result_instance = RealUserTestNetworkResult.from_json(json) +# print the JSON string representation of the object +print RealUserTestNetworkResult.to_json() + +# convert the object into a dict +real_user_test_network_result_dict = real_user_test_network_result_instance.to_dict() +# create an instance of RealUserTestNetworkResult from a dict +real_user_test_network_result_form_dict = real_user_test_network_result.from_dict(real_user_test_network_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestNetworkResults.md b/endpoint/test_results_api/docs/RealUserTestNetworkResults.md new file mode 100644 index 00000000..0170a249 --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestNetworkResults.md @@ -0,0 +1,28 @@ +# RealUserTestNetworkResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[RealUserTestNetworkResult]**](RealUserTestNetworkResult.md) | | [optional] + +## Example + +```python +from test_results_api.models.real_user_test_network_results import RealUserTestNetworkResults + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserTestNetworkResults from a JSON string +real_user_test_network_results_instance = RealUserTestNetworkResults.from_json(json) +# print the JSON string representation of the object +print RealUserTestNetworkResults.to_json() + +# convert the object into a dict +real_user_test_network_results_dict = real_user_test_network_results_instance.to_dict() +# create an instance of RealUserTestNetworkResults from a dict +real_user_test_network_results_form_dict = real_user_test_network_results.from_dict(real_user_test_network_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestNetworkTraceroute.md b/endpoint/test_results_api/docs/RealUserTestNetworkTraceroute.md new file mode 100644 index 00000000..bbda1112 --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestNetworkTraceroute.md @@ -0,0 +1,32 @@ +# RealUserTestNetworkTraceroute + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**destination** | **str** | The target IP address. | [optional] [readonly] +**error** | **str** | Only present when there is an error | [optional] [readonly] +**info_flags** | **List[str]** | | [optional] [readonly] +**internal_errors** | **List[str]** | | [optional] [readonly] +**hops** | [**List[TracerouteHop]**](TracerouteHop.md) | | [optional] + +## Example + +```python +from test_results_api.models.real_user_test_network_traceroute import RealUserTestNetworkTraceroute + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserTestNetworkTraceroute from a JSON string +real_user_test_network_traceroute_instance = RealUserTestNetworkTraceroute.from_json(json) +# print the JSON string representation of the object +print RealUserTestNetworkTraceroute.to_json() + +# convert the object into a dict +real_user_test_network_traceroute_dict = real_user_test_network_traceroute_instance.to_dict() +# create an instance of RealUserTestNetworkTraceroute from a dict +real_user_test_network_traceroute_form_dict = real_user_test_network_traceroute.from_dict(real_user_test_network_traceroute_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestNetworkVpnPing.md b/endpoint/test_results_api/docs/RealUserTestNetworkVpnPing.md new file mode 100644 index 00000000..89e3e4a2 --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestNetworkVpnPing.md @@ -0,0 +1,35 @@ +# RealUserTestNetworkVpnPing + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avg_rtt** | **int** | Ping average response time. | [optional] [readonly] +**max_rtt** | **int** | Ping maximum response time. | [optional] [readonly] +**mean_dev_rtt** | **int** | Ping mean standard deviation response time. | [optional] [readonly] +**min_rtt** | **int** | Ping minimum response time. | [optional] [readonly] +**pkts_received** | **int** | Ping packets received. | [optional] [readonly] +**pkts_sent** | **int** | Ping packets sent. | [optional] [readonly] +**error** | **str** | Only present when there is an error. | [optional] [readonly] +**info_flags** | **List[str]** | | [optional] [readonly] + +## Example + +```python +from test_results_api.models.real_user_test_network_vpn_ping import RealUserTestNetworkVpnPing + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserTestNetworkVpnPing from a JSON string +real_user_test_network_vpn_ping_instance = RealUserTestNetworkVpnPing.from_json(json) +# print the JSON string representation of the object +print RealUserTestNetworkVpnPing.to_json() + +# convert the object into a dict +real_user_test_network_vpn_ping_dict = real_user_test_network_vpn_ping_instance.to_dict() +# create an instance of RealUserTestNetworkVpnPing from a dict +real_user_test_network_vpn_ping_form_dict = real_user_test_network_vpn_ping.from_dict(real_user_test_network_vpn_ping_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestNetworkVpnTraceroute.md b/endpoint/test_results_api/docs/RealUserTestNetworkVpnTraceroute.md new file mode 100644 index 00000000..80f8c426 --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestNetworkVpnTraceroute.md @@ -0,0 +1,32 @@ +# RealUserTestNetworkVpnTraceroute + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**destination** | **str** | The target IP address. | [optional] [readonly] +**error** | **str** | Only present when there is an error | [optional] [readonly] +**info_flags** | **List[str]** | | [optional] [readonly] +**internal_errors** | **List[str]** | | [optional] [readonly] +**hops** | [**List[TracerouteHop]**](TracerouteHop.md) | | [optional] + +## Example + +```python +from test_results_api.models.real_user_test_network_vpn_traceroute import RealUserTestNetworkVpnTraceroute + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserTestNetworkVpnTraceroute from a JSON string +real_user_test_network_vpn_traceroute_instance = RealUserTestNetworkVpnTraceroute.from_json(json) +# print the JSON string representation of the object +print RealUserTestNetworkVpnTraceroute.to_json() + +# convert the object into a dict +real_user_test_network_vpn_traceroute_dict = real_user_test_network_vpn_traceroute_instance.to_dict() +# create an instance of RealUserTestNetworkVpnTraceroute from a dict +real_user_test_network_vpn_traceroute_form_dict = real_user_test_network_vpn_traceroute.from_dict(real_user_test_network_vpn_traceroute_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestPage.md b/endpoint/test_results_api/docs/RealUserTestPage.md new file mode 100644 index 00000000..07214da9 --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestPage.md @@ -0,0 +1,33 @@ +# RealUserTestPage + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page_id** | **str** | Web page ID. The page ID is unique only within an endpoint real user test. | [optional] [readonly] +**page_title** | **str** | Web page title. | [optional] [readonly] +**page_url** | **str** | Web page url | [optional] [readonly] +**load_date** | **datetime** | UTC date when page load started (ISO date-time format). | [optional] [readonly] +**response_code** | **int** | HTTP response code. | [optional] [readonly] +**page_timings** | [**RealUserTestPagePageTimings**](RealUserTestPagePageTimings.md) | | [optional] + +## Example + +```python +from test_results_api.models.real_user_test_page import RealUserTestPage + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserTestPage from a JSON string +real_user_test_page_instance = RealUserTestPage.from_json(json) +# print the JSON string representation of the object +print RealUserTestPage.to_json() + +# convert the object into a dict +real_user_test_page_dict = real_user_test_page_instance.to_dict() +# create an instance of RealUserTestPage from a dict +real_user_test_page_form_dict = real_user_test_page.from_dict(real_user_test_page_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestPagePageTimings.md b/endpoint/test_results_api/docs/RealUserTestPagePageTimings.md new file mode 100644 index 00000000..4cd5eec2 --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestPagePageTimings.md @@ -0,0 +1,29 @@ +# RealUserTestPagePageTimings + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**on_content_load** | **int** | DOM load time in milliseconds. | [optional] [readonly] +**on_load** | **int** | Page load time in milliseconds. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.real_user_test_page_page_timings import RealUserTestPagePageTimings + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserTestPagePageTimings from a JSON string +real_user_test_page_page_timings_instance = RealUserTestPagePageTimings.from_json(json) +# print the JSON string representation of the object +print RealUserTestPagePageTimings.to_json() + +# convert the object into a dict +real_user_test_page_page_timings_dict = real_user_test_page_page_timings_instance.to_dict() +# create an instance of RealUserTestPagePageTimings from a dict +real_user_test_page_page_timings_form_dict = real_user_test_page_page_timings.from_dict(real_user_test_page_page_timings_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestPageResult.md b/endpoint/test_results_api/docs/RealUserTestPageResult.md new file mode 100644 index 00000000..c8e56497 --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestPageResult.md @@ -0,0 +1,38 @@ +# RealUserTestPageResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page_id** | **str** | Web page ID. The page ID is unique only within an endpoint real user test. | [optional] [readonly] +**page_title** | **str** | Web page title. | [optional] [readonly] +**page_url** | **str** | Web page url | [optional] [readonly] +**load_date** | **datetime** | UTC date when page load started (ISO date-time format). | [optional] [readonly] +**response_code** | **int** | HTTP response code. | [optional] [readonly] +**page_timings** | [**RealUserTestPagePageTimings**](RealUserTestPagePageTimings.md) | | [optional] +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**id** | **str** | Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**response_time** | **int** | HTTP server response in milliseconds. | [optional] [readonly] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] + +## Example + +```python +from test_results_api.models.real_user_test_page_result import RealUserTestPageResult + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserTestPageResult from a JSON string +real_user_test_page_result_instance = RealUserTestPageResult.from_json(json) +# print the JSON string representation of the object +print RealUserTestPageResult.to_json() + +# convert the object into a dict +real_user_test_page_result_dict = real_user_test_page_result_instance.to_dict() +# create an instance of RealUserTestPageResult from a dict +real_user_test_page_result_form_dict = real_user_test_page_result.from_dict(real_user_test_page_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestPageResults.md b/endpoint/test_results_api/docs/RealUserTestPageResults.md new file mode 100644 index 00000000..badb0d08 --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestPageResults.md @@ -0,0 +1,28 @@ +# RealUserTestPageResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[RealUserTestPageResult]**](RealUserTestPageResult.md) | | [optional] + +## Example + +```python +from test_results_api.models.real_user_test_page_results import RealUserTestPageResults + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserTestPageResults from a JSON string +real_user_test_page_results_instance = RealUserTestPageResults.from_json(json) +# print the JSON string representation of the object +print RealUserTestPageResults.to_json() + +# convert the object into a dict +real_user_test_page_results_dict = real_user_test_page_results_instance.to_dict() +# create an instance of RealUserTestPageResults from a dict +real_user_test_page_results_form_dict = real_user_test_page_results.from_dict(real_user_test_page_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/RealUserTestsResultsApi.md b/endpoint/test_results_api/docs/RealUserTestsResultsApi.md new file mode 100644 index 00000000..fbc679c1 --- /dev/null +++ b/endpoint/test_results_api/docs/RealUserTestsResultsApi.md @@ -0,0 +1,470 @@ +# test_results_api.RealUserTestsResultsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_endpoint_real_user_test_details**](RealUserTestsResultsApi.md#get_endpoint_real_user_test_details) | **GET** /v7/endpoint/test-results/real-user-tests/{id} | Retrieve endpoint real user test +[**get_endpoint_real_user_test_pages_details**](RealUserTestsResultsApi.md#get_endpoint_real_user_test_pages_details) | **GET** /v7/endpoint/test-results/real-user-tests/{id}/pages/{pageId} | Retrieve endpoint real user test page +[**get_endpoint_real_user_tests**](RealUserTestsResultsApi.md#get_endpoint_real_user_tests) | **POST** /v7/endpoint/test-results/real-user-tests/filter | List endpoint real user tests +[**get_endpoint_real_user_tests_network**](RealUserTestsResultsApi.md#get_endpoint_real_user_tests_network) | **POST** /v7/endpoint/test-results/real-user-tests/networks/filter | List endpoint real user tests +[**get_endpoint_real_user_tests_pages**](RealUserTestsResultsApi.md#get_endpoint_real_user_tests_pages) | **POST** /v7/endpoint/test-results/real-user-tests/pages/filter | List endpoint real user tests visited pages + + +# **get_endpoint_real_user_test_details** +> GetEndpointRealUserTestDetails200Response get_endpoint_real_user_test_details(id, aid=aid) + +Retrieve endpoint real user test + +Provides details for an endpoint real user test. Returns a results array containing detailed information about endpoint real user tests.\" + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_endpoint_real_user_test_details200_response import GetEndpointRealUserTestDetails200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.RealUserTestsResultsApi(api_client) + id = '07625:1490529480:h3qJQTpl' # str | The real user test id. + 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 endpoint real user test + api_response = api_instance.get_endpoint_real_user_test_details(id, aid=aid) + print("The response of RealUserTestsResultsApi->get_endpoint_real_user_test_details:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RealUserTestsResultsApi->get_endpoint_real_user_test_details: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The real user test id. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetEndpointRealUserTestDetails200Response**](GetEndpointRealUserTestDetails200Response.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 | - | + +[[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_endpoint_real_user_test_pages_details** +> GetEndpointRealUserTestPagesDetails200Response get_endpoint_real_user_test_pages_details(id, page_id, aid=aid) + +Retrieve endpoint real user test page + +Returns details for endpoint real user test web page request. Provides complete waterfall information with all object requests. Sends back detailed endpoint real user test web page request. Returned object has a single field: `har` which is an HAR object according to the HTTP Archive 1.2 specifications. [You can read more about the specification](http://www.softwareishard.com/blog/har-12-spec/). In addition to standard fields, the object har includes a custom property `systemMetrics` which contain metrics about CPU and physical memory usage. Check `SystemMetrics` on schemas tab for more information. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_endpoint_real_user_test_pages_details200_response import GetEndpointRealUserTestPagesDetails200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.RealUserTestsResultsApi(api_client) + id = '07625:1490529480:h3qJQTpl' # str | The real user test id. + page_id = '281474976710706' # str | Web page ID + 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 endpoint real user test page + api_response = api_instance.get_endpoint_real_user_test_pages_details(id, page_id, aid=aid) + print("The response of RealUserTestsResultsApi->get_endpoint_real_user_test_pages_details:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RealUserTestsResultsApi->get_endpoint_real_user_test_pages_details: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The real user test id. | + **page_id** | **str**| Web page ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetEndpointRealUserTestPagesDetails200Response**](GetEndpointRealUserTestPagesDetails200Response.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 | - | + +[[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_endpoint_real_user_tests** +> GetEndpointRealUserTests200Response get_endpoint_real_user_tests(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, get_endpoint_real_user_tests_request=get_endpoint_real_user_tests_request) + +List endpoint real user tests + +Returns a list of all endpoint real user tests. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` Returns a `results` array of endpoint real user tests. Either the latest results, or based on the time range and body filters specified. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_endpoint_real_user_tests200_response import GetEndpointRealUserTests200Response +from test_results_api.models.get_endpoint_real_user_tests_request import GetEndpointRealUserTestsRequest +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.RealUserTestsResultsApi(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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + get_endpoint_real_user_tests_request = test_results_api.GetEndpointRealUserTestsRequest() # GetEndpointRealUserTestsRequest | (optional) + + try: + # List endpoint real user tests + api_response = api_instance.get_endpoint_real_user_tests(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, get_endpoint_real_user_tests_request=get_endpoint_real_user_tests_request) + print("The response of RealUserTestsResultsApi->get_endpoint_real_user_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RealUserTestsResultsApi->get_endpoint_real_user_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **get_endpoint_real_user_tests_request** | [**GetEndpointRealUserTestsRequest**](GetEndpointRealUserTestsRequest.md)| | [optional] + +### Return type + +[**GetEndpointRealUserTests200Response**](GetEndpointRealUserTests200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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 | - | + +[[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_endpoint_real_user_tests_network** +> GetEndpointRealUserTestsNetwork200Response get_endpoint_real_user_tests_network(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, get_endpoint_real_user_tests_request=get_endpoint_real_user_tests_request) + +List endpoint real user tests + +Returns a list of all endpoint real user tests. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of endpoint real user tests. Network sessions shown are from the latest round, or based on the time range specified. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_endpoint_real_user_tests_network200_response import GetEndpointRealUserTestsNetwork200Response +from test_results_api.models.get_endpoint_real_user_tests_request import GetEndpointRealUserTestsRequest +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.RealUserTestsResultsApi(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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + get_endpoint_real_user_tests_request = test_results_api.GetEndpointRealUserTestsRequest() # GetEndpointRealUserTestsRequest | (optional) + + try: + # List endpoint real user tests + api_response = api_instance.get_endpoint_real_user_tests_network(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, get_endpoint_real_user_tests_request=get_endpoint_real_user_tests_request) + print("The response of RealUserTestsResultsApi->get_endpoint_real_user_tests_network:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RealUserTestsResultsApi->get_endpoint_real_user_tests_network: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **get_endpoint_real_user_tests_request** | [**GetEndpointRealUserTestsRequest**](GetEndpointRealUserTestsRequest.md)| | [optional] + +### Return type + +[**GetEndpointRealUserTestsNetwork200Response**](GetEndpointRealUserTestsNetwork200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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 | - | + +[[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_endpoint_real_user_tests_pages** +> GetEndpointRealUserTestsPages200Response get_endpoint_real_user_tests_pages(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, endpoint_real_user_test_result_request_filter=endpoint_real_user_test_result_request_filter) + +List endpoint real user tests visited pages + +Returns a list of all endpoint real user tests visited pages. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of user loaded pages in an endpoint real user test. Pages shown are from the latest round, or based on the time range specified. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.endpoint_real_user_test_result_request_filter import EndpointRealUserTestResultRequestFilter +from test_results_api.models.get_endpoint_real_user_tests_pages200_response import GetEndpointRealUserTestsPages200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.RealUserTestsResultsApi(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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + endpoint_real_user_test_result_request_filter = test_results_api.EndpointRealUserTestResultRequestFilter() # EndpointRealUserTestResultRequestFilter | (optional) + + try: + # List endpoint real user tests visited pages + api_response = api_instance.get_endpoint_real_user_tests_pages(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, endpoint_real_user_test_result_request_filter=endpoint_real_user_test_result_request_filter) + print("The response of RealUserTestsResultsApi->get_endpoint_real_user_tests_pages:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RealUserTestsResultsApi->get_endpoint_real_user_tests_pages: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **endpoint_real_user_test_result_request_filter** | [**EndpointRealUserTestResultRequestFilter**](EndpointRealUserTestResultRequestFilter.md)| | [optional] + +### Return type + +[**GetEndpointRealUserTestsPages200Response**](GetEndpointRealUserTestsPages200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/test_results_api/docs/SelfLinks.md b/endpoint/test_results_api/docs/SelfLinks.md new file mode 100644 index 00000000..f3bf2ff8 --- /dev/null +++ b/endpoint/test_results_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/SelfLinksLinks.md b/endpoint/test_results_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..2eecc7cc --- /dev/null +++ b/endpoint/test_results_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from test_results_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/SortOrder.md b/endpoint/test_results_api/docs/SortOrder.md new file mode 100644 index 00000000..34e912e4 --- /dev/null +++ b/endpoint/test_results_api/docs/SortOrder.md @@ -0,0 +1,11 @@ +# SortOrder + +Parameter indicates the ascending/descending order of the sorting, using either the asc or desc values. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/SpecificAgentsSelectorType.md b/endpoint/test_results_api/docs/SpecificAgentsSelectorType.md new file mode 100644 index 00000000..e0b875a0 --- /dev/null +++ b/endpoint/test_results_api/docs/SpecificAgentsSelectorType.md @@ -0,0 +1,10 @@ +# SpecificAgentsSelectorType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/SystemMetrics.md b/endpoint/test_results_api/docs/SystemMetrics.md new file mode 100644 index 00000000..015b985a --- /dev/null +++ b/endpoint/test_results_api/docs/SystemMetrics.md @@ -0,0 +1,32 @@ +# SystemMetrics + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_time_ms** | **float** | The start time of metrics collection, expressed in milliseconds since the Epoch. | [optional] [readonly] +**end_time_ms** | **float** | The end time of metrics collection, expressed in milliseconds since the Epoch. | [optional] [readonly] +**cpu_utilization** | [**CpuUtilization**](CpuUtilization.md) | | [optional] +**physical_memory_used_bytes** | [**PhysicalMemoryUsedBytes**](PhysicalMemoryUsedBytes.md) | | [optional] +**physical_memory_total_bytes** | **float** | Total physical memory of the system. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.system_metrics import SystemMetrics + +# TODO update the JSON string below +json = "{}" +# create an instance of SystemMetrics from a JSON string +system_metrics_instance = SystemMetrics.from_json(json) +# print the JSON string representation of the object +print SystemMetrics.to_json() + +# convert the object into a dict +system_metrics_dict = system_metrics_instance.to_dict() +# create an instance of SystemMetrics from a dict +system_metrics_form_dict = system_metrics.from_dict(system_metrics_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/TcpConnect.md b/endpoint/test_results_api/docs/TcpConnect.md new file mode 100644 index 00000000..59beaa84 --- /dev/null +++ b/endpoint/test_results_api/docs/TcpConnect.md @@ -0,0 +1,31 @@ +# TcpConnect + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rtt** | **float** | Represents the number of milliseconds required to establish TCP connectivity with the target | [optional] [readonly] +**error_code** | **str** | Only present when there is an error | [optional] [readonly] +**error** | **str** | Only present when there is an error | [optional] [readonly] +**info_flags** | **List[str]** | | [optional] [readonly] + +## Example + +```python +from test_results_api.models.tcp_connect import TcpConnect + +# TODO update the JSON string below +json = "{}" +# create an instance of TcpConnect from a JSON string +tcp_connect_instance = TcpConnect.from_json(json) +# print the JSON string representation of the object +print TcpConnect.to_json() + +# convert the object into a dict +tcp_connect_dict = tcp_connect_instance.to_dict() +# create an instance of TcpConnect from a dict +tcp_connect_form_dict = tcp_connect.from_dict(tcp_connect_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/TestInterval.md b/endpoint/test_results_api/docs/TestInterval.md new file mode 100644 index 00000000..e0e57d69 --- /dev/null +++ b/endpoint/test_results_api/docs/TestInterval.md @@ -0,0 +1,11 @@ +# TestInterval + +Interval between test runs in seconds. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/TestProbeMode.md b/endpoint/test_results_api/docs/TestProbeMode.md new file mode 100644 index 00000000..2e0ad614 --- /dev/null +++ b/endpoint/test_results_api/docs/TestProbeMode.md @@ -0,0 +1,11 @@ +# TestProbeMode + +Probe mode used by network test, only valid when the protocol is set to TCP. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/TestResult.md b/endpoint/test_results_api/docs/TestResult.md new file mode 100644 index 00000000..0dff63ac --- /dev/null +++ b/endpoint/test_results_api/docs/TestResult.md @@ -0,0 +1,33 @@ +# TestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**aid** | [**AccountGroupId**](AccountGroupId.md) | | [optional] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] + +## Example + +```python +from test_results_api.models.test_result import TestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of TestResult from a JSON string +test_result_instance = TestResult.from_json(json) +# print the JSON string representation of the object +print TestResult.to_json() + +# convert the object into a dict +test_result_dict = test_result_instance.to_dict() +# create an instance of TestResult from a dict +test_result_form_dict = test_result.from_dict(test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/TestSslVersionId.md b/endpoint/test_results_api/docs/TestSslVersionId.md new file mode 100644 index 00000000..fb9ac0f8 --- /dev/null +++ b/endpoint/test_results_api/docs/TestSslVersionId.md @@ -0,0 +1,11 @@ +# TestSslVersionId + +SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/TestsDataRoundsSearch.md b/endpoint/test_results_api/docs/TestsDataRoundsSearch.md new file mode 100644 index 00000000..48f40658 --- /dev/null +++ b/endpoint/test_results_api/docs/TestsDataRoundsSearch.md @@ -0,0 +1,30 @@ +# TestsDataRoundsSearch + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**search_sort** | [**List[TestsDataSearchSort]**](TestsDataSearchSort.md) | | [optional] +**threshold_filter** | [**TestsDataThresholdFilters**](TestsDataThresholdFilters.md) | | [optional] +**search_filters** | [**TestsDataSearchFilter**](TestsDataSearchFilter.md) | | [optional] + +## Example + +```python +from test_results_api.models.tests_data_rounds_search import TestsDataRoundsSearch + +# TODO update the JSON string below +json = "{}" +# create an instance of TestsDataRoundsSearch from a JSON string +tests_data_rounds_search_instance = TestsDataRoundsSearch.from_json(json) +# print the JSON string representation of the object +print TestsDataRoundsSearch.to_json() + +# convert the object into a dict +tests_data_rounds_search_dict = tests_data_rounds_search_instance.to_dict() +# create an instance of TestsDataRoundsSearch from a dict +tests_data_rounds_search_form_dict = tests_data_rounds_search.from_dict(tests_data_rounds_search_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/TestsDataSearchFilter.md b/endpoint/test_results_api/docs/TestsDataSearchFilter.md new file mode 100644 index 00000000..6b201ee7 --- /dev/null +++ b/endpoint/test_results_api/docs/TestsDataSearchFilter.md @@ -0,0 +1,28 @@ +# TestsDataSearchFilter + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **List[str]** | Filter using the `agent-id`. | [optional] + +## Example + +```python +from test_results_api.models.tests_data_search_filter import TestsDataSearchFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of TestsDataSearchFilter from a JSON string +tests_data_search_filter_instance = TestsDataSearchFilter.from_json(json) +# print the JSON string representation of the object +print TestsDataSearchFilter.to_json() + +# convert the object into a dict +tests_data_search_filter_dict = tests_data_search_filter_instance.to_dict() +# create an instance of TestsDataSearchFilter from a dict +tests_data_search_filter_form_dict = tests_data_search_filter.from_dict(tests_data_search_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/TestsDataSearchSort.md b/endpoint/test_results_api/docs/TestsDataSearchSort.md new file mode 100644 index 00000000..31a96e03 --- /dev/null +++ b/endpoint/test_results_api/docs/TestsDataSearchSort.md @@ -0,0 +1,29 @@ +# TestsDataSearchSort + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sort** | [**TestsDataSearchSortKey**](TestsDataSearchSortKey.md) | | [optional] +**order** | [**SortOrder**](SortOrder.md) | | [optional] + +## Example + +```python +from test_results_api.models.tests_data_search_sort import TestsDataSearchSort + +# TODO update the JSON string below +json = "{}" +# create an instance of TestsDataSearchSort from a JSON string +tests_data_search_sort_instance = TestsDataSearchSort.from_json(json) +# print the JSON string representation of the object +print TestsDataSearchSort.to_json() + +# convert the object into a dict +tests_data_search_sort_dict = tests_data_search_sort_instance.to_dict() +# create an instance of TestsDataSearchSort from a dict +tests_data_search_sort_form_dict = tests_data_search_sort.from_dict(tests_data_search_sort_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/TestsDataSearchSortKey.md b/endpoint/test_results_api/docs/TestsDataSearchSortKey.md new file mode 100644 index 00000000..ba4f6ae0 --- /dev/null +++ b/endpoint/test_results_api/docs/TestsDataSearchSortKey.md @@ -0,0 +1,10 @@ +# TestsDataSearchSortKey + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/TestsDataThresholdFilter.md b/endpoint/test_results_api/docs/TestsDataThresholdFilter.md new file mode 100644 index 00000000..7966cb06 --- /dev/null +++ b/endpoint/test_results_api/docs/TestsDataThresholdFilter.md @@ -0,0 +1,31 @@ +# TestsDataThresholdFilter + +The metric is filtered based on the threshold value and operator provided. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | [**ThresholdFilterName**](ThresholdFilterName.md) | | [optional] +**value** | **float** | The threshold value. | [optional] +**operator** | [**ThresholdFilterOperator**](ThresholdFilterOperator.md) | | [optional] + +## Example + +```python +from test_results_api.models.tests_data_threshold_filter import TestsDataThresholdFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of TestsDataThresholdFilter from a JSON string +tests_data_threshold_filter_instance = TestsDataThresholdFilter.from_json(json) +# print the JSON string representation of the object +print TestsDataThresholdFilter.to_json() + +# convert the object into a dict +tests_data_threshold_filter_dict = tests_data_threshold_filter_instance.to_dict() +# create an instance of TestsDataThresholdFilter from a dict +tests_data_threshold_filter_form_dict = tests_data_threshold_filter.from_dict(tests_data_threshold_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/TestsDataThresholdFilters.md b/endpoint/test_results_api/docs/TestsDataThresholdFilters.md new file mode 100644 index 00000000..df266f08 --- /dev/null +++ b/endpoint/test_results_api/docs/TestsDataThresholdFilters.md @@ -0,0 +1,30 @@ +# TestsDataThresholdFilters + +All filters are applied based on the conditional operator (and/or). + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filters** | [**List[TestsDataThresholdFilter]**](TestsDataThresholdFilter.md) | | [optional] +**conditional_operator** | [**ConditionalOperator**](ConditionalOperator.md) | | [optional] + +## Example + +```python +from test_results_api.models.tests_data_threshold_filters import TestsDataThresholdFilters + +# TODO update the JSON string below +json = "{}" +# create an instance of TestsDataThresholdFilters from a JSON string +tests_data_threshold_filters_instance = TestsDataThresholdFilters.from_json(json) +# print the JSON string representation of the object +print TestsDataThresholdFilters.to_json() + +# convert the object into a dict +tests_data_threshold_filters_dict = tests_data_threshold_filters_instance.to_dict() +# create an instance of TestsDataThresholdFilters from a dict +tests_data_threshold_filters_form_dict = tests_data_threshold_filters.from_dict(tests_data_threshold_filters_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/ThresholdFilterName.md b/endpoint/test_results_api/docs/ThresholdFilterName.md new file mode 100644 index 00000000..61aa3064 --- /dev/null +++ b/endpoint/test_results_api/docs/ThresholdFilterName.md @@ -0,0 +1,11 @@ +# ThresholdFilterName + +Metric on which the threshold filter is applied. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/ThresholdFilterOperator.md b/endpoint/test_results_api/docs/ThresholdFilterOperator.md new file mode 100644 index 00000000..9a7b5288 --- /dev/null +++ b/endpoint/test_results_api/docs/ThresholdFilterOperator.md @@ -0,0 +1,10 @@ +# ThresholdFilterOperator + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/Traceroute.md b/endpoint/test_results_api/docs/Traceroute.md new file mode 100644 index 00000000..1373edbf --- /dev/null +++ b/endpoint/test_results_api/docs/Traceroute.md @@ -0,0 +1,32 @@ +# Traceroute + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**destination** | **str** | The target IP address. | [optional] [readonly] +**error** | **str** | Only present when there is an error | [optional] [readonly] +**info_flags** | **List[str]** | | [optional] [readonly] +**internal_errors** | **List[str]** | | [optional] [readonly] +**hops** | [**List[TracerouteHop]**](TracerouteHop.md) | | [optional] + +## Example + +```python +from test_results_api.models.traceroute import Traceroute + +# TODO update the JSON string below +json = "{}" +# create an instance of Traceroute from a JSON string +traceroute_instance = Traceroute.from_json(json) +# print the JSON string representation of the object +print Traceroute.to_json() + +# convert the object into a dict +traceroute_dict = traceroute_instance.to_dict() +# create an instance of Traceroute from a dict +traceroute_form_dict = traceroute.from_dict(traceroute_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/TracerouteHop.md b/endpoint/test_results_api/docs/TracerouteHop.md new file mode 100644 index 00000000..b7adabfd --- /dev/null +++ b/endpoint/test_results_api/docs/TracerouteHop.md @@ -0,0 +1,34 @@ +# TracerouteHop + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hop** | **int** | The hop index. | [optional] [readonly] +**ip_address** | **str** | IP address of the hop. | [optional] [readonly] +**prefix** | **str** | Prefix of IP address shown in CIDR. | [optional] [readonly] +**asn** | **int** | Unique number assigned to an organization (also referred to as service provider). | [optional] [readonly] +**delay** | **int** | Hop delay | [optional] [readonly] +**mpls** | **List[str]** | Hop Multiprotocol Label Switching. | [optional] [readonly] +**name** | **str** | The hop name. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.traceroute_hop import TracerouteHop + +# TODO update the JSON string below +json = "{}" +# create an instance of TracerouteHop from a JSON string +traceroute_hop_instance = TracerouteHop.from_json(json) +# print the JSON string representation of the object +print TracerouteHop.to_json() + +# convert the object into a dict +traceroute_hop_dict = traceroute_hop_instance.to_dict() +# create an instance of TracerouteHop from a dict +traceroute_hop_form_dict = traceroute_hop.from_dict(traceroute_hop_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/Trigger.md b/endpoint/test_results_api/docs/Trigger.md new file mode 100644 index 00000000..5c08a2b3 --- /dev/null +++ b/endpoint/test_results_api/docs/Trigger.md @@ -0,0 +1,10 @@ +# Trigger + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/UnauthorizedError.md b/endpoint/test_results_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..e4879144 --- /dev/null +++ b/endpoint/test_results_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from test_results_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/VpnProfile.md b/endpoint/test_results_api/docs/VpnProfile.md new file mode 100644 index 00000000..0509f991 --- /dev/null +++ b/endpoint/test_results_api/docs/VpnProfile.md @@ -0,0 +1,31 @@ +# VpnProfile + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**vpn_client_addresses** | **List[str]** | A list of private IP addresses assigned to the device by the VPN server. | [optional] [readonly] +**vpn_client_network_range** | **List[str]** | A list of private networks assigned to the device by the VPN server. | [optional] [readonly] +**vpn_gateway_address** | **str** | IP address of the VPN gateway. | [optional] [readonly] +**vpn_type** | [**VpnType**](VpnType.md) | | [optional] + +## Example + +```python +from test_results_api.models.vpn_profile import VpnProfile + +# TODO update the JSON string below +json = "{}" +# create an instance of VpnProfile from a JSON string +vpn_profile_instance = VpnProfile.from_json(json) +# print the JSON string representation of the object +print VpnProfile.to_json() + +# convert the object into a dict +vpn_profile_dict = vpn_profile_instance.to_dict() +# create an instance of VpnProfile from a dict +vpn_profile_form_dict = vpn_profile.from_dict(vpn_profile_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/VpnType.md b/endpoint/test_results_api/docs/VpnType.md new file mode 100644 index 00000000..5531185b --- /dev/null +++ b/endpoint/test_results_api/docs/VpnType.md @@ -0,0 +1,11 @@ +# VpnType + +Name of the VPN provider. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/test_results_api/docs/WebHTTPServerScheduledTestResultsApi.md b/endpoint/test_results_api/docs/WebHTTPServerScheduledTestResultsApi.md new file mode 100644 index 00000000..8a52c097 --- /dev/null +++ b/endpoint/test_results_api/docs/WebHTTPServerScheduledTestResultsApi.md @@ -0,0 +1,105 @@ +# test_results_api.WebHTTPServerScheduledTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_result_http_server**](WebHTTPServerScheduledTestResultsApi.md#get_test_result_http_server) | **GET** /v7/endpoint/test-results/scheduled-tests/{testId}/http-server | Retrieve HTTP server scheduled test results + + +# **get_test_result_http_server** +> GetTestResultHttpServer200Response get_test_result_http_server(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, expand=expand) + +Retrieve HTTP server scheduled test results + +Returns component-level (DNS, Connect, Wait and Receive) timing for the load of an object over HTTP. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.expand import Expand +from test_results_api.models.get_test_result_http_server200_response import GetTestResultHttpServer200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.WebHTTPServerScheduledTestResultsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + expand = [test_results_api.Expand()] # List[Expand] | This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. (optional) + + try: + # Retrieve HTTP server scheduled test results + api_response = api_instance.get_test_result_http_server(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, expand=expand) + print("The response of WebHTTPServerScheduledTestResultsApi->get_test_result_http_server:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebHTTPServerScheduledTestResultsApi->get_test_result_http_server: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **expand** | [**List[Expand]**](Expand.md)| This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. | [optional] + +### Return type + +[**GetTestResultHttpServer200Response**](GetTestResultHttpServer200Response.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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/test_results_api/git_push.sh b/endpoint/test_results_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/endpoint/test_results_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/endpoint/test_results_api/pyproject.toml b/endpoint/test_results_api/pyproject.toml new file mode 100644 index 00000000..c7eba97b --- /dev/null +++ b/endpoint/test_results_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "test_results_api" +version = "1.0.0" +description = "Endpoint Test Results API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Endpoint Test Results API"] +include = ["test_results_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/endpoint/test_results_api/requirements.txt b/endpoint/test_results_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/endpoint/test_results_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/endpoint/test_results_api/setup.cfg b/endpoint/test_results_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/endpoint/test_results_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/endpoint/test_results_api/setup.py b/endpoint/test_results_api/setup.py new file mode 100644 index 00000000..ab3d7b6b --- /dev/null +++ b/endpoint/test_results_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "test-results-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Endpoint Test Results API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Endpoint Test Results API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + Retrieve results for scheduled and dynamic tests on endpoint agents. + """, # noqa: E501 + package_data={"test_results_api": ["py.typed"]}, +) diff --git a/endpoint/test_results_api/test-requirements.txt b/endpoint/test_results_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/endpoint/test_results_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/endpoint/test_results_api/test/__init__.py b/endpoint/test_results_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/endpoint/test_results_api/test/test_account_group_id.py b/endpoint/test_results_api/test/test_account_group_id.py new file mode 100644 index 00000000..dd4e8ecd --- /dev/null +++ b/endpoint/test_results_api/test/test_account_group_id.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.account_group_id import AccountGroupId + +class TestAccountGroupId(unittest.TestCase): + """AccountGroupId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroupId: + """Test AccountGroupId + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroupId` + """ + model = AccountGroupId() + if include_optional: + return AccountGroupId( + aid = '11' + ) + else: + return AccountGroupId( + ) + """ + + def testAccountGroupId(self): + """Test AccountGroupId""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_agent_labels_selector_type.py b/endpoint/test_results_api/test/test_agent_labels_selector_type.py new file mode 100644 index 00000000..522deed9 --- /dev/null +++ b/endpoint/test_results_api/test/test_agent_labels_selector_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.agent_labels_selector_type import AgentLabelsSelectorType + +class TestAgentLabelsSelectorType(unittest.TestCase): + """AgentLabelsSelectorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAgentLabelsSelectorType(self): + """Test AgentLabelsSelectorType""" + # inst = AgentLabelsSelectorType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_all_agents_selector_type.py b/endpoint/test_results_api/test/test_all_agents_selector_type.py new file mode 100644 index 00000000..754e8d0e --- /dev/null +++ b/endpoint/test_results_api/test/test_all_agents_selector_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.all_agents_selector_type import AllAgentsSelectorType + +class TestAllAgentsSelectorType(unittest.TestCase): + """AllAgentsSelectorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAllAgentsSelectorType(self): + """Test AllAgentsSelectorType""" + # inst = AllAgentsSelectorType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_application_score_quality.py b/endpoint/test_results_api/test/test_application_score_quality.py new file mode 100644 index 00000000..e2914a2f --- /dev/null +++ b/endpoint/test_results_api/test/test_application_score_quality.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.application_score_quality import ApplicationScoreQuality + +class TestApplicationScoreQuality(unittest.TestCase): + """ApplicationScoreQuality unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApplicationScoreQuality(self): + """Test ApplicationScoreQuality""" + # inst = ApplicationScoreQuality() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_asn_details.py b/endpoint/test_results_api/test/test_asn_details.py new file mode 100644 index 00000000..3c57ecce --- /dev/null +++ b/endpoint/test_results_api/test/test_asn_details.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.asn_details import AsnDetails + +class TestAsnDetails(unittest.TestCase): + """AsnDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AsnDetails: + """Test AsnDetails + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AsnDetails` + """ + model = AsnDetails() + if include_optional: + return AsnDetails( + as_name = 'ThousandEyes, Inc', + as_number = 394101 + ) + else: + return AsnDetails( + ) + """ + + def testAsnDetails(self): + """Test AsnDetails""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_conditional_operator.py b/endpoint/test_results_api/test/test_conditional_operator.py new file mode 100644 index 00000000..d250bfe3 --- /dev/null +++ b/endpoint/test_results_api/test/test_conditional_operator.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.conditional_operator import ConditionalOperator + +class TestConditionalOperator(unittest.TestCase): + """ConditionalOperator unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConditionalOperator(self): + """Test ConditionalOperator""" + # inst = ConditionalOperator() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_cpu_utilization.py b/endpoint/test_results_api/test/test_cpu_utilization.py new file mode 100644 index 00000000..e573ad8d --- /dev/null +++ b/endpoint/test_results_api/test/test_cpu_utilization.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.cpu_utilization import CpuUtilization + +class TestCpuUtilization(unittest.TestCase): + """CpuUtilization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CpuUtilization: + """Test CpuUtilization + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CpuUtilization` + """ + model = CpuUtilization() + if include_optional: + return CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150 + ) + else: + return CpuUtilization( + ) + """ + + def testCpuUtilization(self): + """Test CpuUtilization""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_dynamic_base_test_result.py b/endpoint/test_results_api/test/test_dynamic_base_test_result.py new file mode 100644 index 00000000..df2705dd --- /dev/null +++ b/endpoint/test_results_api/test/test_dynamic_base_test_result.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.dynamic_base_test_result import DynamicBaseTestResult + +class TestDynamicBaseTestResult(unittest.TestCase): + """DynamicBaseTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicBaseTestResult: + """Test DynamicBaseTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicBaseTestResult` + """ + model = DynamicBaseTestResult() + if include_optional: + return DynamicBaseTestResult( + application = 'webex', + webex = test_results_api.models.dynamic_base_test_result_webex.DynamicBaseTestResult_webex( + conference_id = '225817074608419375', + correlation_id = '22581707460321454', ) + ) + else: + return DynamicBaseTestResult( + ) + """ + + def testDynamicBaseTestResult(self): + """Test DynamicBaseTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_dynamic_base_test_result_webex.py b/endpoint/test_results_api/test/test_dynamic_base_test_result_webex.py new file mode 100644 index 00000000..783118f1 --- /dev/null +++ b/endpoint/test_results_api/test/test_dynamic_base_test_result_webex.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.dynamic_base_test_result_webex import DynamicBaseTestResultWebex + +class TestDynamicBaseTestResultWebex(unittest.TestCase): + """DynamicBaseTestResultWebex unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicBaseTestResultWebex: + """Test DynamicBaseTestResultWebex + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicBaseTestResultWebex` + """ + model = DynamicBaseTestResultWebex() + if include_optional: + return DynamicBaseTestResultWebex( + conference_id = '225817074608419375', + correlation_id = '22581707460321454' + ) + else: + return DynamicBaseTestResultWebex( + ) + """ + + def testDynamicBaseTestResultWebex(self): + """Test DynamicBaseTestResultWebex""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_dynamic_test.py b/endpoint/test_results_api/test/test_dynamic_test.py new file mode 100644 index 00000000..e5a42f60 --- /dev/null +++ b/endpoint/test_results_api/test/test_dynamic_test.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.dynamic_test import DynamicTest + +class TestDynamicTest(unittest.TestCase): + """DynamicTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicTest: + """Test DynamicTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicTest` + """ + model = DynamicTest() + if include_optional: + return DynamicTest( + links = test_results_api.models.dynamic_test_links.DynamicTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}], ), + agent_selector_config = test_results_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + application = 'webex', + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + has_path_trace_in_session = True, + has_ping = True, + has_traceroute = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + protocol = 'icmp', + tcp_probe_mode = 'auto', + test_id = '281474976710706', + aid = None, + test_name = 'Test name' + ) + else: + return DynamicTest( + ) + """ + + def testDynamicTest(self): + """Test DynamicTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_dynamic_test_application.py b/endpoint/test_results_api/test/test_dynamic_test_application.py new file mode 100644 index 00000000..4a502fb4 --- /dev/null +++ b/endpoint/test_results_api/test/test_dynamic_test_application.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.dynamic_test_application import DynamicTestApplication + +class TestDynamicTestApplication(unittest.TestCase): + """DynamicTestApplication unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDynamicTestApplication(self): + """Test DynamicTestApplication""" + # inst = DynamicTestApplication() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_dynamic_test_links.py b/endpoint/test_results_api/test/test_dynamic_test_links.py new file mode 100644 index 00000000..b6e61e8f --- /dev/null +++ b/endpoint/test_results_api/test/test_dynamic_test_links.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.dynamic_test_links import DynamicTestLinks + +class TestDynamicTestLinks(unittest.TestCase): + """DynamicTestLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicTestLinks: + """Test DynamicTestLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicTestLinks` + """ + model = DynamicTestLinks() + if include_optional: + return DynamicTestLinks( + var_self = None, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}] + ) + else: + return DynamicTestLinks( + ) + """ + + def testDynamicTestLinks(self): + """Test DynamicTestLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_dynamic_test_links_self.py b/endpoint/test_results_api/test/test_dynamic_test_links_self.py new file mode 100644 index 00000000..4e623896 --- /dev/null +++ b/endpoint/test_results_api/test/test_dynamic_test_links_self.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.dynamic_test_links_self import DynamicTestLinksSelf + +class TestDynamicTestLinksSelf(unittest.TestCase): + """DynamicTestLinksSelf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicTestLinksSelf: + """Test DynamicTestLinksSelf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicTestLinksSelf` + """ + model = DynamicTestLinksSelf() + if include_optional: + return DynamicTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return DynamicTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testDynamicTestLinksSelf(self): + """Test DynamicTestLinksSelf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_dynamic_test_links_test_results.py b/endpoint/test_results_api/test/test_dynamic_test_links_test_results.py new file mode 100644 index 00000000..a7bf3d89 --- /dev/null +++ b/endpoint/test_results_api/test/test_dynamic_test_links_test_results.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.dynamic_test_links_test_results import DynamicTestLinksTestResults + +class TestDynamicTestLinksTestResults(unittest.TestCase): + """DynamicTestLinksTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicTestLinksTestResults: + """Test DynamicTestLinksTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicTestLinksTestResults` + """ + model = DynamicTestLinksTestResults() + if include_optional: + return DynamicTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return DynamicTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testDynamicTestLinksTestResults(self): + """Test DynamicTestLinksTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_dynamic_tests_data_round_search.py b/endpoint/test_results_api/test/test_dynamic_tests_data_round_search.py new file mode 100644 index 00000000..38351854 --- /dev/null +++ b/endpoint/test_results_api/test/test_dynamic_tests_data_round_search.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.dynamic_tests_data_round_search import DynamicTestsDataRoundSearch + +class TestDynamicTestsDataRoundSearch(unittest.TestCase): + """DynamicTestsDataRoundSearch unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicTestsDataRoundSearch: + """Test DynamicTestsDataRoundSearch + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicTestsDataRoundSearch` + """ + model = DynamicTestsDataRoundSearch() + if include_optional: + return DynamicTestsDataRoundSearch( + search_sort = [ + test_results_api.models.tests_data_search_sort.TestsDataSearchSort( + sort = 'round-id', + order = 'desc', ) + ], + threshold_filter = test_results_api.models.tests_data_threshold_filters.TestsDataThresholdFilters( + filters = [ + test_results_api.models.tests_data_threshold_filter.TestsDataThresholdFilter( + name = 'loss', + value = 1.337, + operator = 'gte', ) + ], + conditional_operator = 'and', ), + search_filters = test_results_api.models.dynamic_tests_data_search_filter.DynamicTestsDataSearchFilter( + agent_id = [ + '52455b09-ff1b-4849-8194-99026cc890e0' + ], + webex_conference_id = [ + '52455b09-ff1b-4849-8194-99026cc890e0' + ], ) + ) + else: + return DynamicTestsDataRoundSearch( + ) + """ + + def testDynamicTestsDataRoundSearch(self): + """Test DynamicTestsDataRoundSearch""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_dynamic_tests_data_search_filter.py b/endpoint/test_results_api/test/test_dynamic_tests_data_search_filter.py new file mode 100644 index 00000000..33629210 --- /dev/null +++ b/endpoint/test_results_api/test/test_dynamic_tests_data_search_filter.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.dynamic_tests_data_search_filter import DynamicTestsDataSearchFilter + +class TestDynamicTestsDataSearchFilter(unittest.TestCase): + """DynamicTestsDataSearchFilter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicTestsDataSearchFilter: + """Test DynamicTestsDataSearchFilter + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicTestsDataSearchFilter` + """ + model = DynamicTestsDataSearchFilter() + if include_optional: + return DynamicTestsDataSearchFilter( + agent_id = [ + '52455b09-ff1b-4849-8194-99026cc890e0' + ], + webex_conference_id = [ + '52455b09-ff1b-4849-8194-99026cc890e0' + ] + ) + else: + return DynamicTestsDataSearchFilter( + ) + """ + + def testDynamicTestsDataSearchFilter(self): + """Test DynamicTestsDataSearchFilter""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_agent_labels_selector_config.py b/endpoint/test_results_api/test/test_endpoint_agent_labels_selector_config.py new file mode 100644 index 00000000..d6ffd531 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_agent_labels_selector_config.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig + +class TestEndpointAgentLabelsSelectorConfig(unittest.TestCase): + """EndpointAgentLabelsSelectorConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentLabelsSelectorConfig: + """Test EndpointAgentLabelsSelectorConfig + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentLabelsSelectorConfig` + """ + model = EndpointAgentLabelsSelectorConfig() + if include_optional: + return EndpointAgentLabelsSelectorConfig( + agent_selector_type = 'agent-labels', + max_machines = 10, + endpoint_agent_labels = ["567","214"] + ) + else: + return EndpointAgentLabelsSelectorConfig( + ) + """ + + def testEndpointAgentLabelsSelectorConfig(self): + """Test EndpointAgentLabelsSelectorConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_agent_selector_config.py b/endpoint/test_results_api/test/test_endpoint_agent_selector_config.py new file mode 100644 index 00000000..6703adb9 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_agent_selector_config.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig + +class TestEndpointAgentSelectorConfig(unittest.TestCase): + """EndpointAgentSelectorConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentSelectorConfig: + """Test EndpointAgentSelectorConfig + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentSelectorConfig` + """ + model = EndpointAgentSelectorConfig() + if include_optional: + return EndpointAgentSelectorConfig( + agent_selector_type = 'specific-agents', + max_machines = 10, + endpoint_agent_labels = ["567","214"], + agents = ["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"] + ) + else: + return EndpointAgentSelectorConfig( + ) + """ + + def testEndpointAgentSelectorConfig(self): + """Test EndpointAgentSelectorConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_agent_to_server_test.py b/endpoint/test_results_api/test/test_endpoint_agent_to_server_test.py new file mode 100644 index 00000000..7b07f53a --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_agent_to_server_test.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest + +class TestEndpointAgentToServerTest(unittest.TestCase): + """EndpointAgentToServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentToServerTest: + """Test EndpointAgentToServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentToServerTest` + """ + model = EndpointAgentToServerTest() + if include_optional: + return EndpointAgentToServerTest( + links = test_results_api.models.endpoint_test_links.EndpointTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}], ), + agent_selector_config = test_results_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = None, + test_name = 'Test name', + type = 'agent-to-server' + ) + else: + return EndpointAgentToServerTest( + ) + """ + + def testEndpointAgentToServerTest(self): + """Test EndpointAgentToServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_agent_to_server_type.py b/endpoint/test_results_api/test/test_endpoint_agent_to_server_type.py new file mode 100644 index 00000000..d6bde791 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_agent_to_server_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_agent_to_server_type import EndpointAgentToServerType + +class TestEndpointAgentToServerType(unittest.TestCase): + """EndpointAgentToServerType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointAgentToServerType(self): + """Test EndpointAgentToServerType""" + # inst = EndpointAgentToServerType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_all_agents_selector_config.py b/endpoint/test_results_api/test/test_endpoint_all_agents_selector_config.py new file mode 100644 index 00000000..8454fdd8 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_all_agents_selector_config.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig + +class TestEndpointAllAgentsSelectorConfig(unittest.TestCase): + """EndpointAllAgentsSelectorConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAllAgentsSelectorConfig: + """Test EndpointAllAgentsSelectorConfig + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAllAgentsSelectorConfig` + """ + model = EndpointAllAgentsSelectorConfig() + if include_optional: + return EndpointAllAgentsSelectorConfig( + agent_selector_type = 'all-agents', + max_machines = 10 + ) + else: + return EndpointAllAgentsSelectorConfig( + ) + """ + + def testEndpointAllAgentsSelectorConfig(self): + """Test EndpointAllAgentsSelectorConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_browser.py b/endpoint/test_results_api/test/test_endpoint_browser.py new file mode 100644 index 00000000..c590a455 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_browser.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_browser import EndpointBrowser + +class TestEndpointBrowser(unittest.TestCase): + """EndpointBrowser unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointBrowser: + """Test EndpointBrowser + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointBrowser` + """ + model = EndpointBrowser() + if include_optional: + return EndpointBrowser( + name = 'Google Chrome', + version = '116.0.0.0' + ) + else: + return EndpointBrowser( + ) + """ + + def testEndpointBrowser(self): + """Test EndpointBrowser""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_http_data_point_score.py b/endpoint/test_results_api/test/test_endpoint_http_data_point_score.py new file mode 100644 index 00000000..03bfb0d7 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_http_data_point_score.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_http_data_point_score import EndpointHttpDataPointScore + +class TestEndpointHttpDataPointScore(unittest.TestCase): + """EndpointHttpDataPointScore unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointHttpDataPointScore: + """Test EndpointHttpDataPointScore + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointHttpDataPointScore` + """ + model = EndpointHttpDataPointScore() + if include_optional: + return EndpointHttpDataPointScore( + application_score = 1.337, + quality = 'great' + ) + else: + return EndpointHttpDataPointScore( + ) + """ + + def testEndpointHttpDataPointScore(self): + """Test EndpointHttpDataPointScore""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_http_server_base_test.py b/endpoint/test_results_api/test/test_endpoint_http_server_base_test.py new file mode 100644 index 00000000..0e2342b5 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_http_server_base_test.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_http_server_base_test import EndpointHttpServerBaseTest + +class TestEndpointHttpServerBaseTest(unittest.TestCase): + """EndpointHttpServerBaseTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointHttpServerBaseTest: + """Test EndpointHttpServerBaseTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointHttpServerBaseTest` + """ + model = EndpointHttpServerBaseTest() + if include_optional: + return EndpointHttpServerBaseTest( + auth_type = 'none', + has_path_trace_in_session = True, + http_time_limit = 5000, + protocol = 'icmp', + url = 'www.example.com', + username = 'username', + ssl_version_id = '0', + tcp_probe_mode = 'auto', + verify_certificate = False + ) + else: + return EndpointHttpServerBaseTest( + ) + """ + + def testEndpointHttpServerBaseTest(self): + """Test EndpointHttpServerBaseTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_http_server_test.py b/endpoint/test_results_api/test/test_endpoint_http_server_test.py new file mode 100644 index 00000000..6429acfc --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_http_server_test.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_http_server_test import EndpointHttpServerTest + +class TestEndpointHttpServerTest(unittest.TestCase): + """EndpointHttpServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointHttpServerTest: + """Test EndpointHttpServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointHttpServerTest` + """ + model = EndpointHttpServerTest() + if include_optional: + return EndpointHttpServerTest( + links = test_results_api.models.endpoint_test_links.EndpointTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}], ), + agent_selector_config = test_results_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = None, + test_name = 'Test name', + type = 'http-server', + auth_type = 'none', + http_time_limit = 5000, + url = 'www.example.com', + username = 'username', + ssl_version_id = '0', + tcp_probe_mode = 'auto', + verify_certificate = False, + content_regex = '(regex)+', + follow_redirects = True, + http_target_time = 100, + http_version = 1, + post_body = 'body', + ssl_version = 'Auto', + use_ntlm = False, + user_agent = 'curl' + ) + else: + return EndpointHttpServerTest( + ) + """ + + def testEndpointHttpServerTest(self): + """Test EndpointHttpServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_http_server_type.py b/endpoint/test_results_api/test/test_endpoint_http_server_type.py new file mode 100644 index 00000000..4856acaf --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_http_server_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_http_server_type import EndpointHttpServerType + +class TestEndpointHttpServerType(unittest.TestCase): + """EndpointHttpServerType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointHttpServerType(self): + """Test EndpointHttpServerType""" + # inst = EndpointHttpServerType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_network_topology_result_request_filter.py b/endpoint/test_results_api/test/test_endpoint_network_topology_result_request_filter.py new file mode 100644 index 00000000..2fb39291 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_network_topology_result_request_filter.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_network_topology_result_request_filter import EndpointNetworkTopologyResultRequestFilter + +class TestEndpointNetworkTopologyResultRequestFilter(unittest.TestCase): + """EndpointNetworkTopologyResultRequestFilter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointNetworkTopologyResultRequestFilter: + """Test EndpointNetworkTopologyResultRequestFilter + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointNetworkTopologyResultRequestFilter` + """ + model = EndpointNetworkTopologyResultRequestFilter() + if include_optional: + return EndpointNetworkTopologyResultRequestFilter( + location = [San Francisco Bay Area, Germany], + connection = [ + 'wireless' + ], + platform = [ + 'mac' + ], + gateway = [78.153.54.204, 78.153.54.206], + proxy_target = [78.153.54.204, 78.153.54.206], + vpn_target = [78.153.54.204, 78.153.54.206], + agent_id = [3fde6422-f119-40e1-ae32-d08a1243c038, 236e6f18-9637-4a2f-b15f-7aa6a29c9fce], + network_id = [660b34109d12, 660b34109d15], + ssid = [wifi-name, other-room-wifi], + bssid = [8c:68:c8:a5:0a:8c, 0c:51:01:e4:3e:d0], + type = ["vpn","proxy"] + ) + else: + return EndpointNetworkTopologyResultRequestFilter( + ) + """ + + def testEndpointNetworkTopologyResultRequestFilter(self): + """Test EndpointNetworkTopologyResultRequestFilter""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_ping_data_point_score.py b/endpoint/test_results_api/test/test_endpoint_ping_data_point_score.py new file mode 100644 index 00000000..04f246c9 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_ping_data_point_score.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_ping_data_point_score import EndpointPingDataPointScore + +class TestEndpointPingDataPointScore(unittest.TestCase): + """EndpointPingDataPointScore unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointPingDataPointScore: + """Test EndpointPingDataPointScore + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointPingDataPointScore` + """ + model = EndpointPingDataPointScore() + if include_optional: + return EndpointPingDataPointScore( + application_score = 1.337, + quality = 'great' + ) + else: + return EndpointPingDataPointScore( + ) + """ + + def testEndpointPingDataPointScore(self): + """Test EndpointPingDataPointScore""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_real_user_test.py b/endpoint/test_results_api/test/test_endpoint_real_user_test.py new file mode 100644 index 00000000..cd0c3d94 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_real_user_test.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_real_user_test import EndpointRealUserTest + +class TestEndpointRealUserTest(unittest.TestCase): + """EndpointRealUserTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointRealUserTest: + """Test EndpointRealUserTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointRealUserTest` + """ + model = EndpointRealUserTest() + if include_optional: + return EndpointRealUserTest( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + committed = '2022-07-17T22:00:54Z', + var_date = '2022-07-17T22:00:54Z', + experience_score = 0.5, + number_of_pages = 2, + organization_name = 'T-2 Access Network', + port = 443, + protocol = 'https', + round_id = 1384309800, + source_address = '84.255.241.1', + id = '07625:1490529480:aVDViw0i', + visited_site = 'www.thousandeyes.com', + page_id = 'C31gBrYJ' + ) + else: + return EndpointRealUserTest( + ) + """ + + def testEndpointRealUserTest(self): + """Test EndpointRealUserTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_real_user_test_base.py b/endpoint/test_results_api/test/test_endpoint_real_user_test_base.py new file mode 100644 index 00000000..7b599221 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_real_user_test_base.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_real_user_test_base import EndpointRealUserTestBase + +class TestEndpointRealUserTestBase(unittest.TestCase): + """EndpointRealUserTestBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointRealUserTestBase: + """Test EndpointRealUserTestBase + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointRealUserTestBase` + """ + model = EndpointRealUserTestBase() + if include_optional: + return EndpointRealUserTestBase( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + committed = '2022-07-17T22:00:54Z', + var_date = '2022-07-17T22:00:54Z', + experience_score = 0.5, + number_of_pages = 2, + organization_name = 'T-2 Access Network', + port = 443, + protocol = 'https', + round_id = 1384309800, + source_address = '84.255.241.1', + id = '07625:1490529480:aVDViw0i', + visited_site = 'www.thousandeyes.com' + ) + else: + return EndpointRealUserTestBase( + ) + """ + + def testEndpointRealUserTestBase(self): + """Test EndpointRealUserTestBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_real_user_test_detail.py b/endpoint/test_results_api/test/test_endpoint_real_user_test_detail.py new file mode 100644 index 00000000..830a878a --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_real_user_test_detail.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_real_user_test_detail import EndpointRealUserTestDetail + +class TestEndpointRealUserTestDetail(unittest.TestCase): + """EndpointRealUserTestDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointRealUserTestDetail: + """Test EndpointRealUserTestDetail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointRealUserTestDetail` + """ + model = EndpointRealUserTestDetail() + if include_optional: + return EndpointRealUserTestDetail( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + committed = '2022-07-17T22:00:54Z', + var_date = '2022-07-17T22:00:54Z', + experience_score = 0.5, + number_of_pages = 2, + organization_name = 'T-2 Access Network', + port = 443, + protocol = 'https', + round_id = 1384309800, + source_address = '84.255.241.1', + id = '07625:1490529480:aVDViw0i', + visited_site = 'www.thousandeyes.com', + browser = test_results_api.models.endpoint_browser.EndpointBrowser( + name = 'Google Chrome', + version = '116.0.0.0', ), + coordinates = test_results_api.models.real_user_test_coordinates.RealUserTestCoordinates( + latitude = 46.0552778, + location = 'Slovenia', + longitude = 14.5144444, ), + pages = [ + test_results_api.models.real_user_test_page.RealUserTestPage( + page_id = 'C31gBrYJ', + page_title = 'Network Performance Resources | ThousandEyes', + page_url = 'https://app.thousandeyes.com/settings/integrations', + load_date = '2022-07-17T22:00:54Z', + response_code = 200, + page_timings = test_results_api.models.real_user_test_page_page_timings.RealUserTestPage_pageTimings( + on_content_load = 1483, + on_load = 4569, ), ) + ], + network = test_results_api.models.real_user_test_network.RealUserTestNetwork( + network_profile = null, + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), + gateway_ping = null, + ping = null, + traceroute = null, + connect_rtt = 77.777, + is_icmp_blocked = True, + errors = ["ping: Request timed out before getting response"], + vpn_ping = null, + vpn_traceroute = null, ) + ) + else: + return EndpointRealUserTestDetail( + ) + """ + + def testEndpointRealUserTestDetail(self): + """Test EndpointRealUserTestDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_real_user_test_detail_results.py b/endpoint/test_results_api/test/test_endpoint_real_user_test_detail_results.py new file mode 100644 index 00000000..33b597b4 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_real_user_test_detail_results.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_real_user_test_detail_results import EndpointRealUserTestDetailResults + +class TestEndpointRealUserTestDetailResults(unittest.TestCase): + """EndpointRealUserTestDetailResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointRealUserTestDetailResults: + """Test EndpointRealUserTestDetailResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointRealUserTestDetailResults` + """ + model = EndpointRealUserTestDetailResults() + if include_optional: + return EndpointRealUserTestDetailResults( + results = [ + null + ] + ) + else: + return EndpointRealUserTestDetailResults( + ) + """ + + def testEndpointRealUserTestDetailResults(self): + """Test EndpointRealUserTestDetailResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_real_user_test_result_request_filter.py b/endpoint/test_results_api/test/test_endpoint_real_user_test_result_request_filter.py new file mode 100644 index 00000000..c9310f12 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_real_user_test_result_request_filter.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_real_user_test_result_request_filter import EndpointRealUserTestResultRequestFilter + +class TestEndpointRealUserTestResultRequestFilter(unittest.TestCase): + """EndpointRealUserTestResultRequestFilter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointRealUserTestResultRequestFilter: + """Test EndpointRealUserTestResultRequestFilter + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointRealUserTestResultRequestFilter` + """ + model = EndpointRealUserTestResultRequestFilter() + if include_optional: + return EndpointRealUserTestResultRequestFilter( + location = [San Francisco Bay Area, Germany], + connection = [ + 'wireless' + ], + platform = [ + 'mac' + ], + gateway = [78.153.54.204, 78.153.54.206], + proxy_target = [78.153.54.204, 78.153.54.206], + vpn_target = [78.153.54.204, 78.153.54.206], + agent_id = [3fde6422-f119-40e1-ae32-d08a1243c038, 236e6f18-9637-4a2f-b15f-7aa6a29c9fce], + network_id = [660b34109d12, 660b34109d15], + ssid = [wifi-name, other-room-wifi], + bssid = [8c:68:c8:a5:0a:8c, 0c:51:01:e4:3e:d0], + destination_ip = ["84.255.241.1","193.2.1.88"], + domain = ["thousandeyes.com"], + trigger = ["user"], + visited_site = ["app.thousandeyes.com"] + ) + else: + return EndpointRealUserTestResultRequestFilter( + ) + """ + + def testEndpointRealUserTestResultRequestFilter(self): + """Test EndpointRealUserTestResultRequestFilter""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_real_user_test_results.py b/endpoint/test_results_api/test/test_endpoint_real_user_test_results.py new file mode 100644 index 00000000..3a16480b --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_real_user_test_results.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_real_user_test_results import EndpointRealUserTestResults + +class TestEndpointRealUserTestResults(unittest.TestCase): + """EndpointRealUserTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointRealUserTestResults: + """Test EndpointRealUserTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointRealUserTestResults` + """ + model = EndpointRealUserTestResults() + if include_optional: + return EndpointRealUserTestResults( + results = [ + null + ] + ) + else: + return EndpointRealUserTestResults( + ) + """ + + def testEndpointRealUserTestResults(self): + """Test EndpointRealUserTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_result_request_filter.py b/endpoint/test_results_api/test/test_endpoint_result_request_filter.py new file mode 100644 index 00000000..47c5d608 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_result_request_filter.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_result_request_filter import EndpointResultRequestFilter + +class TestEndpointResultRequestFilter(unittest.TestCase): + """EndpointResultRequestFilter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointResultRequestFilter: + """Test EndpointResultRequestFilter + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointResultRequestFilter` + """ + model = EndpointResultRequestFilter() + if include_optional: + return EndpointResultRequestFilter( + location = ["San Francisco Bay Area","Germany"], + connection = [ + 'wireless' + ], + platform = [ + 'mac' + ], + gateway = ["78.153.54.204","78.153.54.206"], + proxy_target = ["78.153.54.204","78.153.54.206"], + vpn_target = ["78.153.54.204","78.153.54.206"], + agent_id = ["3fde6422-f119-40e1-ae32-d08a1243c038","236e6f18-9637-4a2f-b15f-7aa6a29c9fce"], + network_id = ["660b34109d12","660b34109d15"], + ssid = ["wifi-name","other-room-wifi"], + bssid = ["8c:68:c8:a5:0a:8c","0c:51:01:e4:3e:d0"] + ) + else: + return EndpointResultRequestFilter( + ) + """ + + def testEndpointResultRequestFilter(self): + """Test EndpointResultRequestFilter""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_scheduled_test.py b/endpoint/test_results_api/test/test_endpoint_scheduled_test.py new file mode 100644 index 00000000..df58c843 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_scheduled_test.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_scheduled_test import EndpointScheduledTest + +class TestEndpointScheduledTest(unittest.TestCase): + """EndpointScheduledTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointScheduledTest: + """Test EndpointScheduledTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointScheduledTest` + """ + model = EndpointScheduledTest() + if include_optional: + return EndpointScheduledTest( + links = test_results_api.models.endpoint_test_links.EndpointTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}], ), + agent_selector_config = test_results_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = None, + test_name = 'Test name', + type = 'http-server', + auth_type = 'none', + http_time_limit = 5000, + url = 'www.example.com', + username = 'username', + ssl_version_id = '0', + tcp_probe_mode = 'auto', + verify_certificate = False, + content_regex = '(regex)+', + follow_redirects = True, + http_target_time = 100, + http_version = 1, + post_body = 'body', + ssl_version = 'Auto', + use_ntlm = False, + user_agent = 'curl' + ) + else: + return EndpointScheduledTest( + ) + """ + + def testEndpointScheduledTest(self): + """Test EndpointScheduledTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_scheduled_test_type.py b/endpoint/test_results_api/test/test_endpoint_scheduled_test_type.py new file mode 100644 index 00000000..88f907de --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_scheduled_test_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_scheduled_test_type import EndpointScheduledTestType + +class TestEndpointScheduledTestType(unittest.TestCase): + """EndpointScheduledTestType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointScheduledTestType(self): + """Test EndpointScheduledTestType""" + # inst = EndpointScheduledTestType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_specific_agents_selector_config.py b/endpoint/test_results_api/test/test_endpoint_specific_agents_selector_config.py new file mode 100644 index 00000000..e7d1bbc1 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_specific_agents_selector_config.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig + +class TestEndpointSpecificAgentsSelectorConfig(unittest.TestCase): + """EndpointSpecificAgentsSelectorConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointSpecificAgentsSelectorConfig: + """Test EndpointSpecificAgentsSelectorConfig + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointSpecificAgentsSelectorConfig` + """ + model = EndpointSpecificAgentsSelectorConfig() + if include_optional: + return EndpointSpecificAgentsSelectorConfig( + agent_selector_type = 'specific-agents', + max_machines = 10, + agents = ["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"] + ) + else: + return EndpointSpecificAgentsSelectorConfig( + ) + """ + + def testEndpointSpecificAgentsSelectorConfig(self): + """Test EndpointSpecificAgentsSelectorConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_test.py b/endpoint/test_results_api/test/test_endpoint_test.py new file mode 100644 index 00000000..4a763808 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_test.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_test import EndpointTest + +class TestEndpointTest(unittest.TestCase): + """EndpointTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTest: + """Test EndpointTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTest` + """ + model = EndpointTest() + if include_optional: + return EndpointTest( + links = test_results_api.models.endpoint_test_links.EndpointTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}], ), + agent_selector_config = test_results_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = None, + test_name = 'Test name', + type = 'agent-to-server' + ) + else: + return EndpointTest( + ) + """ + + def testEndpointTest(self): + """Test EndpointTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_test_aid.py b/endpoint/test_results_api/test/test_endpoint_test_aid.py new file mode 100644 index 00000000..069d3ed5 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_test_aid.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_test_aid import EndpointTestAid + +class TestEndpointTestAid(unittest.TestCase): + """EndpointTestAid unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTestAid: + """Test EndpointTestAid + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTestAid` + """ + model = EndpointTestAid() + if include_optional: + return EndpointTestAid( + aid = '11' + ) + else: + return EndpointTestAid( + ) + """ + + def testEndpointTestAid(self): + """Test EndpointTestAid""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_test_auth_type.py b/endpoint/test_results_api/test/test_endpoint_test_auth_type.py new file mode 100644 index 00000000..df6e6f85 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_test_auth_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_test_auth_type import EndpointTestAuthType + +class TestEndpointTestAuthType(unittest.TestCase): + """EndpointTestAuthType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointTestAuthType(self): + """Test EndpointTestAuthType""" + # inst = EndpointTestAuthType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_test_links.py b/endpoint/test_results_api/test/test_endpoint_test_links.py new file mode 100644 index 00000000..d6b6a196 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_test_links.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_test_links import EndpointTestLinks + +class TestEndpointTestLinks(unittest.TestCase): + """EndpointTestLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTestLinks: + """Test EndpointTestLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTestLinks` + """ + model = EndpointTestLinks() + if include_optional: + return EndpointTestLinks( + var_self = None, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}] + ) + else: + return EndpointTestLinks( + ) + """ + + def testEndpointTestLinks(self): + """Test EndpointTestLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_test_links_self.py b/endpoint/test_results_api/test/test_endpoint_test_links_self.py new file mode 100644 index 00000000..2112ebba --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_test_links_self.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_test_links_self import EndpointTestLinksSelf + +class TestEndpointTestLinksSelf(unittest.TestCase): + """EndpointTestLinksSelf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTestLinksSelf: + """Test EndpointTestLinksSelf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTestLinksSelf` + """ + model = EndpointTestLinksSelf() + if include_optional: + return EndpointTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return EndpointTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testEndpointTestLinksSelf(self): + """Test EndpointTestLinksSelf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_test_links_test_results.py b/endpoint/test_results_api/test/test_endpoint_test_links_test_results.py new file mode 100644 index 00000000..0625bbeb --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_test_links_test_results.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults + +class TestEndpointTestLinksTestResults(unittest.TestCase): + """EndpointTestLinksTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTestLinksTestResults: + """Test EndpointTestLinksTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTestLinksTestResults` + """ + model = EndpointTestLinksTestResults() + if include_optional: + return EndpointTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return EndpointTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testEndpointTestLinksTestResults(self): + """Test EndpointTestLinksTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_endpoint_test_protocol.py b/endpoint/test_results_api/test/test_endpoint_test_protocol.py new file mode 100644 index 00000000..db600fb6 --- /dev/null +++ b/endpoint/test_results_api/test/test_endpoint_test_protocol.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.endpoint_test_protocol import EndpointTestProtocol + +class TestEndpointTestProtocol(unittest.TestCase): + """EndpointTestProtocol unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointTestProtocol(self): + """Test EndpointTestProtocol""" + # inst = EndpointTestProtocol() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_error.py b/endpoint/test_results_api/test/test_error.py new file mode 100644 index 00000000..3b873358 --- /dev/null +++ b/endpoint/test_results_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_ethernet_profile.py b/endpoint/test_results_api/test/test_ethernet_profile.py new file mode 100644 index 00000000..85416c8f --- /dev/null +++ b/endpoint/test_results_api/test/test_ethernet_profile.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.ethernet_profile import EthernetProfile + +class TestEthernetProfile(unittest.TestCase): + """EthernetProfile unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EthernetProfile: + """Test EthernetProfile + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EthernetProfile` + """ + model = EthernetProfile() + if include_optional: + return EthernetProfile( + link_speed = 860 + ) + else: + return EthernetProfile( + ) + """ + + def testEthernetProfile(self): + """Test EthernetProfile""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_expand.py b/endpoint/test_results_api/test/test_expand.py new file mode 100644 index 00000000..7771c00b --- /dev/null +++ b/endpoint/test_results_api/test/test_expand.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.expand import Expand + +class TestExpand(unittest.TestCase): + """Expand unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testExpand(self): + """Test Expand""" + # inst = Expand() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_dynamic_test_result_network_pathvis200_response.py b/endpoint/test_results_api/test/test_get_dynamic_test_result_network_pathvis200_response.py new file mode 100644 index 00000000..ef2c2fe9 --- /dev/null +++ b/endpoint/test_results_api/test/test_get_dynamic_test_result_network_pathvis200_response.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_dynamic_test_result_network_pathvis200_response import GetDynamicTestResultNetworkPathvis200Response + +class TestGetDynamicTestResultNetworkPathvis200Response(unittest.TestCase): + """GetDynamicTestResultNetworkPathvis200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDynamicTestResultNetworkPathvis200Response: + """Test GetDynamicTestResultNetworkPathvis200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetDynamicTestResultNetworkPathvis200Response` + """ + model = GetDynamicTestResultNetworkPathvis200Response() + if include_optional: + return GetDynamicTestResultNetworkPathvis200Response( + results = [ + null + ], + test = test_results_api.models.dynamic_test.DynamicTest( + _links = test_results_api.models.dynamic_test_links.DynamicTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}], ), + agent_selector_config = test_results_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + application = 'webex', + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + has_path_trace_in_session = null, + has_ping = True, + has_traceroute = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = null, + protocol = 'icmp', + tcp_probe_mode = null, + test_id = '281474976710706', + aid = null, + test_name = 'Test name', ), + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetDynamicTestResultNetworkPathvis200Response( + ) + """ + + def testGetDynamicTestResultNetworkPathvis200Response(self): + """Test GetDynamicTestResultNetworkPathvis200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_dynamic_test_result_pathvis_agent_round200_response.py b/endpoint/test_results_api/test/test_get_dynamic_test_result_pathvis_agent_round200_response.py new file mode 100644 index 00000000..1954106e --- /dev/null +++ b/endpoint/test_results_api/test/test_get_dynamic_test_result_pathvis_agent_round200_response.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_dynamic_test_result_pathvis_agent_round200_response import GetDynamicTestResultPathvisAgentRound200Response + +class TestGetDynamicTestResultPathvisAgentRound200Response(unittest.TestCase): + """GetDynamicTestResultPathvisAgentRound200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDynamicTestResultPathvisAgentRound200Response: + """Test GetDynamicTestResultPathvisAgentRound200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetDynamicTestResultPathvisAgentRound200Response` + """ + model = GetDynamicTestResultPathvisAgentRound200Response() + if include_optional: + return GetDynamicTestResultPathvisAgentRound200Response( + results = [ + null + ], + test = test_results_api.models.dynamic_test.DynamicTest( + _links = test_results_api.models.dynamic_test_links.DynamicTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}], ), + agent_selector_config = test_results_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + application = 'webex', + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + has_path_trace_in_session = null, + has_ping = True, + has_traceroute = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = null, + protocol = 'icmp', + tcp_probe_mode = null, + test_id = '281474976710706', + aid = null, + test_name = 'Test name', ), + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetDynamicTestResultPathvisAgentRound200Response( + ) + """ + + def testGetDynamicTestResultPathvisAgentRound200Response(self): + """Test GetDynamicTestResultPathvisAgentRound200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_endpoint_local_network_topology_details200_response.py b/endpoint/test_results_api/test/test_get_endpoint_local_network_topology_details200_response.py new file mode 100644 index 00000000..f050c438 --- /dev/null +++ b/endpoint/test_results_api/test/test_get_endpoint_local_network_topology_details200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_endpoint_local_network_topology_details200_response import GetEndpointLocalNetworkTopologyDetails200Response + +class TestGetEndpointLocalNetworkTopologyDetails200Response(unittest.TestCase): + """GetEndpointLocalNetworkTopologyDetails200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointLocalNetworkTopologyDetails200Response: + """Test GetEndpointLocalNetworkTopologyDetails200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointLocalNetworkTopologyDetails200Response` + """ + model = GetEndpointLocalNetworkTopologyDetails200Response() + if include_optional: + return GetEndpointLocalNetworkTopologyDetails200Response( + results = [ + null + ], + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetEndpointLocalNetworkTopologyDetails200Response( + ) + """ + + def testGetEndpointLocalNetworkTopologyDetails200Response(self): + """Test GetEndpointLocalNetworkTopologyDetails200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_endpoint_local_networks200_response.py b/endpoint/test_results_api/test/test_get_endpoint_local_networks200_response.py new file mode 100644 index 00000000..a7c35201 --- /dev/null +++ b/endpoint/test_results_api/test/test_get_endpoint_local_networks200_response.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_endpoint_local_networks200_response import GetEndpointLocalNetworks200Response + +class TestGetEndpointLocalNetworks200Response(unittest.TestCase): + """GetEndpointLocalNetworks200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointLocalNetworks200Response: + """Test GetEndpointLocalNetworks200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointLocalNetworks200Response` + """ + model = GetEndpointLocalNetworks200Response() + if include_optional: + return GetEndpointLocalNetworks200Response( + local_networks = [ + test_results_api.models.local_network_result.LocalNetworkResult( + network_id = '006c4fa7a054', + network_name = '10.5.51.0 (in 178.216.56.0/21)', + local_prefix = '10.5.51.0', + public_ip_range = '178.216.56.0-178.216.63.255', ) + ], + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetEndpointLocalNetworks200Response( + ) + """ + + def testGetEndpointLocalNetworks200Response(self): + """Test GetEndpointLocalNetworks200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_endpoint_local_networks_topologies200_response.py b/endpoint/test_results_api/test/test_get_endpoint_local_networks_topologies200_response.py new file mode 100644 index 00000000..dc1c949c --- /dev/null +++ b/endpoint/test_results_api/test/test_get_endpoint_local_networks_topologies200_response.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_endpoint_local_networks_topologies200_response import GetEndpointLocalNetworksTopologies200Response + +class TestGetEndpointLocalNetworksTopologies200Response(unittest.TestCase): + """GetEndpointLocalNetworksTopologies200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointLocalNetworksTopologies200Response: + """Test GetEndpointLocalNetworksTopologies200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointLocalNetworksTopologies200Response` + """ + model = GetEndpointLocalNetworksTopologies200Response() + if include_optional: + return GetEndpointLocalNetworksTopologies200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + test_results_api.models.local_network_topology_result_base.LocalNetworkTopologyResultBase( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + date = '2022-07-17T22:00:54Z', + network_topology_id = '00160:54c3a4b180c6:1490536500:c7a58c49', + round_id = 1384309800, + target = '10.0.2.2', + target_port = 80, + type = null, + icmp_ping = test_results_api.models.network_ping.NetworkPing( + avg_rtt = 7, + max_rtt = 66, + mean_dev_rtt = 11, + min_rtt = 1, + pkts_received = 10, + pkts_sent = 10, + error = 'An operation timed out.', + info_flags = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], ), + is_icmp_blocked = True, + tcp_connect = test_results_api.models.tcp_connect.TcpConnect( + rtt = 77.777, + error_code = 'ERR_TIMED_OUT', + error = 'An operation timed out.', + info_flags = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], ), + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), ) + ], + links = test_results_api.models.pagination_next_link__links.PaginationNextLink__links( + next = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetEndpointLocalNetworksTopologies200Response( + ) + """ + + def testGetEndpointLocalNetworksTopologies200Response(self): + """Test GetEndpointLocalNetworksTopologies200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_endpoint_local_networks_topologies_request.py b/endpoint/test_results_api/test/test_get_endpoint_local_networks_topologies_request.py new file mode 100644 index 00000000..17bec529 --- /dev/null +++ b/endpoint/test_results_api/test/test_get_endpoint_local_networks_topologies_request.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_endpoint_local_networks_topologies_request import GetEndpointLocalNetworksTopologiesRequest + +class TestGetEndpointLocalNetworksTopologiesRequest(unittest.TestCase): + """GetEndpointLocalNetworksTopologiesRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointLocalNetworksTopologiesRequest: + """Test GetEndpointLocalNetworksTopologiesRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointLocalNetworksTopologiesRequest` + """ + model = GetEndpointLocalNetworksTopologiesRequest() + if include_optional: + return GetEndpointLocalNetworksTopologiesRequest( + search_filters = None + ) + else: + return GetEndpointLocalNetworksTopologiesRequest( + ) + """ + + def testGetEndpointLocalNetworksTopologiesRequest(self): + """Test GetEndpointLocalNetworksTopologiesRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_endpoint_real_user_test_details200_response.py b/endpoint/test_results_api/test/test_get_endpoint_real_user_test_details200_response.py new file mode 100644 index 00000000..7469b136 --- /dev/null +++ b/endpoint/test_results_api/test/test_get_endpoint_real_user_test_details200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_endpoint_real_user_test_details200_response import GetEndpointRealUserTestDetails200Response + +class TestGetEndpointRealUserTestDetails200Response(unittest.TestCase): + """GetEndpointRealUserTestDetails200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointRealUserTestDetails200Response: + """Test GetEndpointRealUserTestDetails200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointRealUserTestDetails200Response` + """ + model = GetEndpointRealUserTestDetails200Response() + if include_optional: + return GetEndpointRealUserTestDetails200Response( + results = [ + null + ], + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetEndpointRealUserTestDetails200Response( + ) + """ + + def testGetEndpointRealUserTestDetails200Response(self): + """Test GetEndpointRealUserTestDetails200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_endpoint_real_user_test_pages_details200_response.py b/endpoint/test_results_api/test/test_get_endpoint_real_user_test_pages_details200_response.py new file mode 100644 index 00000000..54d0b253 --- /dev/null +++ b/endpoint/test_results_api/test/test_get_endpoint_real_user_test_pages_details200_response.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_endpoint_real_user_test_pages_details200_response import GetEndpointRealUserTestPagesDetails200Response + +class TestGetEndpointRealUserTestPagesDetails200Response(unittest.TestCase): + """GetEndpointRealUserTestPagesDetails200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointRealUserTestPagesDetails200Response: + """Test GetEndpointRealUserTestPagesDetails200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointRealUserTestPagesDetails200Response` + """ + model = GetEndpointRealUserTestPagesDetails200Response() + if include_optional: + return GetEndpointRealUserTestPagesDetails200Response( + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetEndpointRealUserTestPagesDetails200Response( + ) + """ + + def testGetEndpointRealUserTestPagesDetails200Response(self): + """Test GetEndpointRealUserTestPagesDetails200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_endpoint_real_user_tests200_response.py b/endpoint/test_results_api/test/test_get_endpoint_real_user_tests200_response.py new file mode 100644 index 00000000..c0712eb7 --- /dev/null +++ b/endpoint/test_results_api/test/test_get_endpoint_real_user_tests200_response.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_endpoint_real_user_tests200_response import GetEndpointRealUserTests200Response + +class TestGetEndpointRealUserTests200Response(unittest.TestCase): + """GetEndpointRealUserTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointRealUserTests200Response: + """Test GetEndpointRealUserTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointRealUserTests200Response` + """ + model = GetEndpointRealUserTests200Response() + if include_optional: + return GetEndpointRealUserTests200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + null + ], + links = test_results_api.models.pagination_next_link__links.PaginationNextLink__links( + next = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetEndpointRealUserTests200Response( + ) + """ + + def testGetEndpointRealUserTests200Response(self): + """Test GetEndpointRealUserTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_endpoint_real_user_tests_network200_response.py b/endpoint/test_results_api/test/test_get_endpoint_real_user_tests_network200_response.py new file mode 100644 index 00000000..f28dde38 --- /dev/null +++ b/endpoint/test_results_api/test/test_get_endpoint_real_user_tests_network200_response.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_endpoint_real_user_tests_network200_response import GetEndpointRealUserTestsNetwork200Response + +class TestGetEndpointRealUserTestsNetwork200Response(unittest.TestCase): + """GetEndpointRealUserTestsNetwork200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointRealUserTestsNetwork200Response: + """Test GetEndpointRealUserTestsNetwork200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointRealUserTestsNetwork200Response` + """ + model = GetEndpointRealUserTestsNetwork200Response() + if include_optional: + return GetEndpointRealUserTestsNetwork200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + test_results_api.models.real_user_test_network_result.RealUserTestNetworkResult( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + date = '2022-07-17T22:00:54Z', + id = '07625:1490529480:aVDViw0i', + round_id = 1384309800, + destination = test_results_api.models.network_metrics.NetworkMetrics( + jitter = 46, + latency = 150, + loss = 0.1, + target = '54.208.6.220', ), + vpn = test_results_api.models.network_metrics.NetworkMetrics( + jitter = 46, + latency = 150, + loss = 0.1, + target = '54.208.6.220', ), + proxy = , + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), ) + ], + links = test_results_api.models.pagination_next_link__links.PaginationNextLink__links( + next = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetEndpointRealUserTestsNetwork200Response( + ) + """ + + def testGetEndpointRealUserTestsNetwork200Response(self): + """Test GetEndpointRealUserTestsNetwork200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_endpoint_real_user_tests_pages200_response.py b/endpoint/test_results_api/test/test_get_endpoint_real_user_tests_pages200_response.py new file mode 100644 index 00000000..a2f53641 --- /dev/null +++ b/endpoint/test_results_api/test/test_get_endpoint_real_user_tests_pages200_response.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_endpoint_real_user_tests_pages200_response import GetEndpointRealUserTestsPages200Response + +class TestGetEndpointRealUserTestsPages200Response(unittest.TestCase): + """GetEndpointRealUserTestsPages200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointRealUserTestsPages200Response: + """Test GetEndpointRealUserTestsPages200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointRealUserTestsPages200Response` + """ + model = GetEndpointRealUserTestsPages200Response() + if include_optional: + return GetEndpointRealUserTestsPages200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + null + ], + links = test_results_api.models.pagination_next_link__links.PaginationNextLink__links( + next = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetEndpointRealUserTestsPages200Response( + ) + """ + + def testGetEndpointRealUserTestsPages200Response(self): + """Test GetEndpointRealUserTestsPages200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_endpoint_real_user_tests_request.py b/endpoint/test_results_api/test/test_get_endpoint_real_user_tests_request.py new file mode 100644 index 00000000..e6dffaa5 --- /dev/null +++ b/endpoint/test_results_api/test/test_get_endpoint_real_user_tests_request.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_endpoint_real_user_tests_request import GetEndpointRealUserTestsRequest + +class TestGetEndpointRealUserTestsRequest(unittest.TestCase): + """GetEndpointRealUserTestsRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointRealUserTestsRequest: + """Test GetEndpointRealUserTestsRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointRealUserTestsRequest` + """ + model = GetEndpointRealUserTestsRequest() + if include_optional: + return GetEndpointRealUserTestsRequest( + search_filters = None + ) + else: + return GetEndpointRealUserTestsRequest( + ) + """ + + def testGetEndpointRealUserTestsRequest(self): + """Test GetEndpointRealUserTestsRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_test_result_http_server200_response.py b/endpoint/test_results_api/test/test_get_test_result_http_server200_response.py new file mode 100644 index 00000000..41633a00 --- /dev/null +++ b/endpoint/test_results_api/test/test_get_test_result_http_server200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_test_result_http_server200_response import GetTestResultHttpServer200Response + +class TestGetTestResultHttpServer200Response(unittest.TestCase): + """GetTestResultHttpServer200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultHttpServer200Response: + """Test GetTestResultHttpServer200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultHttpServer200Response` + """ + model = GetTestResultHttpServer200Response() + if include_optional: + return GetTestResultHttpServer200Response( + results = [ + null + ], + test = None, + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + links = test_results_api.models.pagination_next_link__links.PaginationNextLink__links( + next = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultHttpServer200Response( + ) + """ + + def testGetTestResultHttpServer200Response(self): + """Test GetTestResultHttpServer200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_test_result_network_pathvis200_response.py b/endpoint/test_results_api/test/test_get_test_result_network_pathvis200_response.py new file mode 100644 index 00000000..b97829ca --- /dev/null +++ b/endpoint/test_results_api/test/test_get_test_result_network_pathvis200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_test_result_network_pathvis200_response import GetTestResultNetworkPathvis200Response + +class TestGetTestResultNetworkPathvis200Response(unittest.TestCase): + """GetTestResultNetworkPathvis200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultNetworkPathvis200Response: + """Test GetTestResultNetworkPathvis200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultNetworkPathvis200Response` + """ + model = GetTestResultNetworkPathvis200Response() + if include_optional: + return GetTestResultNetworkPathvis200Response( + results = [ + null + ], + test = None, + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultNetworkPathvis200Response( + ) + """ + + def testGetTestResultNetworkPathvis200Response(self): + """Test GetTestResultNetworkPathvis200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_get_test_result_pathvis_agent_round200_response.py b/endpoint/test_results_api/test/test_get_test_result_pathvis_agent_round200_response.py new file mode 100644 index 00000000..77ffde25 --- /dev/null +++ b/endpoint/test_results_api/test/test_get_test_result_pathvis_agent_round200_response.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.get_test_result_pathvis_agent_round200_response import GetTestResultPathvisAgentRound200Response + +class TestGetTestResultPathvisAgentRound200Response(unittest.TestCase): + """GetTestResultPathvisAgentRound200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultPathvisAgentRound200Response: + """Test GetTestResultPathvisAgentRound200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultPathvisAgentRound200Response` + """ + model = GetTestResultPathvisAgentRound200Response() + if include_optional: + return GetTestResultPathvisAgentRound200Response( + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultPathvisAgentRound200Response( + ) + """ + + def testGetTestResultPathvisAgentRound200Response(self): + """Test GetTestResultPathvisAgentRound200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_hop.py b/endpoint/test_results_api/test/test_hop.py new file mode 100644 index 00000000..e534fb7d --- /dev/null +++ b/endpoint/test_results_api/test/test_hop.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.hop import Hop + +class TestHop(unittest.TestCase): + """Hop unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Hop: + """Test Hop + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Hop` + """ + model = Hop() + if include_optional: + return Hop( + hop = 1, + ip_address = '196.40.106.237', + prefix = '196.40.96.0/20' + ) + else: + return Hop( + ) + """ + + def testHop(self): + """Test Hop""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_http_error_type.py b/endpoint/test_results_api/test/test_http_error_type.py new file mode 100644 index 00000000..50ee939d --- /dev/null +++ b/endpoint/test_results_api/test/test_http_error_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.http_error_type import HttpErrorType + +class TestHttpErrorType(unittest.TestCase): + """HttpErrorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHttpErrorType(self): + """Test HttpErrorType""" + # inst = HttpErrorType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_http_test_result.py b/endpoint/test_results_api/test/test_http_test_result.py new file mode 100644 index 00000000..6ee20244 --- /dev/null +++ b/endpoint/test_results_api/test/test_http_test_result.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.http_test_result import HttpTestResult + +class TestHttpTestResult(unittest.TestCase): + """HttpTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HttpTestResult: + """Test HttpTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HttpTestResult` + """ + model = HttpTestResult() + if include_optional: + return HttpTestResult( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + aid = test_results_api.models.account_group_id.AccountGroupId( + aid = '11', ), + round_id = 1384309800, + server_ip = '193.2.1.88', + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), + vpn_profile = test_results_api.models.vpn_profile.VpnProfile( + vpn_client_addresses = ["184.81.113.85","13.129.91.62"], + vpn_client_network_range = [ + '9.88.37.27' + ], + vpn_gateway_address = '120.98.134.7', + vpn_type = 'cisco-anyconnect', ), + network_profile = None, + connect_time = 2, + dns_time = 0, + error_type = 'connect', + error_details = '', + headers = test_results_api.models.http_test_result_headers.HttpTestResultHeaders( + request_headers = 'GET / HTTP/1.1 +Host: www.thousandeyes.com +User-Agent: curl/7.58.0-DEV +Accept: */* +Accept-Encoding: deflate, gzip +X-ThousandEyes-Agent: yes +', + response_headers = 'HTTP/1.1 200 OK +Content-Type: text/html;charset=UTF-8 +Content-Length: 9993 +Connection: keep-alive +Date: Mon, 04 May 2020 16:13:00 GMT +Server: Apache +Content-Language: en-US +Content-Encoding: gzip +X-Frame-Options: sameorigin +Cache-Control: max-age=600, must-revalidate +Strict-Transport-Security: max-age=31536000 +X-Content-Type-Options: nosniff +X-XSS-Protection: 1; mode=block +Vary: Accept-Encoding +X-Cache: Hit from cloudfront +Via: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront) +X-Amz-Cf-Pop: SFO5-C3 +X-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA== +Age: 132 +', ), + num_redirects = 0, + receive_time = 1, + redirect_time = 10, + response_code = 200, + response_time = 14, + ssl_time = 9, + total_time = 15, + wait_time = 3, + wire_size = 9993 + ) + else: + return HttpTestResult( + ) + """ + + def testHttpTestResult(self): + """Test HttpTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_http_test_result_headers.py b/endpoint/test_results_api/test/test_http_test_result_headers.py new file mode 100644 index 00000000..de00355f --- /dev/null +++ b/endpoint/test_results_api/test/test_http_test_result_headers.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.http_test_result_headers import HttpTestResultHeaders + +class TestHttpTestResultHeaders(unittest.TestCase): + """HttpTestResultHeaders unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HttpTestResultHeaders: + """Test HttpTestResultHeaders + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HttpTestResultHeaders` + """ + model = HttpTestResultHeaders() + if include_optional: + return HttpTestResultHeaders( + request_headers = 'GET / HTTP/1.1 +Host: www.thousandeyes.com +User-Agent: curl/7.58.0-DEV +Accept: */* +Accept-Encoding: deflate, gzip +X-ThousandEyes-Agent: yes +', + response_headers = 'HTTP/1.1 200 OK +Content-Type: text/html;charset=UTF-8 +Content-Length: 9993 +Connection: keep-alive +Date: Mon, 04 May 2020 16:13:00 GMT +Server: Apache +Content-Language: en-US +Content-Encoding: gzip +X-Frame-Options: sameorigin +Cache-Control: max-age=600, must-revalidate +Strict-Transport-Security: max-age=31536000 +X-Content-Type-Options: nosniff +X-XSS-Protection: 1; mode=block +Vary: Accept-Encoding +X-Cache: Hit from cloudfront +Via: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront) +X-Amz-Cf-Pop: SFO5-C3 +X-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA== +Age: 132 +' + ) + else: + return HttpTestResultHeaders( + ) + """ + + def testHttpTestResultHeaders(self): + """Test HttpTestResultHeaders""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_http_test_results.py b/endpoint/test_results_api/test/test_http_test_results.py new file mode 100644 index 00000000..d559856a --- /dev/null +++ b/endpoint/test_results_api/test/test_http_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.http_test_results import HttpTestResults + +class TestHttpTestResults(unittest.TestCase): + """HttpTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HttpTestResults: + """Test HttpTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HttpTestResults` + """ + model = HttpTestResults() + if include_optional: + return HttpTestResults( + results = [ + null + ], + test = None + ) + else: + return HttpTestResults( + ) + """ + + def testHttpTestResults(self): + """Test HttpTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_interface_hardware_type.py b/endpoint/test_results_api/test/test_interface_hardware_type.py new file mode 100644 index 00000000..80dca8c8 --- /dev/null +++ b/endpoint/test_results_api/test/test_interface_hardware_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.interface_hardware_type import InterfaceHardwareType + +class TestInterfaceHardwareType(unittest.TestCase): + """InterfaceHardwareType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInterfaceHardwareType(self): + """Test InterfaceHardwareType""" + # inst = InterfaceHardwareType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_link.py b/endpoint/test_results_api/test/test_link.py new file mode 100644 index 00000000..28f1cd7a --- /dev/null +++ b/endpoint/test_results_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_local_network_result.py b/endpoint/test_results_api/test/test_local_network_result.py new file mode 100644 index 00000000..7e85db41 --- /dev/null +++ b/endpoint/test_results_api/test/test_local_network_result.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.local_network_result import LocalNetworkResult + +class TestLocalNetworkResult(unittest.TestCase): + """LocalNetworkResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LocalNetworkResult: + """Test LocalNetworkResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LocalNetworkResult` + """ + model = LocalNetworkResult() + if include_optional: + return LocalNetworkResult( + network_id = '006c4fa7a054', + network_name = '10.5.51.0 (in 178.216.56.0/21)', + local_prefix = '10.5.51.0', + public_ip_range = '178.216.56.0-178.216.63.255' + ) + else: + return LocalNetworkResult( + ) + """ + + def testLocalNetworkResult(self): + """Test LocalNetworkResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_local_network_results.py b/endpoint/test_results_api/test/test_local_network_results.py new file mode 100644 index 00000000..9d261efb --- /dev/null +++ b/endpoint/test_results_api/test/test_local_network_results.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.local_network_results import LocalNetworkResults + +class TestLocalNetworkResults(unittest.TestCase): + """LocalNetworkResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LocalNetworkResults: + """Test LocalNetworkResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LocalNetworkResults` + """ + model = LocalNetworkResults() + if include_optional: + return LocalNetworkResults( + local_networks = [ + test_results_api.models.local_network_result.LocalNetworkResult( + network_id = '006c4fa7a054', + network_name = '10.5.51.0 (in 178.216.56.0/21)', + local_prefix = '10.5.51.0', + public_ip_range = '178.216.56.0-178.216.63.255', ) + ] + ) + else: + return LocalNetworkResults( + ) + """ + + def testLocalNetworkResults(self): + """Test LocalNetworkResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_local_network_tests_results_api.py b/endpoint/test_results_api/test/test_local_network_tests_results_api.py new file mode 100644 index 00000000..8e5b4fab --- /dev/null +++ b/endpoint/test_results_api/test/test_local_network_tests_results_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest + +from test_results_api.api.local_network_tests_results_api import LocalNetworkTestsResultsApi + + +class TestLocalNetworkTestsResultsApi(unittest.TestCase): + """LocalNetworkTestsResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = LocalNetworkTestsResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_endpoint_local_network_topology_details(self) -> None: + """Test case for get_endpoint_local_network_topology_details + + Retrieve endpoint local network topology + """ + pass + + def test_get_endpoint_local_networks(self) -> None: + """Test case for get_endpoint_local_networks + + List local networks + """ + pass + + def test_get_endpoint_local_networks_topologies(self) -> None: + """Test case for get_endpoint_local_networks_topologies + + List endpoint network topologies probes + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_local_network_topology_detail_results.py b/endpoint/test_results_api/test/test_local_network_topology_detail_results.py new file mode 100644 index 00000000..7b6a78ec --- /dev/null +++ b/endpoint/test_results_api/test/test_local_network_topology_detail_results.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.local_network_topology_detail_results import LocalNetworkTopologyDetailResults + +class TestLocalNetworkTopologyDetailResults(unittest.TestCase): + """LocalNetworkTopologyDetailResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LocalNetworkTopologyDetailResults: + """Test LocalNetworkTopologyDetailResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LocalNetworkTopologyDetailResults` + """ + model = LocalNetworkTopologyDetailResults() + if include_optional: + return LocalNetworkTopologyDetailResults( + results = [ + null + ] + ) + else: + return LocalNetworkTopologyDetailResults( + ) + """ + + def testLocalNetworkTopologyDetailResults(self): + """Test LocalNetworkTopologyDetailResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_local_network_topology_result.py b/endpoint/test_results_api/test/test_local_network_topology_result.py new file mode 100644 index 00000000..247e92a3 --- /dev/null +++ b/endpoint/test_results_api/test/test_local_network_topology_result.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.local_network_topology_result import LocalNetworkTopologyResult + +class TestLocalNetworkTopologyResult(unittest.TestCase): + """LocalNetworkTopologyResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LocalNetworkTopologyResult: + """Test LocalNetworkTopologyResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LocalNetworkTopologyResult` + """ + model = LocalNetworkTopologyResult() + if include_optional: + return LocalNetworkTopologyResult( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + var_date = '2022-07-17T22:00:54Z', + network_topology_id = '00160:54c3a4b180c6:1490536500:c7a58c49', + round_id = 1384309800, + target = '10.0.2.2', + target_port = 80, + type = 'vpn', + icmp_ping = test_results_api.models.network_ping.NetworkPing( + avg_rtt = 7, + max_rtt = 66, + mean_dev_rtt = 11, + min_rtt = 1, + pkts_received = 10, + pkts_sent = 10, + error = 'An operation timed out.', + info_flags = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], ), + is_icmp_blocked = True, + tcp_connect = test_results_api.models.tcp_connect.TcpConnect( + rtt = 77.777, + error_code = 'ERR_TIMED_OUT', + error = 'An operation timed out.', + info_flags = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], ), + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), + coordinates = test_results_api.models.real_user_test_coordinates.RealUserTestCoordinates( + latitude = 46.0552778, + location = 'Slovenia', + longitude = 14.5144444, ), + network_profile = None, + icmp_traceroute = test_results_api.models.traceroute.Traceroute( + destination = '13.32.22.232', + error = 'An operation timed out.', + info_flags = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], + internal_errors = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], + hops = [ + null + ], ), + icmp_traceroutes = [ + test_results_api.models.traceroute.Traceroute( + destination = '13.32.22.232', + error = 'An operation timed out.', + info_flags = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], + internal_errors = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], + hops = [ + null + ], ) + ] + ) + else: + return LocalNetworkTopologyResult( + ) + """ + + def testLocalNetworkTopologyResult(self): + """Test LocalNetworkTopologyResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_local_network_topology_result_base.py b/endpoint/test_results_api/test/test_local_network_topology_result_base.py new file mode 100644 index 00000000..920eee63 --- /dev/null +++ b/endpoint/test_results_api/test/test_local_network_topology_result_base.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.local_network_topology_result_base import LocalNetworkTopologyResultBase + +class TestLocalNetworkTopologyResultBase(unittest.TestCase): + """LocalNetworkTopologyResultBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LocalNetworkTopologyResultBase: + """Test LocalNetworkTopologyResultBase + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LocalNetworkTopologyResultBase` + """ + model = LocalNetworkTopologyResultBase() + if include_optional: + return LocalNetworkTopologyResultBase( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + var_date = '2022-07-17T22:00:54Z', + network_topology_id = '00160:54c3a4b180c6:1490536500:c7a58c49', + round_id = 1384309800, + target = '10.0.2.2', + target_port = 80, + type = 'vpn', + icmp_ping = test_results_api.models.network_ping.NetworkPing( + avg_rtt = 7, + max_rtt = 66, + mean_dev_rtt = 11, + min_rtt = 1, + pkts_received = 10, + pkts_sent = 10, + error = 'An operation timed out.', + info_flags = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], ), + is_icmp_blocked = True, + tcp_connect = test_results_api.models.tcp_connect.TcpConnect( + rtt = 77.777, + error_code = 'ERR_TIMED_OUT', + error = 'An operation timed out.', + info_flags = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], ), + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ) + ) + else: + return LocalNetworkTopologyResultBase( + ) + """ + + def testLocalNetworkTopologyResultBase(self): + """Test LocalNetworkTopologyResultBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_local_network_topology_results.py b/endpoint/test_results_api/test/test_local_network_topology_results.py new file mode 100644 index 00000000..0f041c62 --- /dev/null +++ b/endpoint/test_results_api/test/test_local_network_topology_results.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.local_network_topology_results import LocalNetworkTopologyResults + +class TestLocalNetworkTopologyResults(unittest.TestCase): + """LocalNetworkTopologyResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LocalNetworkTopologyResults: + """Test LocalNetworkTopologyResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LocalNetworkTopologyResults` + """ + model = LocalNetworkTopologyResults() + if include_optional: + return LocalNetworkTopologyResults( + results = [ + test_results_api.models.local_network_topology_result_base.LocalNetworkTopologyResultBase( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + date = '2022-07-17T22:00:54Z', + network_topology_id = '00160:54c3a4b180c6:1490536500:c7a58c49', + round_id = 1384309800, + target = '10.0.2.2', + target_port = 80, + type = null, + icmp_ping = test_results_api.models.network_ping.NetworkPing( + avg_rtt = 7, + max_rtt = 66, + mean_dev_rtt = 11, + min_rtt = 1, + pkts_received = 10, + pkts_sent = 10, + error = 'An operation timed out.', + info_flags = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], ), + is_icmp_blocked = True, + tcp_connect = test_results_api.models.tcp_connect.TcpConnect( + rtt = 77.777, + error_code = 'ERR_TIMED_OUT', + error = 'An operation timed out.', + info_flags = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], ), + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), ) + ] + ) + else: + return LocalNetworkTopologyResults( + ) + """ + + def testLocalNetworkTopologyResults(self): + """Test LocalNetworkTopologyResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_multi_test_id_network_test_results.py b/endpoint/test_results_api/test/test_multi_test_id_network_test_results.py new file mode 100644 index 00000000..2cec6c89 --- /dev/null +++ b/endpoint/test_results_api/test/test_multi_test_id_network_test_results.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.multi_test_id_network_test_results import MultiTestIdNetworkTestResults + +class TestMultiTestIdNetworkTestResults(unittest.TestCase): + """MultiTestIdNetworkTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultiTestIdNetworkTestResults: + """Test MultiTestIdNetworkTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MultiTestIdNetworkTestResults` + """ + model = MultiTestIdNetworkTestResults() + if include_optional: + return MultiTestIdNetworkTestResults( + results = [ + null + ] + ) + else: + return MultiTestIdNetworkTestResults( + ) + """ + + def testMultiTestIdNetworkTestResults(self): + """Test MultiTestIdNetworkTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_multi_test_id_tests_data_rounds_search.py b/endpoint/test_results_api/test/test_multi_test_id_tests_data_rounds_search.py new file mode 100644 index 00000000..003a410b --- /dev/null +++ b/endpoint/test_results_api/test/test_multi_test_id_tests_data_rounds_search.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.multi_test_id_tests_data_rounds_search import MultiTestIdTestsDataRoundsSearch + +class TestMultiTestIdTestsDataRoundsSearch(unittest.TestCase): + """MultiTestIdTestsDataRoundsSearch unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultiTestIdTestsDataRoundsSearch: + """Test MultiTestIdTestsDataRoundsSearch + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MultiTestIdTestsDataRoundsSearch` + """ + model = MultiTestIdTestsDataRoundsSearch() + if include_optional: + return MultiTestIdTestsDataRoundsSearch( + search_sort = [ + test_results_api.models.tests_data_search_sort.TestsDataSearchSort( + sort = 'round-id', + order = 'desc', ) + ], + threshold_filter = test_results_api.models.tests_data_threshold_filters.TestsDataThresholdFilters( + filters = [ + test_results_api.models.tests_data_threshold_filter.TestsDataThresholdFilter( + name = 'loss', + value = 1.337, + operator = 'gte', ) + ], + conditional_operator = 'and', ), + search_filters = test_results_api.models.multi_test_id_tests_data_search_filter.MultiTestIdTestsDataSearchFilter( + agent_id = [ + '52455b09-ff1b-4849-8194-99026cc890e0' + ], + test_id = [ + '5' + ], ) + ) + else: + return MultiTestIdTestsDataRoundsSearch( + ) + """ + + def testMultiTestIdTestsDataRoundsSearch(self): + """Test MultiTestIdTestsDataRoundsSearch""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_multi_test_id_tests_data_search_filter.py b/endpoint/test_results_api/test/test_multi_test_id_tests_data_search_filter.py new file mode 100644 index 00000000..6811bc2c --- /dev/null +++ b/endpoint/test_results_api/test/test_multi_test_id_tests_data_search_filter.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.multi_test_id_tests_data_search_filter import MultiTestIdTestsDataSearchFilter + +class TestMultiTestIdTestsDataSearchFilter(unittest.TestCase): + """MultiTestIdTestsDataSearchFilter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultiTestIdTestsDataSearchFilter: + """Test MultiTestIdTestsDataSearchFilter + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MultiTestIdTestsDataSearchFilter` + """ + model = MultiTestIdTestsDataSearchFilter() + if include_optional: + return MultiTestIdTestsDataSearchFilter( + agent_id = [ + '52455b09-ff1b-4849-8194-99026cc890e0' + ], + test_id = [ + '5' + ] + ) + else: + return MultiTestIdTestsDataSearchFilter( + ) + """ + + def testMultiTestIdTestsDataSearchFilter(self): + """Test MultiTestIdTestsDataSearchFilter""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_dynamic_test_result.py b/endpoint/test_results_api/test/test_network_dynamic_test_result.py new file mode 100644 index 00000000..2d8032ab --- /dev/null +++ b/endpoint/test_results_api/test/test_network_dynamic_test_result.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.network_dynamic_test_result import NetworkDynamicTestResult + +class TestNetworkDynamicTestResult(unittest.TestCase): + """NetworkDynamicTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkDynamicTestResult: + """Test NetworkDynamicTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NetworkDynamicTestResult` + """ + model = NetworkDynamicTestResult() + if include_optional: + return NetworkDynamicTestResult( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + aid = test_results_api.models.account_group_id.AccountGroupId( + aid = '11', ), + round_id = 1384309800, + server_ip = '185.199.108.153', + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), + vpn_profile = test_results_api.models.vpn_profile.VpnProfile( + vpn_client_addresses = ["184.81.113.85","13.129.91.62"], + vpn_client_network_range = [ + '9.88.37.27' + ], + vpn_gateway_address = '120.98.134.7', + vpn_type = 'cisco-anyconnect', ), + network_profile = None, + avg_latency = 167.04, + error_details = 'Error', + jitter = 0.076808, + is_icmp_blocked = True, + loss = 0.0, + max_latency = 168.0, + min_latency = 167.0, + application = 'webex', + webex = test_results_api.models.dynamic_base_test_result_webex.DynamicBaseTestResult_webex( + conference_id = '225817074608419375', + correlation_id = '22581707460321454', ) + ) + else: + return NetworkDynamicTestResult( + ) + """ + + def testNetworkDynamicTestResult(self): + """Test NetworkDynamicTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_dynamic_test_results.py b/endpoint/test_results_api/test/test_network_dynamic_test_results.py new file mode 100644 index 00000000..facfc188 --- /dev/null +++ b/endpoint/test_results_api/test/test_network_dynamic_test_results.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.network_dynamic_test_results import NetworkDynamicTestResults + +class TestNetworkDynamicTestResults(unittest.TestCase): + """NetworkDynamicTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkDynamicTestResults: + """Test NetworkDynamicTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NetworkDynamicTestResults` + """ + model = NetworkDynamicTestResults() + if include_optional: + return NetworkDynamicTestResults( + results = [ + null + ], + test = test_results_api.models.dynamic_test.DynamicTest( + _links = test_results_api.models.dynamic_test_links.DynamicTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}], ), + agent_selector_config = test_results_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + application = 'webex', + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + has_path_trace_in_session = null, + has_ping = True, + has_traceroute = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = null, + protocol = 'icmp', + tcp_probe_mode = null, + test_id = '281474976710706', + aid = null, + test_name = 'Test name', ) + ) + else: + return NetworkDynamicTestResults( + ) + """ + + def testNetworkDynamicTestResults(self): + """Test NetworkDynamicTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_dynamic_tests_results_api.py b/endpoint/test_results_api/test/test_network_dynamic_tests_results_api.py new file mode 100644 index 00000000..b67f3138 --- /dev/null +++ b/endpoint/test_results_api/test/test_network_dynamic_tests_results_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest + +from test_results_api.api.network_dynamic_tests_results_api import NetworkDynamicTestsResultsApi + + +class TestNetworkDynamicTestsResultsApi(unittest.TestCase): + """NetworkDynamicTestsResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = NetworkDynamicTestsResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_dynamic_test_result_network_pathvis(self) -> None: + """Test case for get_dynamic_test_result_network_pathvis + + Retrieve pathvis network dynamic test results + """ + pass + + def test_get_dynamic_test_result_pathvis_agent_round(self) -> None: + """Test case for get_dynamic_test_result_pathvis_agent_round + + Retrieve pathvis network dynamic test results details + """ + pass + + def test_post_fetch_dynamic_test_result_metrics(self) -> None: + """Test case for post_fetch_dynamic_test_result_metrics + + Retrieve network dynamic test results + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_interface.py b/endpoint/test_results_api/test/test_network_interface.py new file mode 100644 index 00000000..b954741d --- /dev/null +++ b/endpoint/test_results_api/test/test_network_interface.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.network_interface import NetworkInterface + +class TestNetworkInterface(unittest.TestCase): + """NetworkInterface unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkInterface: + """Test NetworkInterface + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NetworkInterface` + """ + model = NetworkInterface() + if include_optional: + return NetworkInterface( + ip_address = '10.0.0.13', + subnet_mask = '255.255.255.0', + public_ip_address = '84.255.241.1', + local_prefix = '10.0.0.0', + public_ip_range = '84.255.241.0-84.255.241.255', + dns_servers = ["8.8.8.8","8.8.8.4"], + hardware_type = 'wireless', + interface_name = 'en0' + ) + else: + return NetworkInterface( + ) + """ + + def testNetworkInterface(self): + """Test NetworkInterface""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_metrics.py b/endpoint/test_results_api/test/test_network_metrics.py new file mode 100644 index 00000000..97de72c3 --- /dev/null +++ b/endpoint/test_results_api/test/test_network_metrics.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.network_metrics import NetworkMetrics + +class TestNetworkMetrics(unittest.TestCase): + """NetworkMetrics unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkMetrics: + """Test NetworkMetrics + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NetworkMetrics` + """ + model = NetworkMetrics() + if include_optional: + return NetworkMetrics( + jitter = 46, + latency = 150, + loss = 0.1, + target = '54.208.6.220' + ) + else: + return NetworkMetrics( + ) + """ + + def testNetworkMetrics(self): + """Test NetworkMetrics""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_ping.py b/endpoint/test_results_api/test/test_network_ping.py new file mode 100644 index 00000000..40020897 --- /dev/null +++ b/endpoint/test_results_api/test/test_network_ping.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.network_ping import NetworkPing + +class TestNetworkPing(unittest.TestCase): + """NetworkPing unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkPing: + """Test NetworkPing + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NetworkPing` + """ + model = NetworkPing() + if include_optional: + return NetworkPing( + avg_rtt = 7, + max_rtt = 66, + mean_dev_rtt = 11, + min_rtt = 1, + pkts_received = 10, + pkts_sent = 10, + error = 'An operation timed out.', + info_flags = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"] + ) + else: + return NetworkPing( + ) + """ + + def testNetworkPing(self): + """Test NetworkPing""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_profile.py b/endpoint/test_results_api/test/test_network_profile.py new file mode 100644 index 00000000..4513d9cf --- /dev/null +++ b/endpoint/test_results_api/test/test_network_profile.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.network_profile import NetworkProfile + +class TestNetworkProfile(unittest.TestCase): + """NetworkProfile unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkProfile: + """Test NetworkProfile + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NetworkProfile` + """ + model = NetworkProfile() + if include_optional: + return NetworkProfile( + ip_address = '10.0.0.13', + subnet_mask = '255.255.255.0', + public_ip_address = '84.255.241.1', + local_prefix = '10.0.0.0', + public_ip_range = '84.255.241.0-84.255.241.255', + dns_servers = [8.8.8.8, 8.8.8.4], + hardware_type = 'wireless', + interface_name = 'en0', + error = 'An operation timed out.', + gateway = '10.0.0.1', + wireless_profile = test_results_api.models.network_wireless_profile.NetworkWirelessProfile( + ssid = 'Internet for the masses', + bssid = '4c:ba:ba:f4:fa:fa', + channel = 1, + phy_mode = '802.11n', + rssi = -38, + noise = -95, + quality = 100, + tx_rate = 130, + vendor = 'Cisco', ), + proxy_profile = test_results_api.models.network_proxy_profile.NetworkProxyProfile( + method = 'System', + proxies = [ + test_results_api.models.network_proxy_profile_proxies_inner.NetworkProxyProfile_proxies_inner( + bypass = '*.local;169.254/16', + proxy = '', ) + ], ), + ethernet_profile = test_results_api.models.ethernet_profile.EthernetProfile( + link_speed = 860, ), + previous_interface = test_results_api.models.network_interface.NetworkInterface( + ip_address = '10.0.0.13', + subnet_mask = '255.255.255.0', + public_ip_address = '84.255.241.1', + local_prefix = '10.0.0.0', + public_ip_range = '84.255.241.0-84.255.241.255', + dns_servers = ["8.8.8.8","8.8.8.4"], + hardware_type = 'wireless', + interface_name = 'en0', ) + ) + else: + return NetworkProfile( + ) + """ + + def testNetworkProfile(self): + """Test NetworkProfile""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_proxy_profile.py b/endpoint/test_results_api/test/test_network_proxy_profile.py new file mode 100644 index 00000000..79ab3ecf --- /dev/null +++ b/endpoint/test_results_api/test/test_network_proxy_profile.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.network_proxy_profile import NetworkProxyProfile + +class TestNetworkProxyProfile(unittest.TestCase): + """NetworkProxyProfile unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkProxyProfile: + """Test NetworkProxyProfile + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NetworkProxyProfile` + """ + model = NetworkProxyProfile() + if include_optional: + return NetworkProxyProfile( + method = 'System', + proxies = [ + test_results_api.models.network_proxy_profile_proxies_inner.NetworkProxyProfile_proxies_inner( + bypass = '*.local;169.254/16', + proxy = '', ) + ] + ) + else: + return NetworkProxyProfile( + ) + """ + + def testNetworkProxyProfile(self): + """Test NetworkProxyProfile""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_proxy_profile_proxies_inner.py b/endpoint/test_results_api/test/test_network_proxy_profile_proxies_inner.py new file mode 100644 index 00000000..c4efb49c --- /dev/null +++ b/endpoint/test_results_api/test/test_network_proxy_profile_proxies_inner.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.network_proxy_profile_proxies_inner import NetworkProxyProfileProxiesInner + +class TestNetworkProxyProfileProxiesInner(unittest.TestCase): + """NetworkProxyProfileProxiesInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkProxyProfileProxiesInner: + """Test NetworkProxyProfileProxiesInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NetworkProxyProfileProxiesInner` + """ + model = NetworkProxyProfileProxiesInner() + if include_optional: + return NetworkProxyProfileProxiesInner( + bypass = '*.local;169.254/16', + proxy = '' + ) + else: + return NetworkProxyProfileProxiesInner( + ) + """ + + def testNetworkProxyProfileProxiesInner(self): + """Test NetworkProxyProfileProxiesInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_scheduled_tests_results_api.py b/endpoint/test_results_api/test/test_network_scheduled_tests_results_api.py new file mode 100644 index 00000000..43bd641f --- /dev/null +++ b/endpoint/test_results_api/test/test_network_scheduled_tests_results_api.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest + +from test_results_api.api.network_scheduled_tests_results_api import NetworkScheduledTestsResultsApi + + +class TestNetworkScheduledTestsResultsApi(unittest.TestCase): + """NetworkScheduledTestsResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = NetworkScheduledTestsResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_result_network_pathvis(self) -> None: + """Test case for get_test_result_network_pathvis + + Retrieve pathvis network scheduled test results + """ + pass + + def test_get_test_result_pathvis_agent_round(self) -> None: + """Test case for get_test_result_pathvis_agent_round + + Retrieve pathvis network scheduled test results details + """ + pass + + def test_post_fetch_test_result_metrics(self) -> None: + """Test case for post_fetch_test_result_metrics + + Retrieve network scheduled test results + """ + pass + + def test_post_fetch_test_result_metrics_multi_test(self) -> None: + """Test case for post_fetch_test_result_metrics_multi_test + + Retrieve network scheduled test results from multiple tests + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_test_result.py b/endpoint/test_results_api/test/test_network_test_result.py new file mode 100644 index 00000000..3e585ef7 --- /dev/null +++ b/endpoint/test_results_api/test/test_network_test_result.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.network_test_result import NetworkTestResult + +class TestNetworkTestResult(unittest.TestCase): + """NetworkTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkTestResult: + """Test NetworkTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NetworkTestResult` + """ + model = NetworkTestResult() + if include_optional: + return NetworkTestResult( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + aid = test_results_api.models.account_group_id.AccountGroupId( + aid = '11', ), + round_id = 1384309800, + server_ip = '185.199.108.153', + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), + vpn_profile = test_results_api.models.vpn_profile.VpnProfile( + vpn_client_addresses = ["184.81.113.85","13.129.91.62"], + vpn_client_network_range = [ + '9.88.37.27' + ], + vpn_gateway_address = '120.98.134.7', + vpn_type = 'cisco-anyconnect', ), + network_profile = None, + avg_latency = 167.04, + error_details = 'Error', + jitter = 0.076808, + is_icmp_blocked = True, + loss = 0.0, + max_latency = 168.0, + min_latency = 167.0 + ) + else: + return NetworkTestResult( + ) + """ + + def testNetworkTestResult(self): + """Test NetworkTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_test_results.py b/endpoint/test_results_api/test/test_network_test_results.py new file mode 100644 index 00000000..59a8ab81 --- /dev/null +++ b/endpoint/test_results_api/test/test_network_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.network_test_results import NetworkTestResults + +class TestNetworkTestResults(unittest.TestCase): + """NetworkTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkTestResults: + """Test NetworkTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NetworkTestResults` + """ + model = NetworkTestResults() + if include_optional: + return NetworkTestResults( + results = [ + null + ], + test = None + ) + else: + return NetworkTestResults( + ) + """ + + def testNetworkTestResults(self): + """Test NetworkTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_topology_type.py b/endpoint/test_results_api/test/test_network_topology_type.py new file mode 100644 index 00000000..d8efdbd0 --- /dev/null +++ b/endpoint/test_results_api/test/test_network_topology_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.network_topology_type import NetworkTopologyType + +class TestNetworkTopologyType(unittest.TestCase): + """NetworkTopologyType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNetworkTopologyType(self): + """Test NetworkTopologyType""" + # inst = NetworkTopologyType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_network_wireless_profile.py b/endpoint/test_results_api/test/test_network_wireless_profile.py new file mode 100644 index 00000000..f8abf65d --- /dev/null +++ b/endpoint/test_results_api/test/test_network_wireless_profile.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.network_wireless_profile import NetworkWirelessProfile + +class TestNetworkWirelessProfile(unittest.TestCase): + """NetworkWirelessProfile unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkWirelessProfile: + """Test NetworkWirelessProfile + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NetworkWirelessProfile` + """ + model = NetworkWirelessProfile() + if include_optional: + return NetworkWirelessProfile( + ssid = 'Internet for the masses', + bssid = '4c:ba:ba:f4:fa:fa', + channel = 1, + phy_mode = '802.11n', + rssi = -38, + noise = -95, + quality = 100, + tx_rate = 130, + vendor = 'Cisco' + ) + else: + return NetworkWirelessProfile( + ) + """ + + def testNetworkWirelessProfile(self): + """Test NetworkWirelessProfile""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_pagination_next_link.py b/endpoint/test_results_api/test/test_pagination_next_link.py new file mode 100644 index 00000000..25dbcfb1 --- /dev/null +++ b/endpoint/test_results_api/test/test_pagination_next_link.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.pagination_next_link import PaginationNextLink + +class TestPaginationNextLink(unittest.TestCase): + """PaginationNextLink unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationNextLink: + """Test PaginationNextLink + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationNextLink` + """ + model = PaginationNextLink() + if include_optional: + return PaginationNextLink( + links = test_results_api.models.pagination_next_link__links.PaginationNextLink__links( + next = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return PaginationNextLink( + ) + """ + + def testPaginationNextLink(self): + """Test PaginationNextLink""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_pagination_next_link_links.py b/endpoint/test_results_api/test/test_pagination_next_link_links.py new file mode 100644 index 00000000..c311c90e --- /dev/null +++ b/endpoint/test_results_api/test/test_pagination_next_link_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.pagination_next_link_links import PaginationNextLinkLinks + +class TestPaginationNextLinkLinks(unittest.TestCase): + """PaginationNextLinkLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationNextLinkLinks: + """Test PaginationNextLinkLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationNextLinkLinks` + """ + model = PaginationNextLinkLinks() + if include_optional: + return PaginationNextLinkLinks( + next = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return PaginationNextLinkLinks( + ) + """ + + def testPaginationNextLinkLinks(self): + """Test PaginationNextLinkLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_path_vis_base_test_result.py b/endpoint/test_results_api/test/test_path_vis_base_test_result.py new file mode 100644 index 00000000..1502aca0 --- /dev/null +++ b/endpoint/test_results_api/test/test_path_vis_base_test_result.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.path_vis_base_test_result import PathVisBaseTestResult + +class TestPathVisBaseTestResult(unittest.TestCase): + """PathVisBaseTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisBaseTestResult: + """Test PathVisBaseTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisBaseTestResult` + """ + model = PathVisBaseTestResult() + if include_optional: + return PathVisBaseTestResult( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + aid = test_results_api.models.account_group_id.AccountGroupId( + aid = '11', ), + round_id = 1384309800, + server_ip = '185.199.108.153', + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), + vpn_profile = test_results_api.models.vpn_profile.VpnProfile( + vpn_client_addresses = ["184.81.113.85","13.129.91.62"], + vpn_client_network_range = [ + '9.88.37.27' + ], + vpn_gateway_address = '120.98.134.7', + vpn_type = 'cisco-anyconnect', ), + asn_details = test_results_api.models.asn_details.AsnDetails( + as_name = 'ThousandEyes, Inc', + as_number = 394101, ), + server = 'www.google.com:443', + source_ip = '196.40.106.237', + source_prefix = '196.40.96.0/20' + ) + else: + return PathVisBaseTestResult( + ) + """ + + def testPathVisBaseTestResult(self): + """Test PathVisBaseTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_path_vis_detail_dynamic_test_result.py b/endpoint/test_results_api/test/test_path_vis_detail_dynamic_test_result.py new file mode 100644 index 00000000..833d5a93 --- /dev/null +++ b/endpoint/test_results_api/test/test_path_vis_detail_dynamic_test_result.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.path_vis_detail_dynamic_test_result import PathVisDetailDynamicTestResult + +class TestPathVisDetailDynamicTestResult(unittest.TestCase): + """PathVisDetailDynamicTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisDetailDynamicTestResult: + """Test PathVisDetailDynamicTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisDetailDynamicTestResult` + """ + model = PathVisDetailDynamicTestResult() + if include_optional: + return PathVisDetailDynamicTestResult( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + aid = test_results_api.models.account_group_id.AccountGroupId( + aid = '11', ), + round_id = 1384309800, + server_ip = '185.199.108.153', + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), + vpn_profile = test_results_api.models.vpn_profile.VpnProfile( + vpn_client_addresses = ["184.81.113.85","13.129.91.62"], + vpn_client_network_range = [ + '9.88.37.27' + ], + vpn_gateway_address = '120.98.134.7', + vpn_type = 'cisco-anyconnect', ), + asn_details = test_results_api.models.asn_details.AsnDetails( + as_name = 'ThousandEyes, Inc', + as_number = 394101, ), + server = 'www.google.com:443', + source_ip = '196.40.106.237', + source_prefix = '196.40.96.0/20', + routes = [ + test_results_api.models.path_vis_route.PathVisRoute( + path_id = '4711301366345855606023718047703941305741293841502186803', + hops = [ + null + ], ) + ], + vpn_routes = [ + test_results_api.models.path_vis_route.PathVisRoute( + path_id = '4711301366345855606023718047703941305741293841502186803', + hops = [ + null + ], ) + ], + application = 'webex', + webex = test_results_api.models.dynamic_base_test_result_webex.DynamicBaseTestResult_webex( + conference_id = '225817074608419375', + correlation_id = '22581707460321454', ) + ) + else: + return PathVisDetailDynamicTestResult( + ) + """ + + def testPathVisDetailDynamicTestResult(self): + """Test PathVisDetailDynamicTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_path_vis_detail_dynamic_test_results.py b/endpoint/test_results_api/test/test_path_vis_detail_dynamic_test_results.py new file mode 100644 index 00000000..c1391cf0 --- /dev/null +++ b/endpoint/test_results_api/test/test_path_vis_detail_dynamic_test_results.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.path_vis_detail_dynamic_test_results import PathVisDetailDynamicTestResults + +class TestPathVisDetailDynamicTestResults(unittest.TestCase): + """PathVisDetailDynamicTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisDetailDynamicTestResults: + """Test PathVisDetailDynamicTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisDetailDynamicTestResults` + """ + model = PathVisDetailDynamicTestResults() + if include_optional: + return PathVisDetailDynamicTestResults( + results = [ + null + ], + test = test_results_api.models.dynamic_test.DynamicTest( + _links = test_results_api.models.dynamic_test_links.DynamicTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}], ), + agent_selector_config = test_results_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + application = 'webex', + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + has_path_trace_in_session = null, + has_ping = True, + has_traceroute = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = null, + protocol = 'icmp', + tcp_probe_mode = null, + test_id = '281474976710706', + aid = null, + test_name = 'Test name', ) + ) + else: + return PathVisDetailDynamicTestResults( + ) + """ + + def testPathVisDetailDynamicTestResults(self): + """Test PathVisDetailDynamicTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_path_vis_detail_test_result.py b/endpoint/test_results_api/test/test_path_vis_detail_test_result.py new file mode 100644 index 00000000..38f2363f --- /dev/null +++ b/endpoint/test_results_api/test/test_path_vis_detail_test_result.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.path_vis_detail_test_result import PathVisDetailTestResult + +class TestPathVisDetailTestResult(unittest.TestCase): + """PathVisDetailTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisDetailTestResult: + """Test PathVisDetailTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisDetailTestResult` + """ + model = PathVisDetailTestResult() + if include_optional: + return PathVisDetailTestResult( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + aid = test_results_api.models.account_group_id.AccountGroupId( + aid = '11', ), + round_id = 1384309800, + server_ip = '185.199.108.153', + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), + vpn_profile = test_results_api.models.vpn_profile.VpnProfile( + vpn_client_addresses = ["184.81.113.85","13.129.91.62"], + vpn_client_network_range = [ + '9.88.37.27' + ], + vpn_gateway_address = '120.98.134.7', + vpn_type = 'cisco-anyconnect', ), + asn_details = test_results_api.models.asn_details.AsnDetails( + as_name = 'ThousandEyes, Inc', + as_number = 394101, ), + server = 'www.google.com:443', + source_ip = '196.40.106.237', + source_prefix = '196.40.96.0/20', + routes = [ + test_results_api.models.path_vis_route.PathVisRoute( + path_id = '4711301366345855606023718047703941305741293841502186803', + hops = [ + null + ], ) + ], + vpn_routes = [ + test_results_api.models.path_vis_route.PathVisRoute( + path_id = '4711301366345855606023718047703941305741293841502186803', + hops = [ + null + ], ) + ] + ) + else: + return PathVisDetailTestResult( + ) + """ + + def testPathVisDetailTestResult(self): + """Test PathVisDetailTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_path_vis_detail_test_results.py b/endpoint/test_results_api/test/test_path_vis_detail_test_results.py new file mode 100644 index 00000000..f3b60df7 --- /dev/null +++ b/endpoint/test_results_api/test/test_path_vis_detail_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.path_vis_detail_test_results import PathVisDetailTestResults + +class TestPathVisDetailTestResults(unittest.TestCase): + """PathVisDetailTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisDetailTestResults: + """Test PathVisDetailTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisDetailTestResults` + """ + model = PathVisDetailTestResults() + if include_optional: + return PathVisDetailTestResults( + results = [ + null + ], + test = None + ) + else: + return PathVisDetailTestResults( + ) + """ + + def testPathVisDetailTestResults(self): + """Test PathVisDetailTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_path_vis_dynamic_test_result.py b/endpoint/test_results_api/test/test_path_vis_dynamic_test_result.py new file mode 100644 index 00000000..c0c23ece --- /dev/null +++ b/endpoint/test_results_api/test/test_path_vis_dynamic_test_result.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.path_vis_dynamic_test_result import PathVisDynamicTestResult + +class TestPathVisDynamicTestResult(unittest.TestCase): + """PathVisDynamicTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisDynamicTestResult: + """Test PathVisDynamicTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisDynamicTestResult` + """ + model = PathVisDynamicTestResult() + if include_optional: + return PathVisDynamicTestResult( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + aid = test_results_api.models.account_group_id.AccountGroupId( + aid = '11', ), + round_id = 1384309800, + server_ip = '185.199.108.153', + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), + vpn_profile = test_results_api.models.vpn_profile.VpnProfile( + vpn_client_addresses = ["184.81.113.85","13.129.91.62"], + vpn_client_network_range = [ + '9.88.37.27' + ], + vpn_gateway_address = '120.98.134.7', + vpn_type = 'cisco-anyconnect', ), + asn_details = test_results_api.models.asn_details.AsnDetails( + as_name = 'ThousandEyes, Inc', + as_number = 394101, ), + server = 'www.google.com:443', + source_ip = '196.40.106.237', + source_prefix = '196.40.96.0/20', + application = 'webex', + webex = test_results_api.models.dynamic_base_test_result_webex.DynamicBaseTestResult_webex( + conference_id = '225817074608419375', + correlation_id = '22581707460321454', ), + location = 'San Francisco Area', + endpoints = [ + test_results_api.models.path_vis_endpoint.PathVisEndpoint( + ip_address = '196.40.106.237', + number_of_hops = 15, + path_id = '1230899668701775614109128428722974545787322404682781961521', + response_time = 1500, ) + ] + ) + else: + return PathVisDynamicTestResult( + ) + """ + + def testPathVisDynamicTestResult(self): + """Test PathVisDynamicTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_path_vis_dynamic_test_results.py b/endpoint/test_results_api/test/test_path_vis_dynamic_test_results.py new file mode 100644 index 00000000..ae2131b5 --- /dev/null +++ b/endpoint/test_results_api/test/test_path_vis_dynamic_test_results.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.path_vis_dynamic_test_results import PathVisDynamicTestResults + +class TestPathVisDynamicTestResults(unittest.TestCase): + """PathVisDynamicTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisDynamicTestResults: + """Test PathVisDynamicTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisDynamicTestResults` + """ + model = PathVisDynamicTestResults() + if include_optional: + return PathVisDynamicTestResults( + results = [ + null + ], + test = test_results_api.models.dynamic_test.DynamicTest( + _links = test_results_api.models.dynamic_test_links.DynamicTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}], ), + agent_selector_config = test_results_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + application = 'webex', + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + has_path_trace_in_session = null, + has_ping = True, + has_traceroute = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = null, + protocol = 'icmp', + tcp_probe_mode = null, + test_id = '281474976710706', + aid = null, + test_name = 'Test name', ) + ) + else: + return PathVisDynamicTestResults( + ) + """ + + def testPathVisDynamicTestResults(self): + """Test PathVisDynamicTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_path_vis_endpoint.py b/endpoint/test_results_api/test/test_path_vis_endpoint.py new file mode 100644 index 00000000..72b679d9 --- /dev/null +++ b/endpoint/test_results_api/test/test_path_vis_endpoint.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.path_vis_endpoint import PathVisEndpoint + +class TestPathVisEndpoint(unittest.TestCase): + """PathVisEndpoint unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisEndpoint: + """Test PathVisEndpoint + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisEndpoint` + """ + model = PathVisEndpoint() + if include_optional: + return PathVisEndpoint( + ip_address = '196.40.106.237', + number_of_hops = 15, + path_id = '1230899668701775614109128428722974545787322404682781961521', + response_time = 1500 + ) + else: + return PathVisEndpoint( + ) + """ + + def testPathVisEndpoint(self): + """Test PathVisEndpoint""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_path_vis_hop.py b/endpoint/test_results_api/test/test_path_vis_hop.py new file mode 100644 index 00000000..e6a2b622 --- /dev/null +++ b/endpoint/test_results_api/test/test_path_vis_hop.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.path_vis_hop import PathVisHop + +class TestPathVisHop(unittest.TestCase): + """PathVisHop unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisHop: + """Test PathVisHop + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisHop` + """ + model = PathVisHop() + if include_optional: + return PathVisHop( + hop = 1, + ip_address = '196.40.106.237', + prefix = '196.40.96.0/20', + rdns = 'core-router1.cpt2.host-h.net', + network = 'HETZNER (Pty) Ltd (AS 37153)', + response_time = 1, + location = 'Cape Town, South Africa' + ) + else: + return PathVisHop( + ) + """ + + def testPathVisHop(self): + """Test PathVisHop""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_path_vis_route.py b/endpoint/test_results_api/test/test_path_vis_route.py new file mode 100644 index 00000000..cfe25dbb --- /dev/null +++ b/endpoint/test_results_api/test/test_path_vis_route.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.path_vis_route import PathVisRoute + +class TestPathVisRoute(unittest.TestCase): + """PathVisRoute unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisRoute: + """Test PathVisRoute + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisRoute` + """ + model = PathVisRoute() + if include_optional: + return PathVisRoute( + path_id = '4711301366345855606023718047703941305741293841502186803', + hops = [ + null + ] + ) + else: + return PathVisRoute( + ) + """ + + def testPathVisRoute(self): + """Test PathVisRoute""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_path_vis_test_result.py b/endpoint/test_results_api/test/test_path_vis_test_result.py new file mode 100644 index 00000000..60c0116b --- /dev/null +++ b/endpoint/test_results_api/test/test_path_vis_test_result.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.path_vis_test_result import PathVisTestResult + +class TestPathVisTestResult(unittest.TestCase): + """PathVisTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisTestResult: + """Test PathVisTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisTestResult` + """ + model = PathVisTestResult() + if include_optional: + return PathVisTestResult( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + aid = test_results_api.models.account_group_id.AccountGroupId( + aid = '11', ), + round_id = 1384309800, + server_ip = '185.199.108.153', + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), + vpn_profile = test_results_api.models.vpn_profile.VpnProfile( + vpn_client_addresses = ["184.81.113.85","13.129.91.62"], + vpn_client_network_range = [ + '9.88.37.27' + ], + vpn_gateway_address = '120.98.134.7', + vpn_type = 'cisco-anyconnect', ), + asn_details = test_results_api.models.asn_details.AsnDetails( + as_name = 'ThousandEyes, Inc', + as_number = 394101, ), + server = 'www.google.com:443', + source_ip = '196.40.106.237', + source_prefix = '196.40.96.0/20', + location = 'San Francisco Area', + endpoints = [ + test_results_api.models.path_vis_endpoint.PathVisEndpoint( + ip_address = '196.40.106.237', + number_of_hops = 15, + path_id = '1230899668701775614109128428722974545787322404682781961521', + response_time = 1500, ) + ] + ) + else: + return PathVisTestResult( + ) + """ + + def testPathVisTestResult(self): + """Test PathVisTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_path_vis_test_results.py b/endpoint/test_results_api/test/test_path_vis_test_results.py new file mode 100644 index 00000000..e2113c28 --- /dev/null +++ b/endpoint/test_results_api/test/test_path_vis_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.path_vis_test_results import PathVisTestResults + +class TestPathVisTestResults(unittest.TestCase): + """PathVisTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisTestResults: + """Test PathVisTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisTestResults` + """ + model = PathVisTestResults() + if include_optional: + return PathVisTestResults( + results = [ + null + ], + test = None + ) + else: + return PathVisTestResults( + ) + """ + + def testPathVisTestResults(self): + """Test PathVisTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_physical_memory_used_bytes.py b/endpoint/test_results_api/test/test_physical_memory_used_bytes.py new file mode 100644 index 00000000..b41d0d45 --- /dev/null +++ b/endpoint/test_results_api/test/test_physical_memory_used_bytes.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.physical_memory_used_bytes import PhysicalMemoryUsedBytes + +class TestPhysicalMemoryUsedBytes(unittest.TestCase): + """PhysicalMemoryUsedBytes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PhysicalMemoryUsedBytes: + """Test PhysicalMemoryUsedBytes + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PhysicalMemoryUsedBytes` + """ + model = PhysicalMemoryUsedBytes() + if include_optional: + return PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155 + ) + else: + return PhysicalMemoryUsedBytes( + ) + """ + + def testPhysicalMemoryUsedBytes(self): + """Test PhysicalMemoryUsedBytes""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_platform.py b/endpoint/test_results_api/test/test_platform.py new file mode 100644 index 00000000..f3c750ba --- /dev/null +++ b/endpoint/test_results_api/test/test_platform.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.platform import Platform + +class TestPlatform(unittest.TestCase): + """Platform unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPlatform(self): + """Test Platform""" + # inst = Platform() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_post_fetch_dynamic_test_result_metrics200_response.py b/endpoint/test_results_api/test/test_post_fetch_dynamic_test_result_metrics200_response.py new file mode 100644 index 00000000..6d55e9d1 --- /dev/null +++ b/endpoint/test_results_api/test/test_post_fetch_dynamic_test_result_metrics200_response.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.post_fetch_dynamic_test_result_metrics200_response import PostFetchDynamicTestResultMetrics200Response + +class TestPostFetchDynamicTestResultMetrics200Response(unittest.TestCase): + """PostFetchDynamicTestResultMetrics200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PostFetchDynamicTestResultMetrics200Response: + """Test PostFetchDynamicTestResultMetrics200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PostFetchDynamicTestResultMetrics200Response` + """ + model = PostFetchDynamicTestResultMetrics200Response() + if include_optional: + return PostFetchDynamicTestResultMetrics200Response( + results = [ + null + ], + test = test_results_api.models.dynamic_test.DynamicTest( + _links = test_results_api.models.dynamic_test_links.DynamicTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}], ), + agent_selector_config = test_results_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + application = 'webex', + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + has_path_trace_in_session = null, + has_ping = True, + has_traceroute = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = null, + protocol = 'icmp', + tcp_probe_mode = null, + test_id = '281474976710706', + aid = null, + test_name = 'Test name', ), + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + links = test_results_api.models.pagination_next_link__links.PaginationNextLink__links( + next = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return PostFetchDynamicTestResultMetrics200Response( + ) + """ + + def testPostFetchDynamicTestResultMetrics200Response(self): + """Test PostFetchDynamicTestResultMetrics200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_post_fetch_test_result_metrics200_response.py b/endpoint/test_results_api/test/test_post_fetch_test_result_metrics200_response.py new file mode 100644 index 00000000..49fa36c8 --- /dev/null +++ b/endpoint/test_results_api/test/test_post_fetch_test_result_metrics200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.post_fetch_test_result_metrics200_response import PostFetchTestResultMetrics200Response + +class TestPostFetchTestResultMetrics200Response(unittest.TestCase): + """PostFetchTestResultMetrics200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PostFetchTestResultMetrics200Response: + """Test PostFetchTestResultMetrics200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PostFetchTestResultMetrics200Response` + """ + model = PostFetchTestResultMetrics200Response() + if include_optional: + return PostFetchTestResultMetrics200Response( + results = [ + null + ], + test = None, + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + links = test_results_api.models.pagination_next_link__links.PaginationNextLink__links( + next = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return PostFetchTestResultMetrics200Response( + ) + """ + + def testPostFetchTestResultMetrics200Response(self): + """Test PostFetchTestResultMetrics200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_post_fetch_test_result_metrics_multi_test200_response.py b/endpoint/test_results_api/test/test_post_fetch_test_result_metrics_multi_test200_response.py new file mode 100644 index 00000000..36656572 --- /dev/null +++ b/endpoint/test_results_api/test/test_post_fetch_test_result_metrics_multi_test200_response.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.post_fetch_test_result_metrics_multi_test200_response import PostFetchTestResultMetricsMultiTest200Response + +class TestPostFetchTestResultMetricsMultiTest200Response(unittest.TestCase): + """PostFetchTestResultMetricsMultiTest200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PostFetchTestResultMetricsMultiTest200Response: + """Test PostFetchTestResultMetricsMultiTest200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PostFetchTestResultMetricsMultiTest200Response` + """ + model = PostFetchTestResultMetricsMultiTest200Response() + if include_optional: + return PostFetchTestResultMetricsMultiTest200Response( + results = [ + null + ], + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + links = test_results_api.models.pagination_next_link__links.PaginationNextLink__links( + next = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return PostFetchTestResultMetricsMultiTest200Response( + ) + """ + + def testPostFetchTestResultMetricsMultiTest200Response(self): + """Test PostFetchTestResultMetricsMultiTest200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_query_window.py b/endpoint/test_results_api/test/test_query_window.py new file mode 100644 index 00000000..01e8c4e4 --- /dev/null +++ b/endpoint/test_results_api/test/test_query_window.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.query_window import QueryWindow + +class TestQueryWindow(unittest.TestCase): + """QueryWindow unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> QueryWindow: + """Test QueryWindow + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `QueryWindow` + """ + model = QueryWindow() + if include_optional: + return QueryWindow( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z' + ) + else: + return QueryWindow( + ) + """ + + def testQueryWindow(self): + """Test QueryWindow""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_test_coordinates.py b/endpoint/test_results_api/test/test_real_user_test_coordinates.py new file mode 100644 index 00000000..5b45db4d --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_test_coordinates.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.real_user_test_coordinates import RealUserTestCoordinates + +class TestRealUserTestCoordinates(unittest.TestCase): + """RealUserTestCoordinates unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RealUserTestCoordinates: + """Test RealUserTestCoordinates + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RealUserTestCoordinates` + """ + model = RealUserTestCoordinates() + if include_optional: + return RealUserTestCoordinates( + latitude = 46.0552778, + location = 'Slovenia', + longitude = 14.5144444 + ) + else: + return RealUserTestCoordinates( + ) + """ + + def testRealUserTestCoordinates(self): + """Test RealUserTestCoordinates""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_test_network.py b/endpoint/test_results_api/test/test_real_user_test_network.py new file mode 100644 index 00000000..f8b3116a --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_test_network.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.real_user_test_network import RealUserTestNetwork + +class TestRealUserTestNetwork(unittest.TestCase): + """RealUserTestNetwork unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RealUserTestNetwork: + """Test RealUserTestNetwork + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RealUserTestNetwork` + """ + model = RealUserTestNetwork() + if include_optional: + return RealUserTestNetwork( + network_profile = None, + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), + gateway_ping = None, + ping = None, + traceroute = None, + connect_rtt = 77.777, + is_icmp_blocked = True, + errors = ["ping: Request timed out before getting response"], + vpn_ping = None, + vpn_traceroute = None + ) + else: + return RealUserTestNetwork( + ) + """ + + def testRealUserTestNetwork(self): + """Test RealUserTestNetwork""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_test_network_gateway_ping.py b/endpoint/test_results_api/test/test_real_user_test_network_gateway_ping.py new file mode 100644 index 00000000..ac63ddc6 --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_test_network_gateway_ping.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.real_user_test_network_gateway_ping import RealUserTestNetworkGatewayPing + +class TestRealUserTestNetworkGatewayPing(unittest.TestCase): + """RealUserTestNetworkGatewayPing unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RealUserTestNetworkGatewayPing: + """Test RealUserTestNetworkGatewayPing + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RealUserTestNetworkGatewayPing` + """ + model = RealUserTestNetworkGatewayPing() + if include_optional: + return RealUserTestNetworkGatewayPing( + avg_rtt = 7, + max_rtt = 66, + mean_dev_rtt = 11, + min_rtt = 1, + pkts_received = 10, + pkts_sent = 10, + error = 'An operation timed out.', + info_flags = [TE_INFO_ICMP_BLOCKED_BY_FIREWALL] + ) + else: + return RealUserTestNetworkGatewayPing( + ) + """ + + def testRealUserTestNetworkGatewayPing(self): + """Test RealUserTestNetworkGatewayPing""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_test_network_ping.py b/endpoint/test_results_api/test/test_real_user_test_network_ping.py new file mode 100644 index 00000000..02be4278 --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_test_network_ping.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.real_user_test_network_ping import RealUserTestNetworkPing + +class TestRealUserTestNetworkPing(unittest.TestCase): + """RealUserTestNetworkPing unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RealUserTestNetworkPing: + """Test RealUserTestNetworkPing + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RealUserTestNetworkPing` + """ + model = RealUserTestNetworkPing() + if include_optional: + return RealUserTestNetworkPing( + avg_rtt = 7, + max_rtt = 66, + mean_dev_rtt = 11, + min_rtt = 1, + pkts_received = 10, + pkts_sent = 10, + error = 'An operation timed out.', + info_flags = [TE_INFO_ICMP_BLOCKED_BY_FIREWALL] + ) + else: + return RealUserTestNetworkPing( + ) + """ + + def testRealUserTestNetworkPing(self): + """Test RealUserTestNetworkPing""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_test_network_result.py b/endpoint/test_results_api/test/test_real_user_test_network_result.py new file mode 100644 index 00000000..2fbf0403 --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_test_network_result.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.real_user_test_network_result import RealUserTestNetworkResult + +class TestRealUserTestNetworkResult(unittest.TestCase): + """RealUserTestNetworkResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RealUserTestNetworkResult: + """Test RealUserTestNetworkResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RealUserTestNetworkResult` + """ + model = RealUserTestNetworkResult() + if include_optional: + return RealUserTestNetworkResult( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + var_date = '2022-07-17T22:00:54Z', + id = '07625:1490529480:aVDViw0i', + round_id = 1384309800, + destination = test_results_api.models.network_metrics.NetworkMetrics( + jitter = 46, + latency = 150, + loss = 0.1, + target = '54.208.6.220', ), + vpn = test_results_api.models.network_metrics.NetworkMetrics( + jitter = 46, + latency = 150, + loss = 0.1, + target = '54.208.6.220', ), + proxy = test_results_api.models.network_metrics.NetworkMetrics( + jitter = 46, + latency = 150, + loss = 0.1, + target = '54.208.6.220', ), + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ) + ) + else: + return RealUserTestNetworkResult( + ) + """ + + def testRealUserTestNetworkResult(self): + """Test RealUserTestNetworkResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_test_network_results.py b/endpoint/test_results_api/test/test_real_user_test_network_results.py new file mode 100644 index 00000000..a41dd666 --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_test_network_results.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.real_user_test_network_results import RealUserTestNetworkResults + +class TestRealUserTestNetworkResults(unittest.TestCase): + """RealUserTestNetworkResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RealUserTestNetworkResults: + """Test RealUserTestNetworkResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RealUserTestNetworkResults` + """ + model = RealUserTestNetworkResults() + if include_optional: + return RealUserTestNetworkResults( + results = [ + test_results_api.models.real_user_test_network_result.RealUserTestNetworkResult( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + date = '2022-07-17T22:00:54Z', + id = '07625:1490529480:aVDViw0i', + round_id = 1384309800, + destination = test_results_api.models.network_metrics.NetworkMetrics( + jitter = 46, + latency = 150, + loss = 0.1, + target = '54.208.6.220', ), + vpn = test_results_api.models.network_metrics.NetworkMetrics( + jitter = 46, + latency = 150, + loss = 0.1, + target = '54.208.6.220', ), + proxy = , + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), ) + ] + ) + else: + return RealUserTestNetworkResults( + ) + """ + + def testRealUserTestNetworkResults(self): + """Test RealUserTestNetworkResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_test_network_traceroute.py b/endpoint/test_results_api/test/test_real_user_test_network_traceroute.py new file mode 100644 index 00000000..c1a4eee5 --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_test_network_traceroute.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.real_user_test_network_traceroute import RealUserTestNetworkTraceroute + +class TestRealUserTestNetworkTraceroute(unittest.TestCase): + """RealUserTestNetworkTraceroute unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RealUserTestNetworkTraceroute: + """Test RealUserTestNetworkTraceroute + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RealUserTestNetworkTraceroute` + """ + model = RealUserTestNetworkTraceroute() + if include_optional: + return RealUserTestNetworkTraceroute( + destination = '13.32.22.232', + error = 'An operation timed out.', + info_flags = [TE_INFO_ICMP_BLOCKED_BY_FIREWALL], + internal_errors = [TE_INFO_ICMP_BLOCKED_BY_FIREWALL], + hops = [ + null + ] + ) + else: + return RealUserTestNetworkTraceroute( + ) + """ + + def testRealUserTestNetworkTraceroute(self): + """Test RealUserTestNetworkTraceroute""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_test_network_vpn_ping.py b/endpoint/test_results_api/test/test_real_user_test_network_vpn_ping.py new file mode 100644 index 00000000..0653a16e --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_test_network_vpn_ping.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.real_user_test_network_vpn_ping import RealUserTestNetworkVpnPing + +class TestRealUserTestNetworkVpnPing(unittest.TestCase): + """RealUserTestNetworkVpnPing unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RealUserTestNetworkVpnPing: + """Test RealUserTestNetworkVpnPing + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RealUserTestNetworkVpnPing` + """ + model = RealUserTestNetworkVpnPing() + if include_optional: + return RealUserTestNetworkVpnPing( + avg_rtt = 7, + max_rtt = 66, + mean_dev_rtt = 11, + min_rtt = 1, + pkts_received = 10, + pkts_sent = 10, + error = 'An operation timed out.', + info_flags = [TE_INFO_ICMP_BLOCKED_BY_FIREWALL] + ) + else: + return RealUserTestNetworkVpnPing( + ) + """ + + def testRealUserTestNetworkVpnPing(self): + """Test RealUserTestNetworkVpnPing""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_test_network_vpn_traceroute.py b/endpoint/test_results_api/test/test_real_user_test_network_vpn_traceroute.py new file mode 100644 index 00000000..44fdc00e --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_test_network_vpn_traceroute.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.real_user_test_network_vpn_traceroute import RealUserTestNetworkVpnTraceroute + +class TestRealUserTestNetworkVpnTraceroute(unittest.TestCase): + """RealUserTestNetworkVpnTraceroute unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RealUserTestNetworkVpnTraceroute: + """Test RealUserTestNetworkVpnTraceroute + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RealUserTestNetworkVpnTraceroute` + """ + model = RealUserTestNetworkVpnTraceroute() + if include_optional: + return RealUserTestNetworkVpnTraceroute( + destination = '13.32.22.232', + error = 'An operation timed out.', + info_flags = [TE_INFO_ICMP_BLOCKED_BY_FIREWALL], + internal_errors = [TE_INFO_ICMP_BLOCKED_BY_FIREWALL], + hops = [ + null + ] + ) + else: + return RealUserTestNetworkVpnTraceroute( + ) + """ + + def testRealUserTestNetworkVpnTraceroute(self): + """Test RealUserTestNetworkVpnTraceroute""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_test_page.py b/endpoint/test_results_api/test/test_real_user_test_page.py new file mode 100644 index 00000000..adb14c43 --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_test_page.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.real_user_test_page import RealUserTestPage + +class TestRealUserTestPage(unittest.TestCase): + """RealUserTestPage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RealUserTestPage: + """Test RealUserTestPage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RealUserTestPage` + """ + model = RealUserTestPage() + if include_optional: + return RealUserTestPage( + page_id = 'C31gBrYJ', + page_title = 'Network Performance Resources | ThousandEyes', + page_url = 'https://app.thousandeyes.com/settings/integrations', + load_date = '2022-07-17T22:00:54Z', + response_code = 200, + page_timings = test_results_api.models.real_user_test_page_page_timings.RealUserTestPage_pageTimings( + on_content_load = 1483, + on_load = 4569, ) + ) + else: + return RealUserTestPage( + ) + """ + + def testRealUserTestPage(self): + """Test RealUserTestPage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_test_page_page_timings.py b/endpoint/test_results_api/test/test_real_user_test_page_page_timings.py new file mode 100644 index 00000000..0f35d90a --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_test_page_page_timings.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.real_user_test_page_page_timings import RealUserTestPagePageTimings + +class TestRealUserTestPagePageTimings(unittest.TestCase): + """RealUserTestPagePageTimings unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RealUserTestPagePageTimings: + """Test RealUserTestPagePageTimings + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RealUserTestPagePageTimings` + """ + model = RealUserTestPagePageTimings() + if include_optional: + return RealUserTestPagePageTimings( + on_content_load = 1483, + on_load = 4569 + ) + else: + return RealUserTestPagePageTimings( + ) + """ + + def testRealUserTestPagePageTimings(self): + """Test RealUserTestPagePageTimings""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_test_page_result.py b/endpoint/test_results_api/test/test_real_user_test_page_result.py new file mode 100644 index 00000000..efd17d67 --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_test_page_result.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.real_user_test_page_result import RealUserTestPageResult + +class TestRealUserTestPageResult(unittest.TestCase): + """RealUserTestPageResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RealUserTestPageResult: + """Test RealUserTestPageResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RealUserTestPageResult` + """ + model = RealUserTestPageResult() + if include_optional: + return RealUserTestPageResult( + page_id = 'C31gBrYJ', + page_title = 'Network Performance Resources | ThousandEyes', + page_url = 'https://app.thousandeyes.com/settings/integrations', + load_date = '2022-07-17T22:00:54Z', + response_code = 200, + page_timings = test_results_api.models.real_user_test_page_page_timings.RealUserTestPage_pageTimings( + on_content_load = 1483, + on_load = 4569, ), + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + id = '07625:1490529480:aVDViw0i', + round_id = 1384309800, + response_time = 240, + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ) + ) + else: + return RealUserTestPageResult( + ) + """ + + def testRealUserTestPageResult(self): + """Test RealUserTestPageResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_test_page_results.py b/endpoint/test_results_api/test/test_real_user_test_page_results.py new file mode 100644 index 00000000..b91b54f1 --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_test_page_results.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.real_user_test_page_results import RealUserTestPageResults + +class TestRealUserTestPageResults(unittest.TestCase): + """RealUserTestPageResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RealUserTestPageResults: + """Test RealUserTestPageResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RealUserTestPageResults` + """ + model = RealUserTestPageResults() + if include_optional: + return RealUserTestPageResults( + results = [ + null + ] + ) + else: + return RealUserTestPageResults( + ) + """ + + def testRealUserTestPageResults(self): + """Test RealUserTestPageResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_real_user_tests_results_api.py b/endpoint/test_results_api/test/test_real_user_tests_results_api.py new file mode 100644 index 00000000..0090b756 --- /dev/null +++ b/endpoint/test_results_api/test/test_real_user_tests_results_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest + +from test_results_api.api.real_user_tests_results_api import RealUserTestsResultsApi + + +class TestRealUserTestsResultsApi(unittest.TestCase): + """RealUserTestsResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = RealUserTestsResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_endpoint_real_user_test_details(self) -> None: + """Test case for get_endpoint_real_user_test_details + + Retrieve endpoint real user test + """ + pass + + def test_get_endpoint_real_user_test_pages_details(self) -> None: + """Test case for get_endpoint_real_user_test_pages_details + + Retrieve endpoint real user test page + """ + pass + + def test_get_endpoint_real_user_tests(self) -> None: + """Test case for get_endpoint_real_user_tests + + List endpoint real user tests + """ + pass + + def test_get_endpoint_real_user_tests_network(self) -> None: + """Test case for get_endpoint_real_user_tests_network + + List endpoint real user tests + """ + pass + + def test_get_endpoint_real_user_tests_pages(self) -> None: + """Test case for get_endpoint_real_user_tests_pages + + List endpoint real user tests visited pages + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_self_links.py b/endpoint/test_results_api/test/test_self_links.py new file mode 100644 index 00000000..94f1acf8 --- /dev/null +++ b/endpoint/test_results_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_self_links_links.py b/endpoint/test_results_api/test/test_self_links_links.py new file mode 100644 index 00000000..1769f256 --- /dev/null +++ b/endpoint/test_results_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_sort_order.py b/endpoint/test_results_api/test/test_sort_order.py new file mode 100644 index 00000000..8688393f --- /dev/null +++ b/endpoint/test_results_api/test/test_sort_order.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.sort_order import SortOrder + +class TestSortOrder(unittest.TestCase): + """SortOrder unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSortOrder(self): + """Test SortOrder""" + # inst = SortOrder() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_specific_agents_selector_type.py b/endpoint/test_results_api/test/test_specific_agents_selector_type.py new file mode 100644 index 00000000..4206cbe2 --- /dev/null +++ b/endpoint/test_results_api/test/test_specific_agents_selector_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.specific_agents_selector_type import SpecificAgentsSelectorType + +class TestSpecificAgentsSelectorType(unittest.TestCase): + """SpecificAgentsSelectorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSpecificAgentsSelectorType(self): + """Test SpecificAgentsSelectorType""" + # inst = SpecificAgentsSelectorType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_system_metrics.py b/endpoint/test_results_api/test/test_system_metrics.py new file mode 100644 index 00000000..ec23465e --- /dev/null +++ b/endpoint/test_results_api/test/test_system_metrics.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.system_metrics import SystemMetrics + +class TestSystemMetrics(unittest.TestCase): + """SystemMetrics unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SystemMetrics: + """Test SystemMetrics + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SystemMetrics` + """ + model = SystemMetrics() + if include_optional: + return SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024 + ) + else: + return SystemMetrics( + ) + """ + + def testSystemMetrics(self): + """Test SystemMetrics""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_tcp_connect.py b/endpoint/test_results_api/test/test_tcp_connect.py new file mode 100644 index 00000000..72edc400 --- /dev/null +++ b/endpoint/test_results_api/test/test_tcp_connect.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.tcp_connect import TcpConnect + +class TestTcpConnect(unittest.TestCase): + """TcpConnect unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TcpConnect: + """Test TcpConnect + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TcpConnect` + """ + model = TcpConnect() + if include_optional: + return TcpConnect( + rtt = 77.777, + error_code = 'ERR_TIMED_OUT', + error = 'An operation timed out.', + info_flags = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"] + ) + else: + return TcpConnect( + ) + """ + + def testTcpConnect(self): + """Test TcpConnect""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_test_interval.py b/endpoint/test_results_api/test/test_test_interval.py new file mode 100644 index 00000000..9be55da4 --- /dev/null +++ b/endpoint/test_results_api/test/test_test_interval.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.test_interval import TestInterval + +class TestTestInterval(unittest.TestCase): + """TestInterval unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestInterval(self): + """Test TestInterval""" + # inst = TestInterval() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_test_probe_mode.py b/endpoint/test_results_api/test/test_test_probe_mode.py new file mode 100644 index 00000000..8f44863a --- /dev/null +++ b/endpoint/test_results_api/test/test_test_probe_mode.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.test_probe_mode import TestProbeMode + +class TestTestProbeMode(unittest.TestCase): + """TestProbeMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestProbeMode(self): + """Test TestProbeMode""" + # inst = TestProbeMode() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_test_result.py b/endpoint/test_results_api/test/test_test_result.py new file mode 100644 index 00000000..d0c8de7b --- /dev/null +++ b/endpoint/test_results_api/test/test_test_result.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.test_result import TestResult + +class TestTestResult(unittest.TestCase): + """TestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestResult: + """Test TestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestResult` + """ + model = TestResult() + if include_optional: + return TestResult( + agent_id = '861b7557-cd57-4bbb-b648-00bddf88ef49', + aid = test_results_api.models.account_group_id.AccountGroupId( + aid = '11', ), + round_id = 1384309800, + server_ip = '185.199.108.153', + system_metrics = test_results_api.models.system_metrics.SystemMetrics( + start_time_ms = 1581508857327, + end_time_ms = 1581508867333, + cpu_utilization = test_results_api.models.cpu_utilization.CpuUtilization( + min = 0.22, + max = 0.75, + mean = 0.55, + median = 0.61, + std_dev = 0.01, + count = 150, ), + physical_memory_used_bytes = test_results_api.models.physical_memory_used_bytes.PhysicalMemoryUsedBytes( + min = 1.2, + max = 2.5, + mean = 1.77, + median = 1.85, + std_dev = 0.25, + count = 155, ), + physical_memory_total_bytes = 1024, ), + vpn_profile = test_results_api.models.vpn_profile.VpnProfile( + vpn_client_addresses = ["184.81.113.85","13.129.91.62"], + vpn_client_network_range = [ + '9.88.37.27' + ], + vpn_gateway_address = '120.98.134.7', + vpn_type = 'cisco-anyconnect', ) + ) + else: + return TestResult( + ) + """ + + def testTestResult(self): + """Test TestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_test_ssl_version_id.py b/endpoint/test_results_api/test/test_test_ssl_version_id.py new file mode 100644 index 00000000..e65b6e57 --- /dev/null +++ b/endpoint/test_results_api/test/test_test_ssl_version_id.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.test_ssl_version_id import TestSslVersionId + +class TestTestSslVersionId(unittest.TestCase): + """TestSslVersionId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestSslVersionId(self): + """Test TestSslVersionId""" + # inst = TestSslVersionId() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_tests_data_rounds_search.py b/endpoint/test_results_api/test/test_tests_data_rounds_search.py new file mode 100644 index 00000000..bd7ad644 --- /dev/null +++ b/endpoint/test_results_api/test/test_tests_data_rounds_search.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.tests_data_rounds_search import TestsDataRoundsSearch + +class TestTestsDataRoundsSearch(unittest.TestCase): + """TestsDataRoundsSearch unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestsDataRoundsSearch: + """Test TestsDataRoundsSearch + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestsDataRoundsSearch` + """ + model = TestsDataRoundsSearch() + if include_optional: + return TestsDataRoundsSearch( + search_sort = [ + test_results_api.models.tests_data_search_sort.TestsDataSearchSort( + sort = 'round-id', + order = 'desc', ) + ], + threshold_filter = test_results_api.models.tests_data_threshold_filters.TestsDataThresholdFilters( + filters = [ + test_results_api.models.tests_data_threshold_filter.TestsDataThresholdFilter( + name = 'loss', + value = 1.337, + operator = 'gte', ) + ], + conditional_operator = 'and', ), + search_filters = test_results_api.models.tests_data_search_filter.TestsDataSearchFilter( + agent_id = [ + '52455b09-ff1b-4849-8194-99026cc890e0' + ], ) + ) + else: + return TestsDataRoundsSearch( + ) + """ + + def testTestsDataRoundsSearch(self): + """Test TestsDataRoundsSearch""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_tests_data_search_filter.py b/endpoint/test_results_api/test/test_tests_data_search_filter.py new file mode 100644 index 00000000..d3750051 --- /dev/null +++ b/endpoint/test_results_api/test/test_tests_data_search_filter.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.tests_data_search_filter import TestsDataSearchFilter + +class TestTestsDataSearchFilter(unittest.TestCase): + """TestsDataSearchFilter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestsDataSearchFilter: + """Test TestsDataSearchFilter + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestsDataSearchFilter` + """ + model = TestsDataSearchFilter() + if include_optional: + return TestsDataSearchFilter( + agent_id = [ + '52455b09-ff1b-4849-8194-99026cc890e0' + ] + ) + else: + return TestsDataSearchFilter( + ) + """ + + def testTestsDataSearchFilter(self): + """Test TestsDataSearchFilter""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_tests_data_search_sort.py b/endpoint/test_results_api/test/test_tests_data_search_sort.py new file mode 100644 index 00000000..91b40127 --- /dev/null +++ b/endpoint/test_results_api/test/test_tests_data_search_sort.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.tests_data_search_sort import TestsDataSearchSort + +class TestTestsDataSearchSort(unittest.TestCase): + """TestsDataSearchSort unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestsDataSearchSort: + """Test TestsDataSearchSort + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestsDataSearchSort` + """ + model = TestsDataSearchSort() + if include_optional: + return TestsDataSearchSort( + sort = 'round-id', + order = 'desc' + ) + else: + return TestsDataSearchSort( + ) + """ + + def testTestsDataSearchSort(self): + """Test TestsDataSearchSort""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_tests_data_search_sort_key.py b/endpoint/test_results_api/test/test_tests_data_search_sort_key.py new file mode 100644 index 00000000..7747d1b5 --- /dev/null +++ b/endpoint/test_results_api/test/test_tests_data_search_sort_key.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.tests_data_search_sort_key import TestsDataSearchSortKey + +class TestTestsDataSearchSortKey(unittest.TestCase): + """TestsDataSearchSortKey unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestsDataSearchSortKey(self): + """Test TestsDataSearchSortKey""" + # inst = TestsDataSearchSortKey() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_tests_data_threshold_filter.py b/endpoint/test_results_api/test/test_tests_data_threshold_filter.py new file mode 100644 index 00000000..e48924a9 --- /dev/null +++ b/endpoint/test_results_api/test/test_tests_data_threshold_filter.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.tests_data_threshold_filter import TestsDataThresholdFilter + +class TestTestsDataThresholdFilter(unittest.TestCase): + """TestsDataThresholdFilter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestsDataThresholdFilter: + """Test TestsDataThresholdFilter + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestsDataThresholdFilter` + """ + model = TestsDataThresholdFilter() + if include_optional: + return TestsDataThresholdFilter( + name = 'loss', + value = 1.337, + operator = 'gte' + ) + else: + return TestsDataThresholdFilter( + ) + """ + + def testTestsDataThresholdFilter(self): + """Test TestsDataThresholdFilter""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_tests_data_threshold_filters.py b/endpoint/test_results_api/test/test_tests_data_threshold_filters.py new file mode 100644 index 00000000..eb626dec --- /dev/null +++ b/endpoint/test_results_api/test/test_tests_data_threshold_filters.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.tests_data_threshold_filters import TestsDataThresholdFilters + +class TestTestsDataThresholdFilters(unittest.TestCase): + """TestsDataThresholdFilters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestsDataThresholdFilters: + """Test TestsDataThresholdFilters + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestsDataThresholdFilters` + """ + model = TestsDataThresholdFilters() + if include_optional: + return TestsDataThresholdFilters( + filters = [ + test_results_api.models.tests_data_threshold_filter.TestsDataThresholdFilter( + name = 'loss', + value = 1.337, + operator = 'gte', ) + ], + conditional_operator = 'and' + ) + else: + return TestsDataThresholdFilters( + ) + """ + + def testTestsDataThresholdFilters(self): + """Test TestsDataThresholdFilters""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_threshold_filter_name.py b/endpoint/test_results_api/test/test_threshold_filter_name.py new file mode 100644 index 00000000..66966420 --- /dev/null +++ b/endpoint/test_results_api/test/test_threshold_filter_name.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.threshold_filter_name import ThresholdFilterName + +class TestThresholdFilterName(unittest.TestCase): + """ThresholdFilterName unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testThresholdFilterName(self): + """Test ThresholdFilterName""" + # inst = ThresholdFilterName() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_threshold_filter_operator.py b/endpoint/test_results_api/test/test_threshold_filter_operator.py new file mode 100644 index 00000000..fd28d351 --- /dev/null +++ b/endpoint/test_results_api/test/test_threshold_filter_operator.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.threshold_filter_operator import ThresholdFilterOperator + +class TestThresholdFilterOperator(unittest.TestCase): + """ThresholdFilterOperator unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testThresholdFilterOperator(self): + """Test ThresholdFilterOperator""" + # inst = ThresholdFilterOperator() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_traceroute.py b/endpoint/test_results_api/test/test_traceroute.py new file mode 100644 index 00000000..c23c75ac --- /dev/null +++ b/endpoint/test_results_api/test/test_traceroute.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.traceroute import Traceroute + +class TestTraceroute(unittest.TestCase): + """Traceroute unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Traceroute: + """Test Traceroute + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Traceroute` + """ + model = Traceroute() + if include_optional: + return Traceroute( + destination = '13.32.22.232', + error = 'An operation timed out.', + info_flags = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], + internal_errors = ["TE_INFO_ICMP_BLOCKED_BY_FIREWALL"], + hops = [ + null + ] + ) + else: + return Traceroute( + ) + """ + + def testTraceroute(self): + """Test Traceroute""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_traceroute_hop.py b/endpoint/test_results_api/test/test_traceroute_hop.py new file mode 100644 index 00000000..9929d72e --- /dev/null +++ b/endpoint/test_results_api/test/test_traceroute_hop.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.traceroute_hop import TracerouteHop + +class TestTracerouteHop(unittest.TestCase): + """TracerouteHop unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TracerouteHop: + """Test TracerouteHop + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TracerouteHop` + """ + model = TracerouteHop() + if include_optional: + return TracerouteHop( + hop = 1, + ip_address = '196.40.106.237', + prefix = '196.40.96.0/20', + asn = 34779, + delay = 5, + mpls = ["L=301472,E=0,S=1,T=1"], + name = '89-210-88-65.access.t-2.net' + ) + else: + return TracerouteHop( + ) + """ + + def testTracerouteHop(self): + """Test TracerouteHop""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_trigger.py b/endpoint/test_results_api/test/test_trigger.py new file mode 100644 index 00000000..f34f51b7 --- /dev/null +++ b/endpoint/test_results_api/test/test_trigger.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.trigger import Trigger + +class TestTrigger(unittest.TestCase): + """Trigger unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTrigger(self): + """Test Trigger""" + # inst = Trigger() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_unauthorized_error.py b/endpoint/test_results_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..3faf03af --- /dev/null +++ b/endpoint/test_results_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_vpn_profile.py b/endpoint/test_results_api/test/test_vpn_profile.py new file mode 100644 index 00000000..41908f84 --- /dev/null +++ b/endpoint/test_results_api/test/test_vpn_profile.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.vpn_profile import VpnProfile + +class TestVpnProfile(unittest.TestCase): + """VpnProfile unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VpnProfile: + """Test VpnProfile + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VpnProfile` + """ + model = VpnProfile() + if include_optional: + return VpnProfile( + vpn_client_addresses = ["184.81.113.85","13.129.91.62"], + vpn_client_network_range = [ + '9.88.37.27' + ], + vpn_gateway_address = '120.98.134.7', + vpn_type = 'cisco-anyconnect' + ) + else: + return VpnProfile( + ) + """ + + def testVpnProfile(self): + """Test VpnProfile""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_vpn_type.py b/endpoint/test_results_api/test/test_vpn_type.py new file mode 100644 index 00000000..8cc77c3b --- /dev/null +++ b/endpoint/test_results_api/test/test_vpn_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest +import datetime + +from test_results_api.models.vpn_type import VpnType + +class TestVpnType(unittest.TestCase): + """VpnType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVpnType(self): + """Test VpnType""" + # inst = VpnType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test/test_web_http_server_scheduled_test_results_api.py b/endpoint/test_results_api/test/test_web_http_server_scheduled_test_results_api.py new file mode 100644 index 00000000..c1d3fb28 --- /dev/null +++ b/endpoint/test_results_api/test/test_web_http_server_scheduled_test_results_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 unittest + +from test_results_api.api.web_http_server_scheduled_test_results_api import WebHTTPServerScheduledTestResultsApi + + +class TestWebHTTPServerScheduledTestResultsApi(unittest.TestCase): + """WebHTTPServerScheduledTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = WebHTTPServerScheduledTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_result_http_server(self) -> None: + """Test case for get_test_result_http_server + + Retrieve HTTP server scheduled test results + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/test_results_api/test_results_api/__init__.py b/endpoint/test_results_api/test_results_api/__init__.py new file mode 100644 index 00000000..12e177ca --- /dev/null +++ b/endpoint/test_results_api/test_results_api/__init__.py @@ -0,0 +1,185 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.api.local_network_tests_results_api import LocalNetworkTestsResultsApi +from test_results_api.api.network_dynamic_tests_results_api import NetworkDynamicTestsResultsApi +from test_results_api.api.network_scheduled_tests_results_api import NetworkScheduledTestsResultsApi +from test_results_api.api.real_user_tests_results_api import RealUserTestsResultsApi +from test_results_api.api.web_http_server_scheduled_test_results_api import WebHTTPServerScheduledTestResultsApi + +# import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.api_client import ApiClient +from test_results_api.configuration import Configuration +from test_results_api.exceptions import OpenApiException +from test_results_api.exceptions import ApiTypeError +from test_results_api.exceptions import ApiValueError +from test_results_api.exceptions import ApiKeyError +from test_results_api.exceptions import ApiAttributeError +from test_results_api.exceptions import ApiException + +# import models into sdk package +from test_results_api.models.account_group_id import AccountGroupId +from test_results_api.models.agent_labels_selector_type import AgentLabelsSelectorType +from test_results_api.models.all_agents_selector_type import AllAgentsSelectorType +from test_results_api.models.application_score_quality import ApplicationScoreQuality +from test_results_api.models.asn_details import AsnDetails +from test_results_api.models.conditional_operator import ConditionalOperator +from test_results_api.models.cpu_utilization import CpuUtilization +from test_results_api.models.dynamic_base_test_result import DynamicBaseTestResult +from test_results_api.models.dynamic_base_test_result_webex import DynamicBaseTestResultWebex +from test_results_api.models.dynamic_test import DynamicTest +from test_results_api.models.dynamic_test_application import DynamicTestApplication +from test_results_api.models.dynamic_test_links import DynamicTestLinks +from test_results_api.models.dynamic_test_links_self import DynamicTestLinksSelf +from test_results_api.models.dynamic_test_links_test_results import DynamicTestLinksTestResults +from test_results_api.models.dynamic_tests_data_round_search import DynamicTestsDataRoundSearch +from test_results_api.models.dynamic_tests_data_search_filter import DynamicTestsDataSearchFilter +from test_results_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig +from test_results_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from test_results_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from test_results_api.models.endpoint_agent_to_server_type import EndpointAgentToServerType +from test_results_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig +from test_results_api.models.endpoint_browser import EndpointBrowser +from test_results_api.models.endpoint_http_data_point_score import EndpointHttpDataPointScore +from test_results_api.models.endpoint_http_server_base_test import EndpointHttpServerBaseTest +from test_results_api.models.endpoint_http_server_test import EndpointHttpServerTest +from test_results_api.models.endpoint_http_server_type import EndpointHttpServerType +from test_results_api.models.endpoint_network_topology_result_request_filter import EndpointNetworkTopologyResultRequestFilter +from test_results_api.models.endpoint_ping_data_point_score import EndpointPingDataPointScore +from test_results_api.models.endpoint_real_user_test import EndpointRealUserTest +from test_results_api.models.endpoint_real_user_test_base import EndpointRealUserTestBase +from test_results_api.models.endpoint_real_user_test_detail import EndpointRealUserTestDetail +from test_results_api.models.endpoint_real_user_test_detail_results import EndpointRealUserTestDetailResults +from test_results_api.models.endpoint_real_user_test_result_request_filter import EndpointRealUserTestResultRequestFilter +from test_results_api.models.endpoint_real_user_test_results import EndpointRealUserTestResults +from test_results_api.models.endpoint_result_request_filter import EndpointResultRequestFilter +from test_results_api.models.endpoint_scheduled_test import EndpointScheduledTest +from test_results_api.models.endpoint_scheduled_test_type import EndpointScheduledTestType +from test_results_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig +from test_results_api.models.endpoint_test import EndpointTest +from test_results_api.models.endpoint_test_aid import EndpointTestAid +from test_results_api.models.endpoint_test_auth_type import EndpointTestAuthType +from test_results_api.models.endpoint_test_links import EndpointTestLinks +from test_results_api.models.endpoint_test_links_self import EndpointTestLinksSelf +from test_results_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults +from test_results_api.models.endpoint_test_protocol import EndpointTestProtocol +from test_results_api.models.error import Error +from test_results_api.models.ethernet_profile import EthernetProfile +from test_results_api.models.expand import Expand +from test_results_api.models.get_dynamic_test_result_network_pathvis200_response import GetDynamicTestResultNetworkPathvis200Response +from test_results_api.models.get_dynamic_test_result_pathvis_agent_round200_response import GetDynamicTestResultPathvisAgentRound200Response +from test_results_api.models.get_endpoint_local_network_topology_details200_response import GetEndpointLocalNetworkTopologyDetails200Response +from test_results_api.models.get_endpoint_local_networks200_response import GetEndpointLocalNetworks200Response +from test_results_api.models.get_endpoint_local_networks_topologies200_response import GetEndpointLocalNetworksTopologies200Response +from test_results_api.models.get_endpoint_local_networks_topologies_request import GetEndpointLocalNetworksTopologiesRequest +from test_results_api.models.get_endpoint_real_user_test_details200_response import GetEndpointRealUserTestDetails200Response +from test_results_api.models.get_endpoint_real_user_test_pages_details200_response import GetEndpointRealUserTestPagesDetails200Response +from test_results_api.models.get_endpoint_real_user_tests200_response import GetEndpointRealUserTests200Response +from test_results_api.models.get_endpoint_real_user_tests_network200_response import GetEndpointRealUserTestsNetwork200Response +from test_results_api.models.get_endpoint_real_user_tests_pages200_response import GetEndpointRealUserTestsPages200Response +from test_results_api.models.get_endpoint_real_user_tests_request import GetEndpointRealUserTestsRequest +from test_results_api.models.get_test_result_http_server200_response import GetTestResultHttpServer200Response +from test_results_api.models.get_test_result_network_pathvis200_response import GetTestResultNetworkPathvis200Response +from test_results_api.models.get_test_result_pathvis_agent_round200_response import GetTestResultPathvisAgentRound200Response +from test_results_api.models.hop import Hop +from test_results_api.models.http_error_type import HttpErrorType +from test_results_api.models.http_test_result import HttpTestResult +from test_results_api.models.http_test_result_headers import HttpTestResultHeaders +from test_results_api.models.http_test_results import HttpTestResults +from test_results_api.models.interface_hardware_type import InterfaceHardwareType +from test_results_api.models.link import Link +from test_results_api.models.local_network_result import LocalNetworkResult +from test_results_api.models.local_network_results import LocalNetworkResults +from test_results_api.models.local_network_topology_detail_results import LocalNetworkTopologyDetailResults +from test_results_api.models.local_network_topology_result import LocalNetworkTopologyResult +from test_results_api.models.local_network_topology_result_base import LocalNetworkTopologyResultBase +from test_results_api.models.local_network_topology_results import LocalNetworkTopologyResults +from test_results_api.models.multi_test_id_network_test_results import MultiTestIdNetworkTestResults +from test_results_api.models.multi_test_id_tests_data_rounds_search import MultiTestIdTestsDataRoundsSearch +from test_results_api.models.multi_test_id_tests_data_search_filter import MultiTestIdTestsDataSearchFilter +from test_results_api.models.network_dynamic_test_result import NetworkDynamicTestResult +from test_results_api.models.network_dynamic_test_results import NetworkDynamicTestResults +from test_results_api.models.network_interface import NetworkInterface +from test_results_api.models.network_metrics import NetworkMetrics +from test_results_api.models.network_ping import NetworkPing +from test_results_api.models.network_profile import NetworkProfile +from test_results_api.models.network_proxy_profile import NetworkProxyProfile +from test_results_api.models.network_proxy_profile_proxies_inner import NetworkProxyProfileProxiesInner +from test_results_api.models.network_test_result import NetworkTestResult +from test_results_api.models.network_test_results import NetworkTestResults +from test_results_api.models.network_topology_type import NetworkTopologyType +from test_results_api.models.network_wireless_profile import NetworkWirelessProfile +from test_results_api.models.pagination_next_link import PaginationNextLink +from test_results_api.models.pagination_next_link_links import PaginationNextLinkLinks +from test_results_api.models.path_vis_base_test_result import PathVisBaseTestResult +from test_results_api.models.path_vis_detail_dynamic_test_result import PathVisDetailDynamicTestResult +from test_results_api.models.path_vis_detail_dynamic_test_results import PathVisDetailDynamicTestResults +from test_results_api.models.path_vis_detail_test_result import PathVisDetailTestResult +from test_results_api.models.path_vis_detail_test_results import PathVisDetailTestResults +from test_results_api.models.path_vis_dynamic_test_result import PathVisDynamicTestResult +from test_results_api.models.path_vis_dynamic_test_results import PathVisDynamicTestResults +from test_results_api.models.path_vis_endpoint import PathVisEndpoint +from test_results_api.models.path_vis_hop import PathVisHop +from test_results_api.models.path_vis_route import PathVisRoute +from test_results_api.models.path_vis_test_result import PathVisTestResult +from test_results_api.models.path_vis_test_results import PathVisTestResults +from test_results_api.models.physical_memory_used_bytes import PhysicalMemoryUsedBytes +from test_results_api.models.platform import Platform +from test_results_api.models.post_fetch_dynamic_test_result_metrics200_response import PostFetchDynamicTestResultMetrics200Response +from test_results_api.models.post_fetch_test_result_metrics200_response import PostFetchTestResultMetrics200Response +from test_results_api.models.post_fetch_test_result_metrics_multi_test200_response import PostFetchTestResultMetricsMultiTest200Response +from test_results_api.models.query_window import QueryWindow +from test_results_api.models.real_user_test_coordinates import RealUserTestCoordinates +from test_results_api.models.real_user_test_network import RealUserTestNetwork +from test_results_api.models.real_user_test_network_gateway_ping import RealUserTestNetworkGatewayPing +from test_results_api.models.real_user_test_network_ping import RealUserTestNetworkPing +from test_results_api.models.real_user_test_network_result import RealUserTestNetworkResult +from test_results_api.models.real_user_test_network_results import RealUserTestNetworkResults +from test_results_api.models.real_user_test_network_traceroute import RealUserTestNetworkTraceroute +from test_results_api.models.real_user_test_network_vpn_ping import RealUserTestNetworkVpnPing +from test_results_api.models.real_user_test_network_vpn_traceroute import RealUserTestNetworkVpnTraceroute +from test_results_api.models.real_user_test_page import RealUserTestPage +from test_results_api.models.real_user_test_page_page_timings import RealUserTestPagePageTimings +from test_results_api.models.real_user_test_page_result import RealUserTestPageResult +from test_results_api.models.real_user_test_page_results import RealUserTestPageResults +from test_results_api.models.self_links import SelfLinks +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.sort_order import SortOrder +from test_results_api.models.specific_agents_selector_type import SpecificAgentsSelectorType +from test_results_api.models.system_metrics import SystemMetrics +from test_results_api.models.tcp_connect import TcpConnect +from test_results_api.models.test_interval import TestInterval +from test_results_api.models.test_probe_mode import TestProbeMode +from test_results_api.models.test_result import TestResult +from test_results_api.models.test_ssl_version_id import TestSslVersionId +from test_results_api.models.tests_data_rounds_search import TestsDataRoundsSearch +from test_results_api.models.tests_data_search_filter import TestsDataSearchFilter +from test_results_api.models.tests_data_search_sort import TestsDataSearchSort +from test_results_api.models.tests_data_search_sort_key import TestsDataSearchSortKey +from test_results_api.models.tests_data_threshold_filter import TestsDataThresholdFilter +from test_results_api.models.tests_data_threshold_filters import TestsDataThresholdFilters +from test_results_api.models.threshold_filter_name import ThresholdFilterName +from test_results_api.models.threshold_filter_operator import ThresholdFilterOperator +from test_results_api.models.traceroute import Traceroute +from test_results_api.models.traceroute_hop import TracerouteHop +from test_results_api.models.trigger import Trigger +from test_results_api.models.unauthorized_error import UnauthorizedError +from test_results_api.models.vpn_profile import VpnProfile +from test_results_api.models.vpn_type import VpnType diff --git a/endpoint/test_results_api/test_results_api/api/__init__.py b/endpoint/test_results_api/test_results_api/api/__init__.py new file mode 100644 index 00000000..b4880ee2 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/api/__init__.py @@ -0,0 +1,9 @@ +# flake8: noqa + +# import apis into api package +from test_results_api.api.local_network_tests_results_api import LocalNetworkTestsResultsApi +from test_results_api.api.network_dynamic_tests_results_api import NetworkDynamicTestsResultsApi +from test_results_api.api.network_scheduled_tests_results_api import NetworkScheduledTestsResultsApi +from test_results_api.api.real_user_tests_results_api import RealUserTestsResultsApi +from test_results_api.api.web_http_server_scheduled_test_results_api import WebHTTPServerScheduledTestResultsApi + diff --git a/endpoint/test_results_api/test_results_api/api/local_network_tests_results_api.py b/endpoint/test_results_api/test_results_api/api/local_network_tests_results_api.py new file mode 100644 index 00000000..6f4f4d6e --- /dev/null +++ b/endpoint/test_results_api/test_results_api/api/local_network_tests_results_api.py @@ -0,0 +1,1035 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from test_results_api.models.get_endpoint_local_network_topology_details200_response import GetEndpointLocalNetworkTopologyDetails200Response +from test_results_api.models.get_endpoint_local_networks200_response import GetEndpointLocalNetworks200Response +from test_results_api.models.get_endpoint_local_networks_topologies200_response import GetEndpointLocalNetworksTopologies200Response +from test_results_api.models.get_endpoint_local_networks_topologies_request import GetEndpointLocalNetworksTopologiesRequest + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class LocalNetworkTestsResultsApi: + """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_endpoint_local_network_topology_details( + self, + network_topology_id: Annotated[StrictStr, Field(description="The network topology ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetEndpointLocalNetworkTopologyDetails200Response: + """Retrieve endpoint local network topology + + Returns detailed data of a local network topology. + + :param network_topology_id: The network topology ID. (required) + :type network_topology_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_endpoint_local_network_topology_details_serialize( + network_topology_id=network_topology_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': "GetEndpointLocalNetworkTopologyDetails200Response", + '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_endpoint_local_network_topology_details_with_http_info( + self, + network_topology_id: Annotated[StrictStr, Field(description="The network topology ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetEndpointLocalNetworkTopologyDetails200Response]: + """Retrieve endpoint local network topology + + Returns detailed data of a local network topology. + + :param network_topology_id: The network topology ID. (required) + :type network_topology_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_endpoint_local_network_topology_details_serialize( + network_topology_id=network_topology_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': "GetEndpointLocalNetworkTopologyDetails200Response", + '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_endpoint_local_network_topology_details_without_preload_content( + self, + network_topology_id: Annotated[StrictStr, Field(description="The network topology ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve endpoint local network topology + + Returns detailed data of a local network topology. + + :param network_topology_id: The network topology ID. (required) + :type network_topology_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_endpoint_local_network_topology_details_serialize( + network_topology_id=network_topology_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': "GetEndpointLocalNetworkTopologyDetails200Response", + '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_endpoint_local_network_topology_details_serialize( + self, + network_topology_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 network_topology_id is not None: + _path_params['networkTopologyId'] = network_topology_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/endpoint/test-results/local-networks/topologies/{networkTopologyId}', + 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_endpoint_local_networks( + 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, + ) -> GetEndpointLocalNetworks200Response: + """List local networks + + Returns a list of all the networks used by endpoint agents. Sends back a `localNetworks` array. + + :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_endpoint_local_networks_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': "GetEndpointLocalNetworks200Response", + '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_endpoint_local_networks_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[GetEndpointLocalNetworks200Response]: + """List local networks + + Returns a list of all the networks used by endpoint agents. Sends back a `localNetworks` array. + + :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_endpoint_local_networks_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': "GetEndpointLocalNetworks200Response", + '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_endpoint_local_networks_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 local networks + + Returns a list of all the networks used by endpoint agents. Sends back a `localNetworks` array. + + :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_endpoint_local_networks_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': "GetEndpointLocalNetworks200Response", + '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_endpoint_local_networks_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/endpoint/test-results/local-networks', + 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_endpoint_local_networks_topologies( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + get_endpoint_local_networks_topologies_request: Optional[GetEndpointLocalNetworksTopologiesRequest] = 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, + ) -> GetEndpointLocalNetworksTopologies200Response: + """List endpoint network topologies probes + + Returns a list of all endpoint local network topologies probes. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter?window=12h' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Warning Note that a maximum of 12h worth of data can be retrieved at once. If you need more, you need to make multiple requests. Returns a `results` array of network topology probes. Network topology probes shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param get_endpoint_local_networks_topologies_request: + :type get_endpoint_local_networks_topologies_request: GetEndpointLocalNetworksTopologiesRequest + :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_endpoint_local_networks_topologies_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + get_endpoint_local_networks_topologies_request=get_endpoint_local_networks_topologies_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointLocalNetworksTopologies200Response", + '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 get_endpoint_local_networks_topologies_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + get_endpoint_local_networks_topologies_request: Optional[GetEndpointLocalNetworksTopologiesRequest] = 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[GetEndpointLocalNetworksTopologies200Response]: + """List endpoint network topologies probes + + Returns a list of all endpoint local network topologies probes. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter?window=12h' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Warning Note that a maximum of 12h worth of data can be retrieved at once. If you need more, you need to make multiple requests. Returns a `results` array of network topology probes. Network topology probes shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param get_endpoint_local_networks_topologies_request: + :type get_endpoint_local_networks_topologies_request: GetEndpointLocalNetworksTopologiesRequest + :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_endpoint_local_networks_topologies_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + get_endpoint_local_networks_topologies_request=get_endpoint_local_networks_topologies_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointLocalNetworksTopologies200Response", + '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 get_endpoint_local_networks_topologies_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + get_endpoint_local_networks_topologies_request: Optional[GetEndpointLocalNetworksTopologiesRequest] = 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 endpoint network topologies probes + + Returns a list of all endpoint local network topologies probes. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter?window=12h' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Warning Note that a maximum of 12h worth of data can be retrieved at once. If you need more, you need to make multiple requests. Returns a `results` array of network topology probes. Network topology probes shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param get_endpoint_local_networks_topologies_request: + :type get_endpoint_local_networks_topologies_request: GetEndpointLocalNetworksTopologiesRequest + :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_endpoint_local_networks_topologies_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + get_endpoint_local_networks_topologies_request=get_endpoint_local_networks_topologies_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointLocalNetworksTopologies200Response", + '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 _get_endpoint_local_networks_topologies_serialize( + self, + aid, + window, + start_date, + end_date, + cursor, + get_endpoint_local_networks_topologies_request, + _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)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if get_endpoint_local_networks_topologies_request is not None: + _body_params = get_endpoint_local_networks_topologies_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/endpoint/test-results/local-networks/topologies/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/test_results_api/test_results_api/api/network_dynamic_tests_results_api.py b/endpoint/test_results_api/test_results_api/api/network_dynamic_tests_results_api.py new file mode 100644 index 00000000..6a28b997 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/api/network_dynamic_tests_results_api.py @@ -0,0 +1,1181 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from test_results_api.models.dynamic_tests_data_round_search import DynamicTestsDataRoundSearch +from test_results_api.models.get_dynamic_test_result_network_pathvis200_response import GetDynamicTestResultNetworkPathvis200Response +from test_results_api.models.get_dynamic_test_result_pathvis_agent_round200_response import GetDynamicTestResultPathvisAgentRound200Response +from test_results_api.models.post_fetch_dynamic_test_result_metrics200_response import PostFetchDynamicTestResultMetrics200Response + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class NetworkDynamicTestsResultsApi: + """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_dynamic_test_result_network_pathvis( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetDynamicTestResultNetworkPathvis200Response: + """Retrieve pathvis network dynamic test results + + Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours will be returned. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dynamic_test_result_network_pathvis_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetDynamicTestResultNetworkPathvis200Response", + '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_dynamic_test_result_network_pathvis_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetDynamicTestResultNetworkPathvis200Response]: + """Retrieve pathvis network dynamic test results + + Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours will be returned. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dynamic_test_result_network_pathvis_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetDynamicTestResultNetworkPathvis200Response", + '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_dynamic_test_result_network_pathvis_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve pathvis network dynamic test results + + Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours will be returned. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dynamic_test_result_network_pathvis_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetDynamicTestResultNetworkPathvis200Response", + '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_dynamic_test_result_network_pathvis_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/endpoint/test-results/dynamic-tests/{testId}/pathvis', + 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_dynamic_test_result_pathvis_agent_round( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetDynamicTestResultPathvisAgentRound200Response: + """Retrieve pathvis network dynamic test results details + + Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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_dynamic_test_result_pathvis_agent_round_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_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': "GetDynamicTestResultPathvisAgentRound200Response", + '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 get_dynamic_test_result_pathvis_agent_round_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetDynamicTestResultPathvisAgentRound200Response]: + """Retrieve pathvis network dynamic test results details + + Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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_dynamic_test_result_pathvis_agent_round_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_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': "GetDynamicTestResultPathvisAgentRound200Response", + '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 get_dynamic_test_result_pathvis_agent_round_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve pathvis network dynamic test results details + + Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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_dynamic_test_result_pathvis_agent_round_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_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': "GetDynamicTestResultPathvisAgentRound200Response", + '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 _get_dynamic_test_result_pathvis_agent_round_serialize( + self, + test_id, + agent_id, + round_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 test_id is not None: + _path_params['testId'] = test_id + if agent_id is not None: + _path_params['agentId'] = agent_id + if round_id is not None: + _path_params['roundId'] = round_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/endpoint/test-results/dynamic-tests/{testId}/pathvis/agent/{agentId}/round/{roundId}', + 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 post_fetch_dynamic_test_result_metrics( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + dynamic_tests_data_round_search: Annotated[Optional[DynamicTestsDataRoundSearch], Field(description="Tests data search filters.")] = 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, + ) -> PostFetchDynamicTestResultMetrics200Response: + """Retrieve network dynamic test results + + Returns network metrics (`loss`, `latency`, `jitter` and `bandwidth`) from each endpoint agent, for each `roundId` in the requested window. When Time Frame is provided the rounds specific to the time frame is returned and the order is not pre-defined unless a user specifies the sort order in filter. When no time frame is provided the latest rounds are returned. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param dynamic_tests_data_round_search: Tests data search filters. + :type dynamic_tests_data_round_search: DynamicTestsDataRoundSearch + :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._post_fetch_dynamic_test_result_metrics_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + dynamic_tests_data_round_search=dynamic_tests_data_round_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostFetchDynamicTestResultMetrics200Response", + '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 post_fetch_dynamic_test_result_metrics_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + dynamic_tests_data_round_search: Annotated[Optional[DynamicTestsDataRoundSearch], Field(description="Tests data search filters.")] = 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[PostFetchDynamicTestResultMetrics200Response]: + """Retrieve network dynamic test results + + Returns network metrics (`loss`, `latency`, `jitter` and `bandwidth`) from each endpoint agent, for each `roundId` in the requested window. When Time Frame is provided the rounds specific to the time frame is returned and the order is not pre-defined unless a user specifies the sort order in filter. When no time frame is provided the latest rounds are returned. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param dynamic_tests_data_round_search: Tests data search filters. + :type dynamic_tests_data_round_search: DynamicTestsDataRoundSearch + :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._post_fetch_dynamic_test_result_metrics_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + dynamic_tests_data_round_search=dynamic_tests_data_round_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostFetchDynamicTestResultMetrics200Response", + '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 post_fetch_dynamic_test_result_metrics_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + dynamic_tests_data_round_search: Annotated[Optional[DynamicTestsDataRoundSearch], Field(description="Tests data search filters.")] = 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 network dynamic test results + + Returns network metrics (`loss`, `latency`, `jitter` and `bandwidth`) from each endpoint agent, for each `roundId` in the requested window. When Time Frame is provided the rounds specific to the time frame is returned and the order is not pre-defined unless a user specifies the sort order in filter. When no time frame is provided the latest rounds are returned. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param dynamic_tests_data_round_search: Tests data search filters. + :type dynamic_tests_data_round_search: DynamicTestsDataRoundSearch + :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._post_fetch_dynamic_test_result_metrics_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + dynamic_tests_data_round_search=dynamic_tests_data_round_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostFetchDynamicTestResultMetrics200Response", + '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 _post_fetch_dynamic_test_result_metrics_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + dynamic_tests_data_round_search, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if dynamic_tests_data_round_search is not None: + _body_params = dynamic_tests_data_round_search + + + # 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/endpoint/test-results/dynamic-tests/{testId}/network/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/test_results_api/test_results_api/api/network_scheduled_tests_results_api.py b/endpoint/test_results_api/test_results_api/api/network_scheduled_tests_results_api.py new file mode 100644 index 00000000..c55726b2 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/api/network_scheduled_tests_results_api.py @@ -0,0 +1,1594 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 datetime import datetime + +from pydantic import StrictFloat, StrictInt, StrictStr, field_validator + +from typing import Optional, Union + +from test_results_api.models.get_test_result_network_pathvis200_response import GetTestResultNetworkPathvis200Response +from test_results_api.models.get_test_result_pathvis_agent_round200_response import GetTestResultPathvisAgentRound200Response +from test_results_api.models.multi_test_id_tests_data_rounds_search import MultiTestIdTestsDataRoundsSearch +from test_results_api.models.post_fetch_test_result_metrics200_response import PostFetchTestResultMetrics200Response +from test_results_api.models.post_fetch_test_result_metrics_multi_test200_response import PostFetchTestResultMetricsMultiTest200Response +from test_results_api.models.tests_data_rounds_search import TestsDataRoundsSearch + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class NetworkScheduledTestsResultsApi: + """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_test_result_network_pathvis( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultNetworkPathvis200Response: + """Retrieve pathvis network scheduled test results + + Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours is returned. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_network_pathvis_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultNetworkPathvis200Response", + '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_test_result_network_pathvis_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultNetworkPathvis200Response]: + """Retrieve pathvis network scheduled test results + + Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours is returned. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_network_pathvis_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultNetworkPathvis200Response", + '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_test_result_network_pathvis_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve pathvis network scheduled test results + + Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours is returned. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_network_pathvis_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultNetworkPathvis200Response", + '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_test_result_network_pathvis_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/endpoint/test-results/scheduled-tests/{testId}/pathvis', + 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_test_result_pathvis_agent_round( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultPathvisAgentRound200Response: + """Retrieve pathvis network scheduled test results details + + Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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_test_result_pathvis_agent_round_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_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': "GetTestResultPathvisAgentRound200Response", + '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_test_result_pathvis_agent_round_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultPathvisAgentRound200Response]: + """Retrieve pathvis network scheduled test results details + + Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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_test_result_pathvis_agent_round_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_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': "GetTestResultPathvisAgentRound200Response", + '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_test_result_pathvis_agent_round_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve pathvis network scheduled test results details + + Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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_test_result_pathvis_agent_round_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_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': "GetTestResultPathvisAgentRound200Response", + '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_test_result_pathvis_agent_round_serialize( + self, + test_id, + agent_id, + round_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 test_id is not None: + _path_params['testId'] = test_id + if agent_id is not None: + _path_params['agentId'] = agent_id + if round_id is not None: + _path_params['roundId'] = round_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/endpoint/test-results/scheduled-tests/{testId}/pathvis/agent/{agentId}/round/{roundId}', + 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 post_fetch_test_result_metrics( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + tests_data_rounds_search: Annotated[Optional[TestsDataRoundsSearch], Field(description="Tests data search filters.")] = 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, + ) -> PostFetchTestResultMetrics200Response: + """Retrieve network scheduled test results + + Returns network metrics (loss, latency, and jitter) from each endpoint agent, for each roundId within the specified time window, as determined by search filters. If a time frame is provided, the rounds relevant to that time frame are returned, and the order is not predefined unless the user specifies a sort order in the filter. When no time frame is provided, the latest rounds are returned. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param tests_data_rounds_search: Tests data search filters. + :type tests_data_rounds_search: TestsDataRoundsSearch + :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._post_fetch_test_result_metrics_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + tests_data_rounds_search=tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostFetchTestResultMetrics200Response", + '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 post_fetch_test_result_metrics_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + tests_data_rounds_search: Annotated[Optional[TestsDataRoundsSearch], Field(description="Tests data search filters.")] = 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[PostFetchTestResultMetrics200Response]: + """Retrieve network scheduled test results + + Returns network metrics (loss, latency, and jitter) from each endpoint agent, for each roundId within the specified time window, as determined by search filters. If a time frame is provided, the rounds relevant to that time frame are returned, and the order is not predefined unless the user specifies a sort order in the filter. When no time frame is provided, the latest rounds are returned. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param tests_data_rounds_search: Tests data search filters. + :type tests_data_rounds_search: TestsDataRoundsSearch + :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._post_fetch_test_result_metrics_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + tests_data_rounds_search=tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostFetchTestResultMetrics200Response", + '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 post_fetch_test_result_metrics_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + tests_data_rounds_search: Annotated[Optional[TestsDataRoundsSearch], Field(description="Tests data search filters.")] = 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 network scheduled test results + + Returns network metrics (loss, latency, and jitter) from each endpoint agent, for each roundId within the specified time window, as determined by search filters. If a time frame is provided, the rounds relevant to that time frame are returned, and the order is not predefined unless the user specifies a sort order in the filter. When no time frame is provided, the latest rounds are returned. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param tests_data_rounds_search: Tests data search filters. + :type tests_data_rounds_search: TestsDataRoundsSearch + :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._post_fetch_test_result_metrics_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + tests_data_rounds_search=tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostFetchTestResultMetrics200Response", + '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 _post_fetch_test_result_metrics_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + tests_data_rounds_search, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if tests_data_rounds_search is not None: + _body_params = tests_data_rounds_search + + + # 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/endpoint/test-results/scheduled-tests/{testId}/network/filter', + 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 post_fetch_test_result_metrics_multi_test( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + multi_test_id_tests_data_rounds_search: Annotated[Optional[MultiTestIdTestsDataRoundsSearch], Field(description="Test data search filters.")] = 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, + ) -> PostFetchTestResultMetricsMultiTest200Response: + """Retrieve network scheduled test results from multiple tests + + Returns network metrics, including loss, latency, and jitter, for multiple test IDs obtained from each endpoint agent. It allows you to specify a time window using search filters to retrieve metrics for specific round IDs within that time frame. The default order of results is unspecified unless you include a sorting preference in the filter. When no time frame is provided, the API returns metrics for the most recent rounds. Access to all accounts associated with the specified test IDs is required to use this endpoint. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param multi_test_id_tests_data_rounds_search: Test data search filters. + :type multi_test_id_tests_data_rounds_search: MultiTestIdTestsDataRoundsSearch + :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._post_fetch_test_result_metrics_multi_test_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + cursor=cursor, + multi_test_id_tests_data_rounds_search=multi_test_id_tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostFetchTestResultMetricsMultiTest200Response", + '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 post_fetch_test_result_metrics_multi_test_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + multi_test_id_tests_data_rounds_search: Annotated[Optional[MultiTestIdTestsDataRoundsSearch], Field(description="Test data search filters.")] = 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[PostFetchTestResultMetricsMultiTest200Response]: + """Retrieve network scheduled test results from multiple tests + + Returns network metrics, including loss, latency, and jitter, for multiple test IDs obtained from each endpoint agent. It allows you to specify a time window using search filters to retrieve metrics for specific round IDs within that time frame. The default order of results is unspecified unless you include a sorting preference in the filter. When no time frame is provided, the API returns metrics for the most recent rounds. Access to all accounts associated with the specified test IDs is required to use this endpoint. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param multi_test_id_tests_data_rounds_search: Test data search filters. + :type multi_test_id_tests_data_rounds_search: MultiTestIdTestsDataRoundsSearch + :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._post_fetch_test_result_metrics_multi_test_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + cursor=cursor, + multi_test_id_tests_data_rounds_search=multi_test_id_tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostFetchTestResultMetricsMultiTest200Response", + '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 post_fetch_test_result_metrics_multi_test_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + multi_test_id_tests_data_rounds_search: Annotated[Optional[MultiTestIdTestsDataRoundsSearch], Field(description="Test data search filters.")] = 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 network scheduled test results from multiple tests + + Returns network metrics, including loss, latency, and jitter, for multiple test IDs obtained from each endpoint agent. It allows you to specify a time window using search filters to retrieve metrics for specific round IDs within that time frame. The default order of results is unspecified unless you include a sorting preference in the filter. When no time frame is provided, the API returns metrics for the most recent rounds. Access to all accounts associated with the specified test IDs is required to use this endpoint. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: (Optional) Maximum number of objects to return. + :type max: float + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param multi_test_id_tests_data_rounds_search: Test data search filters. + :type multi_test_id_tests_data_rounds_search: MultiTestIdTestsDataRoundsSearch + :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._post_fetch_test_result_metrics_multi_test_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + cursor=cursor, + multi_test_id_tests_data_rounds_search=multi_test_id_tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostFetchTestResultMetricsMultiTest200Response", + '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 _post_fetch_test_result_metrics_multi_test_serialize( + self, + aid, + window, + start_date, + end_date, + max, + cursor, + multi_test_id_tests_data_rounds_search, + _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)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if max is not None: + + _query_params.append(('max', max)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if multi_test_id_tests_data_rounds_search is not None: + _body_params = multi_test_id_tests_data_rounds_search + + + # 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/endpoint/test-results/scheduled-tests/network/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/test_results_api/test_results_api/api/real_user_tests_results_api.py b/endpoint/test_results_api/test_results_api/api/real_user_tests_results_api.py new file mode 100644 index 00000000..cb5cd683 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/api/real_user_tests_results_api.py @@ -0,0 +1,1868 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from test_results_api.models.endpoint_real_user_test_result_request_filter import EndpointRealUserTestResultRequestFilter +from test_results_api.models.get_endpoint_real_user_test_details200_response import GetEndpointRealUserTestDetails200Response +from test_results_api.models.get_endpoint_real_user_test_pages_details200_response import GetEndpointRealUserTestPagesDetails200Response +from test_results_api.models.get_endpoint_real_user_tests200_response import GetEndpointRealUserTests200Response +from test_results_api.models.get_endpoint_real_user_tests_network200_response import GetEndpointRealUserTestsNetwork200Response +from test_results_api.models.get_endpoint_real_user_tests_pages200_response import GetEndpointRealUserTestsPages200Response +from test_results_api.models.get_endpoint_real_user_tests_request import GetEndpointRealUserTestsRequest + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class RealUserTestsResultsApi: + """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_endpoint_real_user_test_details( + self, + id: Annotated[StrictStr, Field(description="The real user test id.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetEndpointRealUserTestDetails200Response: + """Retrieve endpoint real user test + + Provides details for an endpoint real user test. Returns a results array containing detailed information about endpoint real user tests.\" + + :param id: The real user test id. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_real_user_test_details_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointRealUserTestDetails200Response", + '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_endpoint_real_user_test_details_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The real user test id.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetEndpointRealUserTestDetails200Response]: + """Retrieve endpoint real user test + + Provides details for an endpoint real user test. Returns a results array containing detailed information about endpoint real user tests.\" + + :param id: The real user test id. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_real_user_test_details_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointRealUserTestDetails200Response", + '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_endpoint_real_user_test_details_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The real user test id.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve endpoint real user test + + Provides details for an endpoint real user test. Returns a results array containing detailed information about endpoint real user tests.\" + + :param id: The real user test id. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_real_user_test_details_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointRealUserTestDetails200Response", + '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_endpoint_real_user_test_details_serialize( + self, + 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 id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/endpoint/test-results/real-user-tests/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_endpoint_real_user_test_pages_details( + self, + id: Annotated[StrictStr, Field(description="The real user test id.")], + page_id: Annotated[StrictStr, Field(description="Web page ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetEndpointRealUserTestPagesDetails200Response: + """Retrieve endpoint real user test page + + Returns details for endpoint real user test web page request. Provides complete waterfall information with all object requests. Sends back detailed endpoint real user test web page request. Returned object has a single field: `har` which is an HAR object according to the HTTP Archive 1.2 specifications. [You can read more about the specification](http://www.softwareishard.com/blog/har-12-spec/). In addition to standard fields, the object har includes a custom property `systemMetrics` which contain metrics about CPU and physical memory usage. Check `SystemMetrics` on schemas tab for more information. + + :param id: The real user test id. (required) + :type id: str + :param page_id: Web page ID (required) + :type page_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_endpoint_real_user_test_pages_details_serialize( + id=id, + page_id=page_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': "GetEndpointRealUserTestPagesDetails200Response", + '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_endpoint_real_user_test_pages_details_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The real user test id.")], + page_id: Annotated[StrictStr, Field(description="Web page ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetEndpointRealUserTestPagesDetails200Response]: + """Retrieve endpoint real user test page + + Returns details for endpoint real user test web page request. Provides complete waterfall information with all object requests. Sends back detailed endpoint real user test web page request. Returned object has a single field: `har` which is an HAR object according to the HTTP Archive 1.2 specifications. [You can read more about the specification](http://www.softwareishard.com/blog/har-12-spec/). In addition to standard fields, the object har includes a custom property `systemMetrics` which contain metrics about CPU and physical memory usage. Check `SystemMetrics` on schemas tab for more information. + + :param id: The real user test id. (required) + :type id: str + :param page_id: Web page ID (required) + :type page_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_endpoint_real_user_test_pages_details_serialize( + id=id, + page_id=page_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': "GetEndpointRealUserTestPagesDetails200Response", + '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_endpoint_real_user_test_pages_details_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The real user test id.")], + page_id: Annotated[StrictStr, Field(description="Web page ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve endpoint real user test page + + Returns details for endpoint real user test web page request. Provides complete waterfall information with all object requests. Sends back detailed endpoint real user test web page request. Returned object has a single field: `har` which is an HAR object according to the HTTP Archive 1.2 specifications. [You can read more about the specification](http://www.softwareishard.com/blog/har-12-spec/). In addition to standard fields, the object har includes a custom property `systemMetrics` which contain metrics about CPU and physical memory usage. Check `SystemMetrics` on schemas tab for more information. + + :param id: The real user test id. (required) + :type id: str + :param page_id: Web page ID (required) + :type page_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_endpoint_real_user_test_pages_details_serialize( + id=id, + page_id=page_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': "GetEndpointRealUserTestPagesDetails200Response", + '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_endpoint_real_user_test_pages_details_serialize( + self, + id, + page_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 id is not None: + _path_params['id'] = id + if page_id is not None: + _path_params['pageId'] = page_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/endpoint/test-results/real-user-tests/{id}/pages/{pageId}', + 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_endpoint_real_user_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + get_endpoint_real_user_tests_request: Optional[GetEndpointRealUserTestsRequest] = 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, + ) -> GetEndpointRealUserTests200Response: + """List endpoint real user tests + + Returns a list of all endpoint real user tests. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` Returns a `results` array of endpoint real user tests. Either the latest results, or based on the time range and body filters specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param get_endpoint_real_user_tests_request: + :type get_endpoint_real_user_tests_request: GetEndpointRealUserTestsRequest + :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_endpoint_real_user_tests_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + get_endpoint_real_user_tests_request=get_endpoint_real_user_tests_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointRealUserTests200Response", + '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 get_endpoint_real_user_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + get_endpoint_real_user_tests_request: Optional[GetEndpointRealUserTestsRequest] = 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[GetEndpointRealUserTests200Response]: + """List endpoint real user tests + + Returns a list of all endpoint real user tests. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` Returns a `results` array of endpoint real user tests. Either the latest results, or based on the time range and body filters specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param get_endpoint_real_user_tests_request: + :type get_endpoint_real_user_tests_request: GetEndpointRealUserTestsRequest + :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_endpoint_real_user_tests_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + get_endpoint_real_user_tests_request=get_endpoint_real_user_tests_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointRealUserTests200Response", + '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 get_endpoint_real_user_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + get_endpoint_real_user_tests_request: Optional[GetEndpointRealUserTestsRequest] = 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 endpoint real user tests + + Returns a list of all endpoint real user tests. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` Returns a `results` array of endpoint real user tests. Either the latest results, or based on the time range and body filters specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param get_endpoint_real_user_tests_request: + :type get_endpoint_real_user_tests_request: GetEndpointRealUserTestsRequest + :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_endpoint_real_user_tests_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + get_endpoint_real_user_tests_request=get_endpoint_real_user_tests_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointRealUserTests200Response", + '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 _get_endpoint_real_user_tests_serialize( + self, + aid, + window, + start_date, + end_date, + cursor, + get_endpoint_real_user_tests_request, + _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)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if get_endpoint_real_user_tests_request is not None: + _body_params = get_endpoint_real_user_tests_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/endpoint/test-results/real-user-tests/filter', + 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_endpoint_real_user_tests_network( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + get_endpoint_real_user_tests_request: Optional[GetEndpointRealUserTestsRequest] = 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, + ) -> GetEndpointRealUserTestsNetwork200Response: + """List endpoint real user tests + + Returns a list of all endpoint real user tests. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of endpoint real user tests. Network sessions shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param get_endpoint_real_user_tests_request: + :type get_endpoint_real_user_tests_request: GetEndpointRealUserTestsRequest + :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_endpoint_real_user_tests_network_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + get_endpoint_real_user_tests_request=get_endpoint_real_user_tests_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointRealUserTestsNetwork200Response", + '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 get_endpoint_real_user_tests_network_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + get_endpoint_real_user_tests_request: Optional[GetEndpointRealUserTestsRequest] = 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[GetEndpointRealUserTestsNetwork200Response]: + """List endpoint real user tests + + Returns a list of all endpoint real user tests. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of endpoint real user tests. Network sessions shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param get_endpoint_real_user_tests_request: + :type get_endpoint_real_user_tests_request: GetEndpointRealUserTestsRequest + :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_endpoint_real_user_tests_network_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + get_endpoint_real_user_tests_request=get_endpoint_real_user_tests_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointRealUserTestsNetwork200Response", + '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 get_endpoint_real_user_tests_network_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + get_endpoint_real_user_tests_request: Optional[GetEndpointRealUserTestsRequest] = 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 endpoint real user tests + + Returns a list of all endpoint real user tests. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of endpoint real user tests. Network sessions shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param get_endpoint_real_user_tests_request: + :type get_endpoint_real_user_tests_request: GetEndpointRealUserTestsRequest + :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_endpoint_real_user_tests_network_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + get_endpoint_real_user_tests_request=get_endpoint_real_user_tests_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointRealUserTestsNetwork200Response", + '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 _get_endpoint_real_user_tests_network_serialize( + self, + aid, + window, + start_date, + end_date, + cursor, + get_endpoint_real_user_tests_request, + _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)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if get_endpoint_real_user_tests_request is not None: + _body_params = get_endpoint_real_user_tests_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/endpoint/test-results/real-user-tests/networks/filter', + 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_endpoint_real_user_tests_pages( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + endpoint_real_user_test_result_request_filter: Optional[EndpointRealUserTestResultRequestFilter] = 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, + ) -> GetEndpointRealUserTestsPages200Response: + """List endpoint real user tests visited pages + + Returns a list of all endpoint real user tests visited pages. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of user loaded pages in an endpoint real user test. Pages shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param endpoint_real_user_test_result_request_filter: + :type endpoint_real_user_test_result_request_filter: EndpointRealUserTestResultRequestFilter + :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_endpoint_real_user_tests_pages_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + endpoint_real_user_test_result_request_filter=endpoint_real_user_test_result_request_filter, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointRealUserTestsPages200Response", + '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 get_endpoint_real_user_tests_pages_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + endpoint_real_user_test_result_request_filter: Optional[EndpointRealUserTestResultRequestFilter] = 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[GetEndpointRealUserTestsPages200Response]: + """List endpoint real user tests visited pages + + Returns a list of all endpoint real user tests visited pages. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of user loaded pages in an endpoint real user test. Pages shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param endpoint_real_user_test_result_request_filter: + :type endpoint_real_user_test_result_request_filter: EndpointRealUserTestResultRequestFilter + :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_endpoint_real_user_tests_pages_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + endpoint_real_user_test_result_request_filter=endpoint_real_user_test_result_request_filter, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointRealUserTestsPages200Response", + '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 get_endpoint_real_user_tests_pages_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + endpoint_real_user_test_result_request_filter: Optional[EndpointRealUserTestResultRequestFilter] = 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 endpoint real user tests visited pages + + Returns a list of all endpoint real user tests visited pages. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of user loaded pages in an endpoint real user test. Pages shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param endpoint_real_user_test_result_request_filter: + :type endpoint_real_user_test_result_request_filter: EndpointRealUserTestResultRequestFilter + :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_endpoint_real_user_tests_pages_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + endpoint_real_user_test_result_request_filter=endpoint_real_user_test_result_request_filter, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetEndpointRealUserTestsPages200Response", + '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 _get_endpoint_real_user_tests_pages_serialize( + self, + aid, + window, + start_date, + end_date, + cursor, + endpoint_real_user_test_result_request_filter, + _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)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if endpoint_real_user_test_result_request_filter is not None: + _body_params = endpoint_real_user_test_result_request_filter + + + # 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/endpoint/test-results/real-user-tests/pages/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/test_results_api/test_results_api/api/web_http_server_scheduled_test_results_api.py b/endpoint/test_results_api/test_results_api/api/web_http_server_scheduled_test_results_api.py new file mode 100644 index 00000000..77cf7ffc --- /dev/null +++ b/endpoint/test_results_api/test_results_api/api/web_http_server_scheduled_test_results_api.py @@ -0,0 +1,454 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import List, Optional + +from test_results_api.models.expand import Expand +from test_results_api.models.get_test_result_http_server200_response import GetTestResultHttpServer200Response + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class WebHTTPServerScheduledTestResultsApi: + """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_test_result_http_server( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the 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, + ) -> GetTestResultHttpServer200Response: + """Retrieve HTTP server scheduled test results + + Returns component-level (DNS, Connect, Wait and Receive) timing for the load of an object over HTTP. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. + :type expand: List[Expand] + :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_test_result_http_server_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultHttpServer200Response", + '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_test_result_http_server_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the 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[GetTestResultHttpServer200Response]: + """Retrieve HTTP server scheduled test results + + Returns component-level (DNS, Connect, Wait and Receive) timing for the load of an object over HTTP. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. + :type expand: List[Expand] + :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_test_result_http_server_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultHttpServer200Response", + '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_test_result_http_server_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the 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: + """Retrieve HTTP server scheduled test results + + Returns component-level (DNS, Connect, Wait and Receive) timing for the load of an object over HTTP. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. + :type expand: List[Expand] + :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_test_result_http_server_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultHttpServer200Response", + '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_test_result_http_server_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + 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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # 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/endpoint/test-results/scheduled-tests/{testId}/http-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/test_results_api/test_results_api/api_client.py b/endpoint/test_results_api/test_results_api/api_client.py new file mode 100644 index 00000000..7a860bea --- /dev/null +++ b/endpoint/test_results_api/test_results_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.configuration import Configuration +from test_results_api.api_response import ApiResponse +import test_results_api.models +from test_results_api import rest +from test_results_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(test_results_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) diff --git a/endpoint/test_results_api/test_results_api/api_response.py b/endpoint/test_results_api/test_results_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/api_response.py @@ -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 + } diff --git a/endpoint/test_results_api/test_results_api/configuration.py b/endpoint/test_results_api/test_results_api/configuration.py new file mode 100644 index 00000000..29527d84 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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("test_results_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 diff --git a/endpoint/test_results_api/test_results_api/exceptions.py b/endpoint/test_results_api/test_results_api/exceptions.py new file mode 100644 index 00000000..9829a230 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 diff --git a/endpoint/test_results_api/test_results_api/models/__init__.py b/endpoint/test_results_api/test_results_api/models/__init__.py new file mode 100644 index 00000000..1b79ff2d --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/__init__.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +# flake8: noqa +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.account_group_id import AccountGroupId +from test_results_api.models.agent_labels_selector_type import AgentLabelsSelectorType +from test_results_api.models.all_agents_selector_type import AllAgentsSelectorType +from test_results_api.models.application_score_quality import ApplicationScoreQuality +from test_results_api.models.asn_details import AsnDetails +from test_results_api.models.conditional_operator import ConditionalOperator +from test_results_api.models.cpu_utilization import CpuUtilization +from test_results_api.models.dynamic_base_test_result import DynamicBaseTestResult +from test_results_api.models.dynamic_base_test_result_webex import DynamicBaseTestResultWebex +from test_results_api.models.dynamic_test import DynamicTest +from test_results_api.models.dynamic_test_application import DynamicTestApplication +from test_results_api.models.dynamic_test_links import DynamicTestLinks +from test_results_api.models.dynamic_test_links_self import DynamicTestLinksSelf +from test_results_api.models.dynamic_test_links_test_results import DynamicTestLinksTestResults +from test_results_api.models.dynamic_tests_data_round_search import DynamicTestsDataRoundSearch +from test_results_api.models.dynamic_tests_data_search_filter import DynamicTestsDataSearchFilter +from test_results_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig +from test_results_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from test_results_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from test_results_api.models.endpoint_agent_to_server_type import EndpointAgentToServerType +from test_results_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig +from test_results_api.models.endpoint_browser import EndpointBrowser +from test_results_api.models.endpoint_http_data_point_score import EndpointHttpDataPointScore +from test_results_api.models.endpoint_http_server_base_test import EndpointHttpServerBaseTest +from test_results_api.models.endpoint_http_server_test import EndpointHttpServerTest +from test_results_api.models.endpoint_http_server_type import EndpointHttpServerType +from test_results_api.models.endpoint_network_topology_result_request_filter import EndpointNetworkTopologyResultRequestFilter +from test_results_api.models.endpoint_ping_data_point_score import EndpointPingDataPointScore +from test_results_api.models.endpoint_real_user_test import EndpointRealUserTest +from test_results_api.models.endpoint_real_user_test_base import EndpointRealUserTestBase +from test_results_api.models.endpoint_real_user_test_detail import EndpointRealUserTestDetail +from test_results_api.models.endpoint_real_user_test_detail_results import EndpointRealUserTestDetailResults +from test_results_api.models.endpoint_real_user_test_result_request_filter import EndpointRealUserTestResultRequestFilter +from test_results_api.models.endpoint_real_user_test_results import EndpointRealUserTestResults +from test_results_api.models.endpoint_result_request_filter import EndpointResultRequestFilter +from test_results_api.models.endpoint_scheduled_test import EndpointScheduledTest +from test_results_api.models.endpoint_scheduled_test_type import EndpointScheduledTestType +from test_results_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig +from test_results_api.models.endpoint_test import EndpointTest +from test_results_api.models.endpoint_test_aid import EndpointTestAid +from test_results_api.models.endpoint_test_auth_type import EndpointTestAuthType +from test_results_api.models.endpoint_test_links import EndpointTestLinks +from test_results_api.models.endpoint_test_links_self import EndpointTestLinksSelf +from test_results_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults +from test_results_api.models.endpoint_test_protocol import EndpointTestProtocol +from test_results_api.models.error import Error +from test_results_api.models.ethernet_profile import EthernetProfile +from test_results_api.models.expand import Expand +from test_results_api.models.get_dynamic_test_result_network_pathvis200_response import GetDynamicTestResultNetworkPathvis200Response +from test_results_api.models.get_dynamic_test_result_pathvis_agent_round200_response import GetDynamicTestResultPathvisAgentRound200Response +from test_results_api.models.get_endpoint_local_network_topology_details200_response import GetEndpointLocalNetworkTopologyDetails200Response +from test_results_api.models.get_endpoint_local_networks200_response import GetEndpointLocalNetworks200Response +from test_results_api.models.get_endpoint_local_networks_topologies200_response import GetEndpointLocalNetworksTopologies200Response +from test_results_api.models.get_endpoint_local_networks_topologies_request import GetEndpointLocalNetworksTopologiesRequest +from test_results_api.models.get_endpoint_real_user_test_details200_response import GetEndpointRealUserTestDetails200Response +from test_results_api.models.get_endpoint_real_user_test_pages_details200_response import GetEndpointRealUserTestPagesDetails200Response +from test_results_api.models.get_endpoint_real_user_tests200_response import GetEndpointRealUserTests200Response +from test_results_api.models.get_endpoint_real_user_tests_network200_response import GetEndpointRealUserTestsNetwork200Response +from test_results_api.models.get_endpoint_real_user_tests_pages200_response import GetEndpointRealUserTestsPages200Response +from test_results_api.models.get_endpoint_real_user_tests_request import GetEndpointRealUserTestsRequest +from test_results_api.models.get_test_result_http_server200_response import GetTestResultHttpServer200Response +from test_results_api.models.get_test_result_network_pathvis200_response import GetTestResultNetworkPathvis200Response +from test_results_api.models.get_test_result_pathvis_agent_round200_response import GetTestResultPathvisAgentRound200Response +from test_results_api.models.hop import Hop +from test_results_api.models.http_error_type import HttpErrorType +from test_results_api.models.http_test_result import HttpTestResult +from test_results_api.models.http_test_result_headers import HttpTestResultHeaders +from test_results_api.models.http_test_results import HttpTestResults +from test_results_api.models.interface_hardware_type import InterfaceHardwareType +from test_results_api.models.link import Link +from test_results_api.models.local_network_result import LocalNetworkResult +from test_results_api.models.local_network_results import LocalNetworkResults +from test_results_api.models.local_network_topology_detail_results import LocalNetworkTopologyDetailResults +from test_results_api.models.local_network_topology_result import LocalNetworkTopologyResult +from test_results_api.models.local_network_topology_result_base import LocalNetworkTopologyResultBase +from test_results_api.models.local_network_topology_results import LocalNetworkTopologyResults +from test_results_api.models.multi_test_id_network_test_results import MultiTestIdNetworkTestResults +from test_results_api.models.multi_test_id_tests_data_rounds_search import MultiTestIdTestsDataRoundsSearch +from test_results_api.models.multi_test_id_tests_data_search_filter import MultiTestIdTestsDataSearchFilter +from test_results_api.models.network_dynamic_test_result import NetworkDynamicTestResult +from test_results_api.models.network_dynamic_test_results import NetworkDynamicTestResults +from test_results_api.models.network_interface import NetworkInterface +from test_results_api.models.network_metrics import NetworkMetrics +from test_results_api.models.network_ping import NetworkPing +from test_results_api.models.network_profile import NetworkProfile +from test_results_api.models.network_proxy_profile import NetworkProxyProfile +from test_results_api.models.network_proxy_profile_proxies_inner import NetworkProxyProfileProxiesInner +from test_results_api.models.network_test_result import NetworkTestResult +from test_results_api.models.network_test_results import NetworkTestResults +from test_results_api.models.network_topology_type import NetworkTopologyType +from test_results_api.models.network_wireless_profile import NetworkWirelessProfile +from test_results_api.models.pagination_next_link import PaginationNextLink +from test_results_api.models.pagination_next_link_links import PaginationNextLinkLinks +from test_results_api.models.path_vis_base_test_result import PathVisBaseTestResult +from test_results_api.models.path_vis_detail_dynamic_test_result import PathVisDetailDynamicTestResult +from test_results_api.models.path_vis_detail_dynamic_test_results import PathVisDetailDynamicTestResults +from test_results_api.models.path_vis_detail_test_result import PathVisDetailTestResult +from test_results_api.models.path_vis_detail_test_results import PathVisDetailTestResults +from test_results_api.models.path_vis_dynamic_test_result import PathVisDynamicTestResult +from test_results_api.models.path_vis_dynamic_test_results import PathVisDynamicTestResults +from test_results_api.models.path_vis_endpoint import PathVisEndpoint +from test_results_api.models.path_vis_hop import PathVisHop +from test_results_api.models.path_vis_route import PathVisRoute +from test_results_api.models.path_vis_test_result import PathVisTestResult +from test_results_api.models.path_vis_test_results import PathVisTestResults +from test_results_api.models.physical_memory_used_bytes import PhysicalMemoryUsedBytes +from test_results_api.models.platform import Platform +from test_results_api.models.post_fetch_dynamic_test_result_metrics200_response import PostFetchDynamicTestResultMetrics200Response +from test_results_api.models.post_fetch_test_result_metrics200_response import PostFetchTestResultMetrics200Response +from test_results_api.models.post_fetch_test_result_metrics_multi_test200_response import PostFetchTestResultMetricsMultiTest200Response +from test_results_api.models.query_window import QueryWindow +from test_results_api.models.real_user_test_coordinates import RealUserTestCoordinates +from test_results_api.models.real_user_test_network import RealUserTestNetwork +from test_results_api.models.real_user_test_network_gateway_ping import RealUserTestNetworkGatewayPing +from test_results_api.models.real_user_test_network_ping import RealUserTestNetworkPing +from test_results_api.models.real_user_test_network_result import RealUserTestNetworkResult +from test_results_api.models.real_user_test_network_results import RealUserTestNetworkResults +from test_results_api.models.real_user_test_network_traceroute import RealUserTestNetworkTraceroute +from test_results_api.models.real_user_test_network_vpn_ping import RealUserTestNetworkVpnPing +from test_results_api.models.real_user_test_network_vpn_traceroute import RealUserTestNetworkVpnTraceroute +from test_results_api.models.real_user_test_page import RealUserTestPage +from test_results_api.models.real_user_test_page_page_timings import RealUserTestPagePageTimings +from test_results_api.models.real_user_test_page_result import RealUserTestPageResult +from test_results_api.models.real_user_test_page_results import RealUserTestPageResults +from test_results_api.models.self_links import SelfLinks +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.sort_order import SortOrder +from test_results_api.models.specific_agents_selector_type import SpecificAgentsSelectorType +from test_results_api.models.system_metrics import SystemMetrics +from test_results_api.models.tcp_connect import TcpConnect +from test_results_api.models.test_interval import TestInterval +from test_results_api.models.test_probe_mode import TestProbeMode +from test_results_api.models.test_result import TestResult +from test_results_api.models.test_ssl_version_id import TestSslVersionId +from test_results_api.models.tests_data_rounds_search import TestsDataRoundsSearch +from test_results_api.models.tests_data_search_filter import TestsDataSearchFilter +from test_results_api.models.tests_data_search_sort import TestsDataSearchSort +from test_results_api.models.tests_data_search_sort_key import TestsDataSearchSortKey +from test_results_api.models.tests_data_threshold_filter import TestsDataThresholdFilter +from test_results_api.models.tests_data_threshold_filters import TestsDataThresholdFilters +from test_results_api.models.threshold_filter_name import ThresholdFilterName +from test_results_api.models.threshold_filter_operator import ThresholdFilterOperator +from test_results_api.models.traceroute import Traceroute +from test_results_api.models.traceroute_hop import TracerouteHop +from test_results_api.models.trigger import Trigger +from test_results_api.models.unauthorized_error import UnauthorizedError +from test_results_api.models.vpn_profile import VpnProfile +from test_results_api.models.vpn_type import VpnType diff --git a/endpoint/test_results_api/test_results_api/models/account_group_id.py b/endpoint/test_results_api/test_results_api/models/account_group_id.py new file mode 100644 index 00000000..0bcef6ba --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/account_group_id.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 + + diff --git a/endpoint/test_results_api/test_results_api/models/agent_labels_selector_type.py b/endpoint/test_results_api/test_results_api/models/agent_labels_selector_type.py new file mode 100644 index 00000000..d28f5dd6 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/agent_labels_selector_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 AgentLabelsSelectorType(str, Enum): + """ + AgentLabelsSelectorType + """ + + """ + allowed enum values + """ + AGENT_MINUS_LABELS = 'agent-labels' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AgentLabelsSelectorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/all_agents_selector_type.py b/endpoint/test_results_api/test_results_api/models/all_agents_selector_type.py new file mode 100644 index 00000000..c612827a --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/all_agents_selector_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 AllAgentsSelectorType(str, Enum): + """ + AllAgentsSelectorType + """ + + """ + allowed enum values + """ + ALL_MINUS_AGENTS = 'all-agents' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AllAgentsSelectorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/application_score_quality.py b/endpoint/test_results_api/test_results_api/models/application_score_quality.py new file mode 100644 index 00000000..bcbff3d3 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/application_score_quality.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 ApplicationScoreQuality(str, Enum): + """ + ApplicationScoreQuality + """ + + """ + allowed enum values + """ + GREAT = 'great' + GOOD = 'good' + POOR = 'poor' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ApplicationScoreQuality from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/asn_details.py b/endpoint/test_results_api/test_results_api/models/asn_details.py new file mode 100644 index 00000000..56c471c3 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/asn_details.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AsnDetails(BaseModel): + """ + AsnDetails + """ # noqa: E501 + as_name: Optional[StrictStr] = Field(default=None, description="Name of the provider.", alias="asName") + as_number: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Unique number assigned to an organization (also referred to as service provider).", alias="asNumber") + __properties: ClassVar[List[str]] = ["asName", "asNumber"] + + 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 AsnDetails 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={ + "as_name", + "as_number", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AsnDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "asName": obj.get("asName"), + "asNumber": obj.get("asNumber") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/conditional_operator.py b/endpoint/test_results_api/test_results_api/models/conditional_operator.py new file mode 100644 index 00000000..a7f8de58 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/conditional_operator.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 ConditionalOperator(str, Enum): + """ + ConditionalOperator + """ + + """ + allowed enum values + """ + AND = 'and' + OR = 'or' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ConditionalOperator from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/cpu_utilization.py b/endpoint/test_results_api/test_results_api/models/cpu_utilization.py new file mode 100644 index 00000000..b62f3967 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/cpu_utilization.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +from typing_extensions import Annotated +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class CpuUtilization(BaseModel): + """ + CpuUtilization + """ # noqa: E501 + min: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0.0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="The minimum sampled usage value recorded during the monitored period.") + max: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0.0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="The maximum sampled usage value recorded during the monitored period.") + mean: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0.0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="The mean (average) sampled usage value recorded during the monitored period.") + median: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0.0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="The median sampled usage value recorded during the monitored period.") + std_dev: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0.0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="The standard deviation of sampled usage values recorded during the monitored period.", alias="stdDev") + count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total number of samples collected during the monitored period.") + __properties: ClassVar[List[str]] = ["min", "max", "mean", "median", "stdDev", "count"] + + 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 CpuUtilization 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "min", + "max", + "mean", + "median", + "std_dev", + "count", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of CpuUtilization from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "min": obj.get("min"), + "max": obj.get("max"), + "mean": obj.get("mean"), + "median": obj.get("median"), + "stdDev": obj.get("stdDev"), + "count": obj.get("count") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/dynamic_base_test_result.py b/endpoint/test_results_api/test_results_api/models/dynamic_base_test_result.py new file mode 100644 index 00000000..f72843ab --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/dynamic_base_test_result.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.dynamic_base_test_result_webex import DynamicBaseTestResultWebex +from test_results_api.models.dynamic_test_application import DynamicTestApplication +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DynamicBaseTestResult(BaseModel): + """ + DynamicBaseTestResult + """ # noqa: E501 + application: Optional[DynamicTestApplication] = None + webex: Optional[DynamicBaseTestResultWebex] = None + __properties: ClassVar[List[str]] = ["application", "webex"] + + 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 DynamicBaseTestResult 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 webex + if self.webex: + _dict['webex'] = self.webex.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DynamicBaseTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "application": obj.get("application"), + "webex": DynamicBaseTestResultWebex.from_dict(obj.get("webex")) if obj.get("webex") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/dynamic_base_test_result_webex.py b/endpoint/test_results_api/test_results_api/models/dynamic_base_test_result_webex.py new file mode 100644 index 00000000..809cfb90 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/dynamic_base_test_result_webex.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 DynamicBaseTestResultWebex(BaseModel): + """ + Contains object with webex conference information. Only returned when `application` == `webex`. + """ # noqa: E501 + conference_id: Optional[StrictStr] = Field(default=None, description="Webex conference ID.", alias="conferenceId") + correlation_id: Optional[StrictStr] = Field(default=None, description="Webex conference correlation ID.", alias="correlationId") + __properties: ClassVar[List[str]] = ["conferenceId", "correlationId"] + + 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 DynamicBaseTestResultWebex 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={ + "conference_id", + "correlation_id", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DynamicBaseTestResultWebex from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conferenceId": obj.get("conferenceId"), + "correlationId": obj.get("correlationId") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/dynamic_test.py b/endpoint/test_results_api/test_results_api/models/dynamic_test.py new file mode 100644 index 00000000..1df6d113 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/dynamic_test.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.dynamic_test_application import DynamicTestApplication +from test_results_api.models.dynamic_test_links import DynamicTestLinks +from test_results_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from test_results_api.models.endpoint_test_aid import EndpointTestAid +from test_results_api.models.endpoint_test_protocol import EndpointTestProtocol +from test_results_api.models.test_interval import TestInterval +from test_results_api.models.test_probe_mode import TestProbeMode +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DynamicTest(BaseModel): + """ + DynamicTest + """ # noqa: E501 + links: Optional[DynamicTestLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + application: Optional[DynamicTestApplication] = None + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=None, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + protocol: Optional[EndpointTestProtocol] = None + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID; this is used to access test information and results from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "application", "createdDate", "interval", "isEnabled", "hasPathTraceInSession", "hasPing", "hasTraceroute", "modifiedDate", "networkMeasurements", "protocol", "tcpProbeMode", "testId", "aid", "testName"] + + 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 DynamicTest 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_date", + "is_enabled", + "has_path_trace_in_session", + "modified_date", + "network_measurements", + "tcp_probe_mode", + "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() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DynamicTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": DynamicTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "application": obj.get("application"), + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements"), + "protocol": obj.get("protocol"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/dynamic_test_application.py b/endpoint/test_results_api/test_results_api/models/dynamic_test_application.py new file mode 100644 index 00000000..72b73b03 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/dynamic_test_application.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 DynamicTestApplication(str, Enum): + """ + Which supported application to monitor. + """ + + """ + allowed enum values + """ + MICROSOFT_MINUS_TEAMS = 'microsoft-teams' + WEBEX = 'webex' + ZOOM = 'zoom' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DynamicTestApplication from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/dynamic_test_links.py b/endpoint/test_results_api/test_results_api/models/dynamic_test_links.py new file mode 100644 index 00000000..d45a7ff8 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/dynamic_test_links.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.dynamic_test_links_self import DynamicTestLinksSelf +from test_results_api.models.dynamic_test_links_test_results import DynamicTestLinksTestResults +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DynamicTestLinks(BaseModel): + """ + A list of links that can be accessed to get more information. + """ # noqa: E501 + var_self: Optional[DynamicTestLinksSelf] = Field(default=None, alias="self") + test_results: Optional[DynamicTestLinksTestResults] = 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 DynamicTestLinks 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 DynamicTestLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": DynamicTestLinksSelf.from_dict(obj.get("self")) if obj.get("self") is not None else None, + "testResults": DynamicTestLinksTestResults.from_dict(obj.get("testResults")) if obj.get("testResults") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/dynamic_test_links_self.py b/endpoint/test_results_api/test_results_api/models/dynamic_test_links_self.py new file mode 100644 index 00000000..22393455 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/dynamic_test_links_self.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 DynamicTestLinksSelf(BaseModel): + """ + DynamicTestLinksSelf + """ # 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 DynamicTestLinksSelf 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 DynamicTestLinksSelf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "href": obj.get("href"), + "templated": obj.get("templated"), + "type": obj.get("type"), + "deprecation": obj.get("deprecation"), + "name": obj.get("name"), + "profile": obj.get("profile"), + "title": obj.get("title"), + "hreflang": obj.get("hreflang") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/dynamic_test_links_test_results.py b/endpoint/test_results_api/test_results_api/models/dynamic_test_links_test_results.py new file mode 100644 index 00000000..6f802ab0 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/dynamic_test_links_test_results.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_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 + +DYNAMICTESTLINKSTESTRESULTS_ONE_OF_SCHEMAS = ["Link", "List[Link]"] + +class DynamicTestLinksTestResults(BaseModel): + """ + DynamicTestLinksTestResults + """ + # 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 = DynamicTestLinksTestResults.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 DynamicTestLinksTestResults 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 DynamicTestLinksTestResults 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 DynamicTestLinksTestResults 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 DynamicTestLinksTestResults 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()) + + diff --git a/endpoint/test_results_api/test_results_api/models/dynamic_tests_data_round_search.py b/endpoint/test_results_api/test_results_api/models/dynamic_tests_data_round_search.py new file mode 100644 index 00000000..9bec00b2 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/dynamic_tests_data_round_search.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.dynamic_tests_data_search_filter import DynamicTestsDataSearchFilter +from test_results_api.models.tests_data_search_sort import TestsDataSearchSort +from test_results_api.models.tests_data_threshold_filters import TestsDataThresholdFilters +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DynamicTestsDataRoundSearch(BaseModel): + """ + DynamicTestsDataRoundSearch + """ # noqa: E501 + search_sort: Optional[List[TestsDataSearchSort]] = Field(default=None, alias="searchSort") + threshold_filter: Optional[TestsDataThresholdFilters] = Field(default=None, alias="thresholdFilter") + search_filters: Optional[DynamicTestsDataSearchFilter] = Field(default=None, alias="searchFilters") + __properties: ClassVar[List[str]] = ["searchSort", "thresholdFilter", "searchFilters"] + + 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 DynamicTestsDataRoundSearch 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 search_sort (list) + _items = [] + if self.search_sort: + for _item in self.search_sort: + if _item: + _items.append(_item.to_dict()) + _dict['searchSort'] = _items + # override the default output from pydantic by calling `to_dict()` of threshold_filter + if self.threshold_filter: + _dict['thresholdFilter'] = self.threshold_filter.to_dict() + # override the default output from pydantic by calling `to_dict()` of search_filters + if self.search_filters: + _dict['searchFilters'] = self.search_filters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DynamicTestsDataRoundSearch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "searchSort": [TestsDataSearchSort.from_dict(_item) for _item in obj.get("searchSort")] if obj.get("searchSort") is not None else None, + "thresholdFilter": TestsDataThresholdFilters.from_dict(obj.get("thresholdFilter")) if obj.get("thresholdFilter") is not None else None, + "searchFilters": DynamicTestsDataSearchFilter.from_dict(obj.get("searchFilters")) if obj.get("searchFilters") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/dynamic_tests_data_search_filter.py b/endpoint/test_results_api/test_results_api/models/dynamic_tests_data_search_filter.py new file mode 100644 index 00000000..75727b9b --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/dynamic_tests_data_search_filter.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 DynamicTestsDataSearchFilter(BaseModel): + """ + DynamicTestsDataSearchFilter + """ # noqa: E501 + agent_id: Optional[List[StrictStr]] = Field(default=None, description="Filter using the `agent-id`.", alias="agentId") + webex_conference_id: Optional[List[StrictStr]] = Field(default=None, description="Filter using the `conference-id` of the webex call.", alias="webexConferenceId") + __properties: ClassVar[List[str]] = ["agentId", "webexConferenceId"] + + 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 DynamicTestsDataSearchFilter 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 DynamicTestsDataSearchFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "webexConferenceId": obj.get("webexConferenceId") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_agent_labels_selector_config.py b/endpoint/test_results_api/test_results_api/models/endpoint_agent_labels_selector_config.py new file mode 100644 index 00000000..455ab75a --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_agent_labels_selector_config.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 typing_extensions import Annotated +from test_results_api.models.agent_labels_selector_type import AgentLabelsSelectorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentLabelsSelectorConfig(BaseModel): + """ + Agent labels selection object. + """ # noqa: E501 + agent_selector_type: Optional[AgentLabelsSelectorType] = Field(default=None, alias="agentSelectorType") + max_machines: Optional[Annotated[int, Field(le=5000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") + __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines", "endpointAgentLabels"] + + 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 EndpointAgentLabelsSelectorConfig 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 EndpointAgentLabelsSelectorConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "maxMachines": obj.get("maxMachines"), + "endpointAgentLabels": obj.get("endpointAgentLabels") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_agent_selector_config.py b/endpoint/test_results_api/test_results_api/models/endpoint_agent_selector_config.py new file mode 100644 index 00000000..58ab3eeb --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_agent_selector_config.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig +from test_results_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig +from test_results_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig +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 + +ENDPOINTAGENTSELECTORCONFIG_ONE_OF_SCHEMAS = ["EndpointAgentLabelsSelectorConfig", "EndpointAllAgentsSelectorConfig", "EndpointSpecificAgentsSelectorConfig"] + +class EndpointAgentSelectorConfig(BaseModel): + """ + Agents selection object based on agentSelectorType. + """ + # data type: EndpointAllAgentsSelectorConfig + oneof_schema_1_validator: Optional[EndpointAllAgentsSelectorConfig] = None + # data type: EndpointAgentLabelsSelectorConfig + oneof_schema_2_validator: Optional[EndpointAgentLabelsSelectorConfig] = None + # data type: EndpointSpecificAgentsSelectorConfig + oneof_schema_3_validator: Optional[EndpointSpecificAgentsSelectorConfig] = None + actual_instance: Optional[Union[EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig]] = None + one_of_schemas: List[str] = Literal["EndpointAgentLabelsSelectorConfig", "EndpointAllAgentsSelectorConfig", "EndpointSpecificAgentsSelectorConfig"] + + model_config = { + "validate_assignment": True + } + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = EndpointAgentSelectorConfig.model_construct() + error_messages = [] + match = 0 + # validate data type: EndpointAllAgentsSelectorConfig + if not isinstance(v, EndpointAllAgentsSelectorConfig): + error_messages.append(f"Error! Input type `{type(v)}` is not `EndpointAllAgentsSelectorConfig`") + else: + match += 1 + # validate data type: EndpointAgentLabelsSelectorConfig + if not isinstance(v, EndpointAgentLabelsSelectorConfig): + error_messages.append(f"Error! Input type `{type(v)}` is not `EndpointAgentLabelsSelectorConfig`") + else: + match += 1 + # validate data type: EndpointSpecificAgentsSelectorConfig + if not isinstance(v, EndpointSpecificAgentsSelectorConfig): + error_messages.append(f"Error! Input type `{type(v)}` is not `EndpointSpecificAgentsSelectorConfig`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in EndpointAgentSelectorConfig with oneOf schemas: EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in EndpointAgentSelectorConfig with oneOf schemas: EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig. 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 EndpointAllAgentsSelectorConfig + try: + instance.actual_instance = EndpointAllAgentsSelectorConfig.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EndpointAgentLabelsSelectorConfig + try: + instance.actual_instance = EndpointAgentLabelsSelectorConfig.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EndpointSpecificAgentsSelectorConfig + try: + instance.actual_instance = EndpointSpecificAgentsSelectorConfig.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 EndpointAgentSelectorConfig with oneOf schemas: EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into EndpointAgentSelectorConfig with oneOf schemas: EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig. 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()) + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_agent_to_server_test.py b/endpoint/test_results_api/test_results_api/models/endpoint_agent_to_server_test.py new file mode 100644 index 00000000..d7e8eb97 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_agent_to_server_test.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from test_results_api.models.endpoint_agent_to_server_type import EndpointAgentToServerType +from test_results_api.models.endpoint_test_aid import EndpointTestAid +from test_results_api.models.endpoint_test_links import EndpointTestLinks +from test_results_api.models.endpoint_test_protocol import EndpointTestProtocol +from test_results_api.models.test_interval import TestInterval +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentToServerTest(BaseModel): + """ + EndpointAgentToServerTest + """ # noqa: E501 + links: Optional[EndpointTestLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + is_saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="isSavedEvent") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + protocol: Optional[EndpointTestProtocol] = None + server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + type: Optional[EndpointAgentToServerType] = None + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "aid", "testName", "type"] + + 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 EndpointAgentToServerTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_date", + "is_enabled", + "is_saved_event", + "modified_date", + "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() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgentToServerTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": EndpointTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "isSavedEvent": obj.get("isSavedEvent"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName"), + "type": obj.get("type") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_agent_to_server_type.py b/endpoint/test_results_api/test_results_api/models/endpoint_agent_to_server_type.py new file mode 100644 index 00000000..6ab19f0e --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_agent_to_server_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 EndpointAgentToServerType(str, Enum): + """ + Type of test being queried. + """ + + """ + allowed enum values + """ + AGENT_MINUS_TO_MINUS_SERVER = 'agent-to-server' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointAgentToServerType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_all_agents_selector_config.py b/endpoint/test_results_api/test_results_api/models/endpoint_all_agents_selector_config.py new file mode 100644 index 00000000..62c4f5cb --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_all_agents_selector_config.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 typing_extensions import Annotated +from test_results_api.models.all_agents_selector_type import AllAgentsSelectorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAllAgentsSelectorConfig(BaseModel): + """ + Any agent selection object. + """ # noqa: E501 + agent_selector_type: Optional[AllAgentsSelectorType] = Field(default=None, alias="agentSelectorType") + max_machines: Optional[Annotated[int, Field(le=5000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines"] + + 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 EndpointAllAgentsSelectorConfig 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 EndpointAllAgentsSelectorConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "maxMachines": obj.get("maxMachines") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_browser.py b/endpoint/test_results_api/test_results_api/models/endpoint_browser.py new file mode 100644 index 00000000..8f65ae14 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_browser.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 EndpointBrowser(BaseModel): + """ + EndpointBrowser + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Browser name.") + version: Optional[StrictStr] = Field(default=None, description="Browser version.") + __properties: ClassVar[List[str]] = ["name", "version"] + + 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 EndpointBrowser 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={ + "name", + "version", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointBrowser from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "version": obj.get("version") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_http_data_point_score.py b/endpoint/test_results_api/test_results_api/models/endpoint_http_data_point_score.py new file mode 100644 index 00000000..2c324abe --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_http_data_point_score.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +from test_results_api.models.application_score_quality import ApplicationScoreQuality +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointHttpDataPointScore(BaseModel): + """ + EndpointHttpDataPointScore + """ # noqa: E501 + application_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Fine grained score between 0-100 based on `time to first byte` metric", alias="applicationScore") + quality: Optional[ApplicationScoreQuality] = None + __properties: ClassVar[List[str]] = ["applicationScore", "quality"] + + 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 EndpointHttpDataPointScore 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 EndpointHttpDataPointScore from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "applicationScore": obj.get("applicationScore"), + "quality": obj.get("quality") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_http_server_base_test.py b/endpoint/test_results_api/test_results_api/models/endpoint_http_server_base_test.py new file mode 100644 index 00000000..ab79e97d --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_http_server_base_test.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.endpoint_test_auth_type import EndpointTestAuthType +from test_results_api.models.endpoint_test_protocol import EndpointTestProtocol +from test_results_api.models.test_probe_mode import TestProbeMode +from test_results_api.models.test_ssl_version_id import TestSslVersionId +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointHttpServerBaseTest(BaseModel): + """ + EndpointHttpServerBaseTest + """ # noqa: E501 + auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + http_time_limit: Optional[StrictInt] = Field(default=None, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + protocol: Optional[EndpointTestProtocol] = None + url: Optional[StrictStr] = Field(default=None, description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + verify_certificate: Optional[StrictBool] = Field(default=None, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + __properties: ClassVar[List[str]] = ["authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate"] + + 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 EndpointHttpServerBaseTest 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 EndpointHttpServerBaseTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "authType": obj.get("authType"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "httpTimeLimit": obj.get("httpTimeLimit"), + "protocol": obj.get("protocol"), + "url": obj.get("url"), + "username": obj.get("username"), + "sslVersionId": obj.get("sslVersionId"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "verifyCertificate": obj.get("verifyCertificate") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_http_server_test.py b/endpoint/test_results_api/test_results_api/models/endpoint_http_server_test.py new file mode 100644 index 00000000..e8cae832 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_http_server_test.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 typing_extensions import Annotated +from test_results_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from test_results_api.models.endpoint_http_server_type import EndpointHttpServerType +from test_results_api.models.endpoint_test_aid import EndpointTestAid +from test_results_api.models.endpoint_test_auth_type import EndpointTestAuthType +from test_results_api.models.endpoint_test_links import EndpointTestLinks +from test_results_api.models.endpoint_test_protocol import EndpointTestProtocol +from test_results_api.models.test_interval import TestInterval +from test_results_api.models.test_probe_mode import TestProbeMode +from test_results_api.models.test_ssl_version_id import TestSslVersionId +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointHttpServerTest(BaseModel): + """ + EndpointHttpServerTest + """ # noqa: E501 + links: Optional[EndpointTestLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + is_saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="isSavedEvent") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + protocol: Optional[EndpointTestProtocol] = None + server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + type: Optional[EndpointHttpServerType] = None + auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") + http_time_limit: Optional[StrictInt] = Field(default=None, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + url: Optional[StrictStr] = Field(default=None, description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + verify_certificate: Optional[StrictBool] = Field(default=None, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "aid", "testName", "type", "authType", "httpTimeLimit", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "contentRegex", "followRedirects", "httpTargetTime", "httpVersion", "postBody", "sslVersion", "useNtlm", "userAgent"] + + 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 EndpointHttpServerTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_date", + "is_enabled", + "is_saved_event", + "modified_date", + "test_id", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointHttpServerTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": EndpointTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "isSavedEvent": obj.get("isSavedEvent"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName"), + "type": obj.get("type"), + "authType": obj.get("authType"), + "httpTimeLimit": obj.get("httpTimeLimit"), + "url": obj.get("url"), + "username": obj.get("username"), + "sslVersionId": obj.get("sslVersionId"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "verifyCertificate": obj.get("verifyCertificate"), + "contentRegex": obj.get("contentRegex"), + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "postBody": obj.get("postBody"), + "sslVersion": obj.get("sslVersion"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_http_server_type.py b/endpoint/test_results_api/test_results_api/models/endpoint_http_server_type.py new file mode 100644 index 00000000..168c452e --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_http_server_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 EndpointHttpServerType(str, Enum): + """ + Type of test being queried. + """ + + """ + allowed enum values + """ + HTTP_MINUS_SERVER = 'http-server' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointHttpServerType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_network_topology_result_request_filter.py b/endpoint/test_results_api/test_results_api/models/endpoint_network_topology_result_request_filter.py new file mode 100644 index 00000000..c26f97f0 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_network_topology_result_request_filter.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.interface_hardware_type import InterfaceHardwareType +from test_results_api.models.network_topology_type import NetworkTopologyType +from test_results_api.models.platform import Platform +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointNetworkTopologyResultRequestFilter(BaseModel): + """ + EndpointNetworkTopologyResultRequestFilter + """ # noqa: E501 + location: Optional[List[StrictStr]] = Field(default=None, description="Location of the endpoint agent.") + connection: Optional[List[InterfaceHardwareType]] = None + platform: Optional[List[Platform]] = None + gateway: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent default gateway IP address.") + proxy_target: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent proxy IP address.", alias="proxyTarget") + vpn_target: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent VPN endpoint IP address.", alias="vpnTarget") + agent_id: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent ID.", alias="agentId") + network_id: Optional[List[StrictStr]] = Field(default=None, description="Network ID.", alias="networkId") + ssid: Optional[List[StrictStr]] = Field(default=None, description="WiFi SSID.") + bssid: Optional[List[StrictStr]] = Field(default=None, description="WiFi BSSID.") + type: Optional[List[NetworkTopologyType]] = Field(default=None, description="Web site base domain visited during the session.") + __properties: ClassVar[List[str]] = ["location", "connection", "platform", "gateway", "proxyTarget", "vpnTarget", "agentId", "networkId", "ssid", "bssid", "type"] + + 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 EndpointNetworkTopologyResultRequestFilter 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 EndpointNetworkTopologyResultRequestFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "location": obj.get("location"), + "connection": obj.get("connection"), + "platform": obj.get("platform"), + "gateway": obj.get("gateway"), + "proxyTarget": obj.get("proxyTarget"), + "vpnTarget": obj.get("vpnTarget"), + "agentId": obj.get("agentId"), + "networkId": obj.get("networkId"), + "ssid": obj.get("ssid"), + "bssid": obj.get("bssid"), + "type": obj.get("type") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_ping_data_point_score.py b/endpoint/test_results_api/test_results_api/models/endpoint_ping_data_point_score.py new file mode 100644 index 00000000..ee083eb9 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_ping_data_point_score.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +from test_results_api.models.application_score_quality import ApplicationScoreQuality +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointPingDataPointScore(BaseModel): + """ + EndpointPingDataPointScore + """ # noqa: E501 + application_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Fine grained score between 0-100 based on metrics (latency, jitter, loss)", alias="applicationScore") + quality: Optional[ApplicationScoreQuality] = None + __properties: ClassVar[List[str]] = ["applicationScore", "quality"] + + 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 EndpointPingDataPointScore 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 EndpointPingDataPointScore from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "applicationScore": obj.get("applicationScore"), + "quality": obj.get("quality") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test.py b/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test.py new file mode 100644 index 00000000..e20a1918 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import Field +from typing_extensions import Annotated +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointRealUserTest(BaseModel): + """ + EndpointRealUserTest + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + committed: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test was committed to the controller (ISO date-time format).") + var_date: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test took place (ISO date-time format).", alias="date") + experience_score: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="Score rating a user’s experience when loading a particular page, from 0 (the worst) to 1 (the best). [More details](https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#user-experience-score).", alias="experienceScore") + number_of_pages: Optional[StrictInt] = Field(default=None, description="Number of web pages visited on target website.", alias="numberOfPages") + organization_name: Optional[StrictStr] = Field(default=None, description="Name of the AS organization `sourceAddress` belongs to.", alias="organizationName") + port: Optional[StrictInt] = Field(default=None, description="Port used to visit target website.") + protocol: Optional[StrictStr] = Field(default=None, description="Protocol used to visit target website.") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + source_address: Optional[StrictStr] = Field(default=None, description="Public IP address of the endpoint agent during the session.", alias="sourceAddress") + id: Optional[StrictStr] = Field(default=None, description="Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID.") + visited_site: Optional[StrictStr] = Field(default=None, description="Domain used to visit target website.", alias="visitedSite") + page_id: Optional[StrictStr] = Field(default=None, description="Web page ID. The page ID is unique only within an endpoint real user test.", alias="pageId") + __properties: ClassVar[List[str]] = ["agentId", "committed", "date", "experienceScore", "numberOfPages", "organizationName", "port", "protocol", "roundId", "sourceAddress", "id", "visitedSite", "pageId"] + + 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 EndpointRealUserTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "agent_id", + "committed", + "var_date", + "experience_score", + "number_of_pages", + "organization_name", + "port", + "protocol", + "round_id", + "source_address", + "id", + "visited_site", + "page_id", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointRealUserTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "committed": obj.get("committed"), + "date": obj.get("date"), + "experienceScore": obj.get("experienceScore"), + "numberOfPages": obj.get("numberOfPages"), + "organizationName": obj.get("organizationName"), + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "roundId": obj.get("roundId"), + "sourceAddress": obj.get("sourceAddress"), + "id": obj.get("id"), + "visitedSite": obj.get("visitedSite"), + "pageId": obj.get("pageId") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_base.py b/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_base.py new file mode 100644 index 00000000..9cfefbce --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_base.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import Field +from typing_extensions import Annotated +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointRealUserTestBase(BaseModel): + """ + EndpointRealUserTestBase + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + committed: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test was committed to the controller (ISO date-time format).") + var_date: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test took place (ISO date-time format).", alias="date") + experience_score: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="Score rating a user’s experience when loading a particular page, from 0 (the worst) to 1 (the best). [More details](https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#user-experience-score).", alias="experienceScore") + number_of_pages: Optional[StrictInt] = Field(default=None, description="Number of web pages visited on target website.", alias="numberOfPages") + organization_name: Optional[StrictStr] = Field(default=None, description="Name of the AS organization `sourceAddress` belongs to.", alias="organizationName") + port: Optional[StrictInt] = Field(default=None, description="Port used to visit target website.") + protocol: Optional[StrictStr] = Field(default=None, description="Protocol used to visit target website.") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + source_address: Optional[StrictStr] = Field(default=None, description="Public IP address of the endpoint agent during the session.", alias="sourceAddress") + id: Optional[StrictStr] = Field(default=None, description="Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID.") + visited_site: Optional[StrictStr] = Field(default=None, description="Domain used to visit target website.", alias="visitedSite") + __properties: ClassVar[List[str]] = ["agentId", "committed", "date", "experienceScore", "numberOfPages", "organizationName", "port", "protocol", "roundId", "sourceAddress", "id", "visitedSite"] + + 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 EndpointRealUserTestBase 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "agent_id", + "committed", + "var_date", + "experience_score", + "number_of_pages", + "organization_name", + "port", + "protocol", + "round_id", + "source_address", + "id", + "visited_site", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointRealUserTestBase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "committed": obj.get("committed"), + "date": obj.get("date"), + "experienceScore": obj.get("experienceScore"), + "numberOfPages": obj.get("numberOfPages"), + "organizationName": obj.get("organizationName"), + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "roundId": obj.get("roundId"), + "sourceAddress": obj.get("sourceAddress"), + "id": obj.get("id"), + "visitedSite": obj.get("visitedSite") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_detail.py b/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_detail.py new file mode 100644 index 00000000..eca95a1c --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_detail.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import Field +from typing_extensions import Annotated +from test_results_api.models.endpoint_browser import EndpointBrowser +from test_results_api.models.real_user_test_coordinates import RealUserTestCoordinates +from test_results_api.models.real_user_test_network import RealUserTestNetwork +from test_results_api.models.real_user_test_page import RealUserTestPage +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointRealUserTestDetail(BaseModel): + """ + EndpointRealUserTestDetail + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + committed: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test was committed to the controller (ISO date-time format).") + var_date: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test took place (ISO date-time format).", alias="date") + experience_score: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="Score rating a user’s experience when loading a particular page, from 0 (the worst) to 1 (the best). [More details](https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#user-experience-score).", alias="experienceScore") + number_of_pages: Optional[StrictInt] = Field(default=None, description="Number of web pages visited on target website.", alias="numberOfPages") + organization_name: Optional[StrictStr] = Field(default=None, description="Name of the AS organization `sourceAddress` belongs to.", alias="organizationName") + port: Optional[StrictInt] = Field(default=None, description="Port used to visit target website.") + protocol: Optional[StrictStr] = Field(default=None, description="Protocol used to visit target website.") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + source_address: Optional[StrictStr] = Field(default=None, description="Public IP address of the endpoint agent during the session.", alias="sourceAddress") + id: Optional[StrictStr] = Field(default=None, description="Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID.") + visited_site: Optional[StrictStr] = Field(default=None, description="Domain used to visit target website.", alias="visitedSite") + browser: Optional[EndpointBrowser] = None + coordinates: Optional[RealUserTestCoordinates] = None + pages: Optional[List[RealUserTestPage]] = Field(default=None, description="Web site base domain visited during the session.") + network: Optional[RealUserTestNetwork] = None + __properties: ClassVar[List[str]] = ["agentId", "committed", "date", "experienceScore", "numberOfPages", "organizationName", "port", "protocol", "roundId", "sourceAddress", "id", "visitedSite", "browser", "coordinates", "pages", "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 EndpointRealUserTestDetail 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "agent_id", + "committed", + "var_date", + "experience_score", + "number_of_pages", + "organization_name", + "port", + "protocol", + "round_id", + "source_address", + "id", + "visited_site", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of browser + if self.browser: + _dict['browser'] = self.browser.to_dict() + # override the default output from pydantic by calling `to_dict()` of coordinates + if self.coordinates: + _dict['coordinates'] = self.coordinates.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in pages (list) + _items = [] + if self.pages: + for _item in self.pages: + if _item: + _items.append(_item.to_dict()) + _dict['pages'] = _items + # override the default output from pydantic by calling `to_dict()` of network + if self.network: + _dict['network'] = self.network.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointRealUserTestDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "committed": obj.get("committed"), + "date": obj.get("date"), + "experienceScore": obj.get("experienceScore"), + "numberOfPages": obj.get("numberOfPages"), + "organizationName": obj.get("organizationName"), + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "roundId": obj.get("roundId"), + "sourceAddress": obj.get("sourceAddress"), + "id": obj.get("id"), + "visitedSite": obj.get("visitedSite"), + "browser": EndpointBrowser.from_dict(obj.get("browser")) if obj.get("browser") is not None else None, + "coordinates": RealUserTestCoordinates.from_dict(obj.get("coordinates")) if obj.get("coordinates") is not None else None, + "pages": [RealUserTestPage.from_dict(_item) for _item in obj.get("pages")] if obj.get("pages") is not None else None, + "network": RealUserTestNetwork.from_dict(obj.get("network")) if obj.get("network") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_detail_results.py b/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_detail_results.py new file mode 100644 index 00000000..a4b3611d --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_detail_results.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_real_user_test_detail import EndpointRealUserTestDetail +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointRealUserTestDetailResults(BaseModel): + """ + EndpointRealUserTestDetailResults + """ # noqa: E501 + results: Optional[List[EndpointRealUserTestDetail]] = None + __properties: ClassVar[List[str]] = ["results"] + + 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 EndpointRealUserTestDetailResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointRealUserTestDetailResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [EndpointRealUserTestDetail.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_result_request_filter.py b/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_result_request_filter.py new file mode 100644 index 00000000..f29647c0 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_result_request_filter.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.interface_hardware_type import InterfaceHardwareType +from test_results_api.models.platform import Platform +from test_results_api.models.trigger import Trigger +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointRealUserTestResultRequestFilter(BaseModel): + """ + EndpointRealUserTestResultRequestFilter + """ # noqa: E501 + location: Optional[List[StrictStr]] = Field(default=None, description="Location of the endpoint agent.") + connection: Optional[List[InterfaceHardwareType]] = None + platform: Optional[List[Platform]] = None + gateway: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent default gateway IP address.") + proxy_target: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent proxy IP address.", alias="proxyTarget") + vpn_target: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent VPN endpoint IP address.", alias="vpnTarget") + agent_id: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent ID.", alias="agentId") + network_id: Optional[List[StrictStr]] = Field(default=None, description="Network ID.", alias="networkId") + ssid: Optional[List[StrictStr]] = Field(default=None, description="WiFi SSID.") + bssid: Optional[List[StrictStr]] = Field(default=None, description="WiFi BSSID.") + destination_ip: Optional[List[StrictStr]] = Field(default=None, description="Web site destination IP address.", alias="destinationIp") + domain: Optional[List[StrictStr]] = Field(default=None, description="Web site base domain visited during the session.") + trigger: Optional[List[Trigger]] = Field(default=None, description="Real user test trigger.") + visited_site: Optional[List[StrictStr]] = Field(default=None, description="Web site domain visited during the session.", alias="visitedSite") + __properties: ClassVar[List[str]] = ["location", "connection", "platform", "gateway", "proxyTarget", "vpnTarget", "agentId", "networkId", "ssid", "bssid", "destinationIp", "domain", "trigger", "visitedSite"] + + 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 EndpointRealUserTestResultRequestFilter 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 EndpointRealUserTestResultRequestFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "location": obj.get("location"), + "connection": obj.get("connection"), + "platform": obj.get("platform"), + "gateway": obj.get("gateway"), + "proxyTarget": obj.get("proxyTarget"), + "vpnTarget": obj.get("vpnTarget"), + "agentId": obj.get("agentId"), + "networkId": obj.get("networkId"), + "ssid": obj.get("ssid"), + "bssid": obj.get("bssid"), + "destinationIp": obj.get("destinationIp"), + "domain": obj.get("domain"), + "trigger": obj.get("trigger"), + "visitedSite": obj.get("visitedSite") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_results.py b/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_results.py new file mode 100644 index 00000000..62242853 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_real_user_test_results.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_real_user_test import EndpointRealUserTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointRealUserTestResults(BaseModel): + """ + EndpointRealUserTestResults + """ # noqa: E501 + results: Optional[List[EndpointRealUserTest]] = None + __properties: ClassVar[List[str]] = ["results"] + + 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 EndpointRealUserTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointRealUserTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [EndpointRealUserTest.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_result_request_filter.py b/endpoint/test_results_api/test_results_api/models/endpoint_result_request_filter.py new file mode 100644 index 00000000..6003d12b --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_result_request_filter.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.interface_hardware_type import InterfaceHardwareType +from test_results_api.models.platform import Platform +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointResultRequestFilter(BaseModel): + """ + EndpointResultRequestFilter + """ # noqa: E501 + location: Optional[List[StrictStr]] = Field(default=None, description="Location of the endpoint agent.") + connection: Optional[List[InterfaceHardwareType]] = None + platform: Optional[List[Platform]] = None + gateway: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent default gateway IP address.") + proxy_target: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent proxy IP address.", alias="proxyTarget") + vpn_target: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent VPN endpoint IP address.", alias="vpnTarget") + agent_id: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent ID.", alias="agentId") + network_id: Optional[List[StrictStr]] = Field(default=None, description="Network ID.", alias="networkId") + ssid: Optional[List[StrictStr]] = Field(default=None, description="WiFi SSID.") + bssid: Optional[List[StrictStr]] = Field(default=None, description="WiFi BSSID.") + __properties: ClassVar[List[str]] = ["location", "connection", "platform", "gateway", "proxyTarget", "vpnTarget", "agentId", "networkId", "ssid", "bssid"] + + 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 EndpointResultRequestFilter 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 EndpointResultRequestFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "location": obj.get("location"), + "connection": obj.get("connection"), + "platform": obj.get("platform"), + "gateway": obj.get("gateway"), + "proxyTarget": obj.get("proxyTarget"), + "vpnTarget": obj.get("vpnTarget"), + "agentId": obj.get("agentId"), + "networkId": obj.get("networkId"), + "ssid": obj.get("ssid"), + "bssid": obj.get("bssid") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_scheduled_test.py b/endpoint/test_results_api/test_results_api/models/endpoint_scheduled_test.py new file mode 100644 index 00000000..98f885d3 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_scheduled_test.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from test_results_api.models.endpoint_http_server_test import EndpointHttpServerTest +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 + +ENDPOINTSCHEDULEDTEST_ONE_OF_SCHEMAS = ["EndpointAgentToServerTest", "EndpointHttpServerTest"] + +class EndpointScheduledTest(BaseModel): + """ + EndpointScheduledTest + """ + # data type: EndpointAgentToServerTest + oneof_schema_1_validator: Optional[EndpointAgentToServerTest] = None + # data type: EndpointHttpServerTest + oneof_schema_2_validator: Optional[EndpointHttpServerTest] = None + actual_instance: Optional[Union[EndpointAgentToServerTest, EndpointHttpServerTest]] = None + one_of_schemas: List[str] = Literal["EndpointAgentToServerTest", "EndpointHttpServerTest"] + + model_config = { + "validate_assignment": True + } + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = EndpointScheduledTest.model_construct() + error_messages = [] + match = 0 + # validate data type: EndpointAgentToServerTest + if not isinstance(v, EndpointAgentToServerTest): + error_messages.append(f"Error! Input type `{type(v)}` is not `EndpointAgentToServerTest`") + else: + match += 1 + # validate data type: EndpointHttpServerTest + if not isinstance(v, EndpointHttpServerTest): + error_messages.append(f"Error! Input type `{type(v)}` is not `EndpointHttpServerTest`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in EndpointScheduledTest with oneOf schemas: EndpointAgentToServerTest, EndpointHttpServerTest. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in EndpointScheduledTest with oneOf schemas: EndpointAgentToServerTest, EndpointHttpServerTest. 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 EndpointAgentToServerTest + try: + instance.actual_instance = EndpointAgentToServerTest.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EndpointHttpServerTest + try: + instance.actual_instance = EndpointHttpServerTest.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 EndpointScheduledTest with oneOf schemas: EndpointAgentToServerTest, EndpointHttpServerTest. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into EndpointScheduledTest with oneOf schemas: EndpointAgentToServerTest, EndpointHttpServerTest. 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()) + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_scheduled_test_type.py b/endpoint/test_results_api/test_results_api/models/endpoint_scheduled_test_type.py new file mode 100644 index 00000000..47d4a76b --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_scheduled_test_type.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 EndpointScheduledTestType(str, Enum): + """ + Type of test being queried. + """ + + """ + allowed enum values + """ + AGENT_MINUS_TO_MINUS_SERVER = 'agent-to-server' + HTTP_MINUS_SERVER = 'http-server' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointScheduledTestType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_specific_agents_selector_config.py b/endpoint/test_results_api/test_results_api/models/endpoint_specific_agents_selector_config.py new file mode 100644 index 00000000..9e6a9335 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_specific_agents_selector_config.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 typing_extensions import Annotated +from test_results_api.models.specific_agents_selector_type import SpecificAgentsSelectorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointSpecificAgentsSelectorConfig(BaseModel): + """ + Specific agents selection object. + """ # noqa: E501 + agent_selector_type: Optional[SpecificAgentsSelectorType] = Field(default=None, alias="agentSelectorType") + max_machines: Optional[Annotated[int, Field(le=5000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") + __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines", "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 EndpointSpecificAgentsSelectorConfig 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 EndpointSpecificAgentsSelectorConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "maxMachines": obj.get("maxMachines"), + "agents": obj.get("agents") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_test.py b/endpoint/test_results_api/test_results_api/models/endpoint_test.py new file mode 100644 index 00000000..5ea36746 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_test.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from test_results_api.models.endpoint_scheduled_test_type import EndpointScheduledTestType +from test_results_api.models.endpoint_test_aid import EndpointTestAid +from test_results_api.models.endpoint_test_links import EndpointTestLinks +from test_results_api.models.endpoint_test_protocol import EndpointTestProtocol +from test_results_api.models.test_interval import TestInterval +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointTest(BaseModel): + """ + EndpointTest + """ # noqa: E501 + links: Optional[EndpointTestLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + is_saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="isSavedEvent") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + protocol: Optional[EndpointTestProtocol] = None + server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + type: Optional[EndpointScheduledTestType] = None + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "aid", "testName", "type"] + + 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 EndpointTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_date", + "is_enabled", + "is_saved_event", + "modified_date", + "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() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": EndpointTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "isSavedEvent": obj.get("isSavedEvent"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName"), + "type": obj.get("type") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_test_aid.py b/endpoint/test_results_api/test_results_api/models/endpoint_test_aid.py new file mode 100644 index 00000000..eaa8bb97 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_test_aid.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 EndpointTestAid(BaseModel): + """ + EndpointTestAid + """ # 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 EndpointTestAid 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 EndpointTestAid 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 + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_test_auth_type.py b/endpoint/test_results_api/test_results_api/models/endpoint_test_auth_type.py new file mode 100644 index 00000000..dc372568 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_test_auth_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 EndpointTestAuthType(str, Enum): + """ + HTTP authentication type. + """ + + """ + allowed enum values + """ + NONE = 'none' + BASIC = 'basic' + NTLM = 'ntlm' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointTestAuthType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_test_links.py b/endpoint/test_results_api/test_results_api/models/endpoint_test_links.py new file mode 100644 index 00000000..618bc111 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_test_links.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_test_links_self import EndpointTestLinksSelf +from test_results_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointTestLinks(BaseModel): + """ + A list of links that can be accessed to get more information. + """ # noqa: E501 + var_self: Optional[EndpointTestLinksSelf] = Field(default=None, alias="self") + test_results: Optional[EndpointTestLinksTestResults] = 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 EndpointTestLinks 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 EndpointTestLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": EndpointTestLinksSelf.from_dict(obj.get("self")) if obj.get("self") is not None else None, + "testResults": EndpointTestLinksTestResults.from_dict(obj.get("testResults")) if obj.get("testResults") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_test_links_self.py b/endpoint/test_results_api/test_results_api/models/endpoint_test_links_self.py new file mode 100644 index 00000000..34f3e71a --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_test_links_self.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 EndpointTestLinksSelf(BaseModel): + """ + EndpointTestLinksSelf + """ # 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 EndpointTestLinksSelf 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 EndpointTestLinksSelf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "href": obj.get("href"), + "templated": obj.get("templated"), + "type": obj.get("type"), + "deprecation": obj.get("deprecation"), + "name": obj.get("name"), + "profile": obj.get("profile"), + "title": obj.get("title"), + "hreflang": obj.get("hreflang") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_test_links_test_results.py b/endpoint/test_results_api/test_results_api/models/endpoint_test_links_test_results.py new file mode 100644 index 00000000..33608ccc --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_test_links_test_results.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_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 + +ENDPOINTTESTLINKSTESTRESULTS_ONE_OF_SCHEMAS = ["Link", "List[Link]"] + +class EndpointTestLinksTestResults(BaseModel): + """ + EndpointTestLinksTestResults + """ + # 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 = EndpointTestLinksTestResults.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 EndpointTestLinksTestResults 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 EndpointTestLinksTestResults 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 EndpointTestLinksTestResults 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 EndpointTestLinksTestResults 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()) + + diff --git a/endpoint/test_results_api/test_results_api/models/endpoint_test_protocol.py b/endpoint/test_results_api/test_results_api/models/endpoint_test_protocol.py new file mode 100644 index 00000000..ca449403 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/endpoint_test_protocol.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 EndpointTestProtocol(str, Enum): + """ + Protocol used to perform the test. + """ + + """ + allowed enum values + """ + ICMP = 'icmp' + ICMP_MINUS_WITH_MINUS_TCP_MINUS_CONNECT = 'icmp-with-tcp-connect' + TCP = 'tcp' + PREFER_MINUS_TCP = 'prefer-tcp' + AST_MINUS_AUTODETECT = 'ast-autodetect' + AUTODETECT = 'autodetect' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointTestProtocol from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/error.py b/endpoint/test_results_api/test_results_api/models/error.py new file mode 100644 index 00000000..a72b463e --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 + + diff --git a/endpoint/test_results_api/test_results_api/models/ethernet_profile.py b/endpoint/test_results_api/test_results_api/models/ethernet_profile.py new file mode 100644 index 00000000..fa15b02f --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/ethernet_profile.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EthernetProfile(BaseModel): + """ + EthernetProfile + """ # noqa: E501 + link_speed: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Ethernet profile link speed", alias="linkSpeed") + __properties: ClassVar[List[str]] = ["linkSpeed"] + + 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 EthernetProfile 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={ + "link_speed", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EthernetProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "linkSpeed": obj.get("linkSpeed") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/expand.py b/endpoint/test_results_api/test_results_api/models/expand.py new file mode 100644 index 00000000..9077f003 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/expand.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 Expand(str, Enum): + """ + Expand + """ + + """ + allowed enum values + """ + HEADER = 'header' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Expand from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/get_dynamic_test_result_network_pathvis200_response.py b/endpoint/test_results_api/test_results_api/models/get_dynamic_test_result_network_pathvis200_response.py new file mode 100644 index 00000000..c58c9f3f --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_dynamic_test_result_network_pathvis200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from pydantic import Field +from test_results_api.models.dynamic_test import DynamicTest +from test_results_api.models.path_vis_dynamic_test_result import PathVisDynamicTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetDynamicTestResultNetworkPathvis200Response(BaseModel): + """ + GetDynamicTestResultNetworkPathvis200Response + """ # noqa: E501 + results: Optional[List[PathVisDynamicTestResult]] = None + test: Optional[DynamicTest] = None + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "startDate", "endDate", "_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 GetDynamicTestResultNetworkPathvis200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetDynamicTestResultNetworkPathvis200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisDynamicTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": DynamicTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/get_dynamic_test_result_pathvis_agent_round200_response.py b/endpoint/test_results_api/test_results_api/models/get_dynamic_test_result_pathvis_agent_round200_response.py new file mode 100644 index 00000000..6270bce6 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_dynamic_test_result_pathvis_agent_round200_response.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.dynamic_test import DynamicTest +from test_results_api.models.path_vis_detail_dynamic_test_result import PathVisDetailDynamicTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetDynamicTestResultPathvisAgentRound200Response(BaseModel): + """ + GetDynamicTestResultPathvisAgentRound200Response + """ # noqa: E501 + results: Optional[List[PathVisDetailDynamicTestResult]] = None + test: Optional[DynamicTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "_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 GetDynamicTestResultPathvisAgentRound200Response 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetDynamicTestResultPathvisAgentRound200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisDetailDynamicTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": DynamicTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/get_endpoint_local_network_topology_details200_response.py b/endpoint/test_results_api/test_results_api/models/get_endpoint_local_network_topology_details200_response.py new file mode 100644 index 00000000..80443561 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_endpoint_local_network_topology_details200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.local_network_topology_result import LocalNetworkTopologyResult +from test_results_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointLocalNetworkTopologyDetails200Response(BaseModel): + """ + GetEndpointLocalNetworkTopologyDetails200Response + """ # noqa: E501 + results: Optional[List[LocalNetworkTopologyResult]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "_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 GetEndpointLocalNetworkTopologyDetails200Response 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _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 GetEndpointLocalNetworkTopologyDetails200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [LocalNetworkTopologyResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/get_endpoint_local_networks200_response.py b/endpoint/test_results_api/test_results_api/models/get_endpoint_local_networks200_response.py new file mode 100644 index 00000000..a56988fd --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_endpoint_local_networks200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.local_network_result import LocalNetworkResult +from test_results_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointLocalNetworks200Response(BaseModel): + """ + GetEndpointLocalNetworks200Response + """ # noqa: E501 + local_networks: Optional[List[LocalNetworkResult]] = Field(default=None, alias="localNetworks") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["localNetworks", "_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 GetEndpointLocalNetworks200Response 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 local_networks (list) + _items = [] + if self.local_networks: + for _item in self.local_networks: + if _item: + _items.append(_item.to_dict()) + _dict['localNetworks'] = _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 GetEndpointLocalNetworks200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "localNetworks": [LocalNetworkResult.from_dict(_item) for _item in obj.get("localNetworks")] if obj.get("localNetworks") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/get_endpoint_local_networks_topologies200_response.py b/endpoint/test_results_api/test_results_api/models/get_endpoint_local_networks_topologies200_response.py new file mode 100644 index 00000000..39069f21 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_endpoint_local_networks_topologies200_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from pydantic import Field +from test_results_api.models.local_network_topology_result_base import LocalNetworkTopologyResultBase +from test_results_api.models.pagination_next_link_links import PaginationNextLinkLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointLocalNetworksTopologies200Response(BaseModel): + """ + GetEndpointLocalNetworksTopologies200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[LocalNetworkTopologyResultBase]] = None + links: Optional[PaginationNextLinkLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "_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 GetEndpointLocalNetworksTopologies200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _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 GetEndpointLocalNetworksTopologies200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [LocalNetworkTopologyResultBase.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "_links": PaginationNextLinkLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/get_endpoint_local_networks_topologies_request.py b/endpoint/test_results_api/test_results_api/models/get_endpoint_local_networks_topologies_request.py new file mode 100644 index 00000000..e76421bb --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_endpoint_local_networks_topologies_request.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_network_topology_result_request_filter import EndpointNetworkTopologyResultRequestFilter +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointLocalNetworksTopologiesRequest(BaseModel): + """ + GetEndpointLocalNetworksTopologiesRequest + """ # noqa: E501 + search_filters: Optional[EndpointNetworkTopologyResultRequestFilter] = Field(default=None, alias="searchFilters") + __properties: ClassVar[List[str]] = ["searchFilters"] + + 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 GetEndpointLocalNetworksTopologiesRequest 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 search_filters + if self.search_filters: + _dict['searchFilters'] = self.search_filters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetEndpointLocalNetworksTopologiesRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "searchFilters": EndpointNetworkTopologyResultRequestFilter.from_dict(obj.get("searchFilters")) if obj.get("searchFilters") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_test_details200_response.py b/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_test_details200_response.py new file mode 100644 index 00000000..e0d52f28 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_test_details200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_real_user_test_detail import EndpointRealUserTestDetail +from test_results_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointRealUserTestDetails200Response(BaseModel): + """ + GetEndpointRealUserTestDetails200Response + """ # noqa: E501 + results: Optional[List[EndpointRealUserTestDetail]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "_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 GetEndpointRealUserTestDetails200Response 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _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 GetEndpointRealUserTestDetails200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [EndpointRealUserTestDetail.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_test_pages_details200_response.py b/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_test_pages_details200_response.py new file mode 100644 index 00000000..05a8f6e2 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_test_pages_details200_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointRealUserTestPagesDetails200Response(BaseModel): + """ + GetEndpointRealUserTestPagesDetails200Response + """ # 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 GetEndpointRealUserTestPagesDetails200Response 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 GetEndpointRealUserTestPagesDetails200Response 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 + + diff --git a/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_tests200_response.py b/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_tests200_response.py new file mode 100644 index 00000000..77db832b --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_tests200_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from pydantic import Field +from test_results_api.models.endpoint_real_user_test import EndpointRealUserTest +from test_results_api.models.pagination_next_link_links import PaginationNextLinkLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointRealUserTests200Response(BaseModel): + """ + GetEndpointRealUserTests200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[EndpointRealUserTest]] = None + links: Optional[PaginationNextLinkLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "_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 GetEndpointRealUserTests200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _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 GetEndpointRealUserTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [EndpointRealUserTest.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "_links": PaginationNextLinkLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_tests_network200_response.py b/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_tests_network200_response.py new file mode 100644 index 00000000..8d2410a6 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_tests_network200_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from pydantic import Field +from test_results_api.models.pagination_next_link_links import PaginationNextLinkLinks +from test_results_api.models.real_user_test_network_result import RealUserTestNetworkResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointRealUserTestsNetwork200Response(BaseModel): + """ + GetEndpointRealUserTestsNetwork200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[RealUserTestNetworkResult]] = None + links: Optional[PaginationNextLinkLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "_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 GetEndpointRealUserTestsNetwork200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _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 GetEndpointRealUserTestsNetwork200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [RealUserTestNetworkResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "_links": PaginationNextLinkLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_tests_pages200_response.py b/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_tests_pages200_response.py new file mode 100644 index 00000000..8cf68fb5 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_tests_pages200_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from pydantic import Field +from test_results_api.models.pagination_next_link_links import PaginationNextLinkLinks +from test_results_api.models.real_user_test_page_result import RealUserTestPageResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointRealUserTestsPages200Response(BaseModel): + """ + GetEndpointRealUserTestsPages200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[RealUserTestPageResult]] = None + links: Optional[PaginationNextLinkLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "_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 GetEndpointRealUserTestsPages200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _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 GetEndpointRealUserTestsPages200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [RealUserTestPageResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "_links": PaginationNextLinkLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_tests_request.py b/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_tests_request.py new file mode 100644 index 00000000..eb56759e --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_endpoint_real_user_tests_request.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_real_user_test_result_request_filter import EndpointRealUserTestResultRequestFilter +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointRealUserTestsRequest(BaseModel): + """ + GetEndpointRealUserTestsRequest + """ # noqa: E501 + search_filters: Optional[EndpointRealUserTestResultRequestFilter] = Field(default=None, alias="searchFilters") + __properties: ClassVar[List[str]] = ["searchFilters"] + + 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 GetEndpointRealUserTestsRequest 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 search_filters + if self.search_filters: + _dict['searchFilters'] = self.search_filters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetEndpointRealUserTestsRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "searchFilters": EndpointRealUserTestResultRequestFilter.from_dict(obj.get("searchFilters")) if obj.get("searchFilters") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/get_test_result_http_server200_response.py b/endpoint/test_results_api/test_results_api/models/get_test_result_http_server200_response.py new file mode 100644 index 00000000..7efaa5c6 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_test_result_http_server200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from pydantic import Field +from test_results_api.models.endpoint_http_server_test import EndpointHttpServerTest +from test_results_api.models.http_test_result import HttpTestResult +from test_results_api.models.pagination_next_link_links import PaginationNextLinkLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultHttpServer200Response(BaseModel): + """ + GetTestResultHttpServer200Response + """ # noqa: E501 + results: Optional[List[HttpTestResult]] = None + test: Optional[EndpointHttpServerTest] = None + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[PaginationNextLinkLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "startDate", "endDate", "_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 GetTestResultHttpServer200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultHttpServer200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [HttpTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": EndpointHttpServerTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationNextLinkLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/get_test_result_network_pathvis200_response.py b/endpoint/test_results_api/test_results_api/models/get_test_result_network_pathvis200_response.py new file mode 100644 index 00000000..db23b026 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_test_result_network_pathvis200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from pydantic import Field +from test_results_api.models.endpoint_scheduled_test import EndpointScheduledTest +from test_results_api.models.path_vis_test_result import PathVisTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultNetworkPathvis200Response(BaseModel): + """ + GetTestResultNetworkPathvis200Response + """ # noqa: E501 + results: Optional[List[PathVisTestResult]] = None + test: Optional[EndpointScheduledTest] = None + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "startDate", "endDate", "_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 GetTestResultNetworkPathvis200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultNetworkPathvis200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": EndpointScheduledTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/get_test_result_pathvis_agent_round200_response.py b/endpoint/test_results_api/test_results_api/models/get_test_result_pathvis_agent_round200_response.py new file mode 100644 index 00000000..3733b397 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/get_test_result_pathvis_agent_round200_response.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_scheduled_test import EndpointScheduledTest +from test_results_api.models.path_vis_detail_test_result import PathVisDetailTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultPathvisAgentRound200Response(BaseModel): + """ + GetTestResultPathvisAgentRound200Response + """ # noqa: E501 + results: Optional[List[PathVisDetailTestResult]] = None + test: Optional[EndpointScheduledTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "_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 GetTestResultPathvisAgentRound200Response 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultPathvisAgentRound200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisDetailTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": EndpointScheduledTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/hop.py b/endpoint/test_results_api/test_results_api/models/hop.py new file mode 100644 index 00000000..746cb5dd --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/hop.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 Hop(BaseModel): + """ + Hop + """ # noqa: E501 + hop: Optional[StrictInt] = Field(default=None, description="The hop index.") + ip_address: Optional[StrictStr] = Field(default=None, description="IP address of the hop.", alias="ipAddress") + prefix: Optional[StrictStr] = Field(default=None, description="Prefix of IP address shown in CIDR.") + __properties: ClassVar[List[str]] = ["hop", "ipAddress", "prefix"] + + 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 Hop 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={ + "hop", + "ip_address", + "prefix", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Hop from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "hop": obj.get("hop"), + "ipAddress": obj.get("ipAddress"), + "prefix": obj.get("prefix") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/http_error_type.py b/endpoint/test_results_api/test_results_api/models/http_error_type.py new file mode 100644 index 00000000..43b37586 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/http_error_type.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 HttpErrorType(str, Enum): + """ + Type of error encountered; corresponds to phase of connection. + """ + + """ + allowed enum values + """ + CONNECT = 'connect' + DNS = 'dns' + HTTP = 'http' + NONE = 'none' + SEND = 'send' + SSL = 'ssl' + RECEIVE = 'receive' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of HttpErrorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/http_test_result.py b/endpoint/test_results_api/test_results_api/models/http_test_result.py new file mode 100644 index 00000000..15ed2fcf --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/http_test_result.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from test_results_api.models.account_group_id import AccountGroupId +from test_results_api.models.http_error_type import HttpErrorType +from test_results_api.models.http_test_result_headers import HttpTestResultHeaders +from test_results_api.models.network_profile import NetworkProfile +from test_results_api.models.system_metrics import SystemMetrics +from test_results_api.models.vpn_profile import VpnProfile +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class HttpTestResult(BaseModel): + """ + HttpTestResult + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + aid: Optional[AccountGroupId] = None + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of destination server.", alias="serverIp") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + connect_time: Optional[StrictInt] = Field(default=None, description="Time required to establish a TCP connection to the server in milliseconds.", alias="connectTime") + dns_time: Optional[StrictInt] = Field(default=None, description="Time required to resolve DNS in milliseconds.", alias="dnsTime") + error_type: Optional[HttpErrorType] = Field(default=None, alias="errorType") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error were encountered.", alias="errorDetails") + headers: Optional[HttpTestResultHeaders] = None + num_redirects: Optional[StrictInt] = Field(default=None, description="Number of redirects.", alias="numRedirects") + receive_time: Optional[StrictInt] = Field(default=None, description="Elapsed time between first and last byte of response in milliseconds.", alias="receiveTime") + redirect_time: Optional[StrictInt] = Field(default=None, description="Cumulative redirect timing in milliseconds.", alias="redirectTime") + response_code: Optional[StrictInt] = Field(default=None, description="HTTP response code.", alias="responseCode") + response_time: Optional[StrictInt] = Field(default=None, description="Time to first byte in milliseconds.", alias="responseTime") + ssl_time: Optional[StrictInt] = Field(default=None, description="Time to negotiate SSL/TLS in milliseconds.", alias="sslTime") + total_time: Optional[StrictInt] = Field(default=None, description="Total time is the response time + receive time.", alias="totalTime") + wait_time: Optional[StrictInt] = Field(default=None, description="Time elapsed between completion of request and first byte of response in milliseconds.", alias="waitTime") + wire_size: Optional[StrictInt] = Field(default=None, description="Size of content in bytes.", alias="wireSize") + __properties: ClassVar[List[str]] = ["agentId", "aid", "roundId", "serverIp", "systemMetrics", "vpnProfile", "networkProfile", "connectTime", "dnsTime", "errorType", "errorDetails", "headers", "numRedirects", "receiveTime", "redirectTime", "responseCode", "responseTime", "sslTime", "totalTime", "waitTime", "wireSize"] + + 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 HttpTestResult 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={ + "agent_id", + "round_id", + "server_ip", + "connect_time", + "dns_time", + "error_details", + "num_redirects", + "receive_time", + "redirect_time", + "response_code", + "response_time", + "ssl_time", + "total_time", + "wait_time", + "wire_size", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of headers + if self.headers: + _dict['headers'] = self.headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of HttpTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "aid": AccountGroupId.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj.get("vpnProfile")) if obj.get("vpnProfile") is not None else None, + "networkProfile": NetworkProfile.from_dict(obj.get("networkProfile")) if obj.get("networkProfile") is not None else None, + "connectTime": obj.get("connectTime"), + "dnsTime": obj.get("dnsTime"), + "errorType": obj.get("errorType"), + "errorDetails": obj.get("errorDetails"), + "headers": HttpTestResultHeaders.from_dict(obj.get("headers")) if obj.get("headers") is not None else None, + "numRedirects": obj.get("numRedirects"), + "receiveTime": obj.get("receiveTime"), + "redirectTime": obj.get("redirectTime"), + "responseCode": obj.get("responseCode"), + "responseTime": obj.get("responseTime"), + "sslTime": obj.get("sslTime"), + "totalTime": obj.get("totalTime"), + "waitTime": obj.get("waitTime"), + "wireSize": obj.get("wireSize") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/http_test_result_headers.py b/endpoint/test_results_api/test_results_api/models/http_test_result_headers.py new file mode 100644 index 00000000..1b35bcbc --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/http_test_result_headers.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 HttpTestResultHeaders(BaseModel): + """ + Expandable object containing both request and response headers. + """ # noqa: E501 + request_headers: Optional[StrictStr] = Field(default=None, description="CRLF-delimited list of request headers in `header: value` format.", alias="requestHeaders") + response_headers: Optional[StrictStr] = Field(default=None, description="CRLF-delimited list of response headers in `header: value` format.", alias="responseHeaders") + __properties: ClassVar[List[str]] = ["requestHeaders", "responseHeaders"] + + 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 HttpTestResultHeaders 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={ + "request_headers", + "response_headers", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of HttpTestResultHeaders from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "requestHeaders": obj.get("requestHeaders"), + "responseHeaders": obj.get("responseHeaders") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/http_test_results.py b/endpoint/test_results_api/test_results_api/models/http_test_results.py new file mode 100644 index 00000000..072b9e3a --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/http_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_http_server_test import EndpointHttpServerTest +from test_results_api.models.http_test_result import HttpTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class HttpTestResults(BaseModel): + """ + HttpTestResults + """ # noqa: E501 + results: Optional[List[HttpTestResult]] = None + test: Optional[EndpointHttpServerTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 HttpTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of HttpTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [HttpTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": EndpointHttpServerTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/interface_hardware_type.py b/endpoint/test_results_api/test_results_api/models/interface_hardware_type.py new file mode 100644 index 00000000..86ab3e16 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/interface_hardware_type.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 InterfaceHardwareType(str, Enum): + """ + InterfaceHardwareType + """ + + """ + allowed enum values + """ + UNKNOWN = 'unknown' + WIRELESS = 'wireless' + ETHERNET = 'ethernet' + MODEM = 'modem' + VIRTUAL = 'virtual' + LOOPBACK = 'loopback' + OTHER = 'other' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of InterfaceHardwareType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/link.py b/endpoint/test_results_api/test_results_api/models/link.py new file mode 100644 index 00000000..047169f3 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 + + diff --git a/endpoint/test_results_api/test_results_api/models/local_network_result.py b/endpoint/test_results_api/test_results_api/models/local_network_result.py new file mode 100644 index 00000000..a6800d7c --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/local_network_result.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 LocalNetworkResult(BaseModel): + """ + LocalNetworkResult + """ # noqa: E501 + network_id: Optional[StrictStr] = Field(default=None, description="The network ID. Each network occurrence has a unique ID.", alias="networkId") + network_name: Optional[StrictStr] = Field(default=None, description="The network name.", alias="networkName") + local_prefix: Optional[StrictStr] = Field(default=None, description="Network local private address.", alias="localPrefix") + public_ip_range: Optional[StrictStr] = Field(default=None, description="Network public IP range.", alias="publicIpRange") + __properties: ClassVar[List[str]] = ["networkId", "networkName", "localPrefix", "publicIpRange"] + + 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 LocalNetworkResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "network_id", + "network_name", + "local_prefix", + "public_ip_range", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of LocalNetworkResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "networkId": obj.get("networkId"), + "networkName": obj.get("networkName"), + "localPrefix": obj.get("localPrefix"), + "publicIpRange": obj.get("publicIpRange") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/local_network_results.py b/endpoint/test_results_api/test_results_api/models/local_network_results.py new file mode 100644 index 00000000..a696dc2f --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/local_network_results.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.local_network_result import LocalNetworkResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class LocalNetworkResults(BaseModel): + """ + LocalNetworkResults + """ # noqa: E501 + local_networks: Optional[List[LocalNetworkResult]] = Field(default=None, alias="localNetworks") + __properties: ClassVar[List[str]] = ["localNetworks"] + + 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 LocalNetworkResults 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 local_networks (list) + _items = [] + if self.local_networks: + for _item in self.local_networks: + if _item: + _items.append(_item.to_dict()) + _dict['localNetworks'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of LocalNetworkResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "localNetworks": [LocalNetworkResult.from_dict(_item) for _item in obj.get("localNetworks")] if obj.get("localNetworks") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/local_network_topology_detail_results.py b/endpoint/test_results_api/test_results_api/models/local_network_topology_detail_results.py new file mode 100644 index 00000000..9785768c --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/local_network_topology_detail_results.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.local_network_topology_result import LocalNetworkTopologyResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class LocalNetworkTopologyDetailResults(BaseModel): + """ + LocalNetworkTopologyDetailResults + """ # noqa: E501 + results: Optional[List[LocalNetworkTopologyResult]] = None + __properties: ClassVar[List[str]] = ["results"] + + 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 LocalNetworkTopologyDetailResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of LocalNetworkTopologyDetailResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [LocalNetworkTopologyResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/local_network_topology_result.py b/endpoint/test_results_api/test_results_api/models/local_network_topology_result.py new file mode 100644 index 00000000..b57c31cc --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/local_network_topology_result.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.network_ping import NetworkPing +from test_results_api.models.network_profile import NetworkProfile +from test_results_api.models.network_topology_type import NetworkTopologyType +from test_results_api.models.real_user_test_coordinates import RealUserTestCoordinates +from test_results_api.models.system_metrics import SystemMetrics +from test_results_api.models.tcp_connect import TcpConnect +from test_results_api.models.traceroute import Traceroute +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class LocalNetworkTopologyResult(BaseModel): + """ + LocalNetworkTopologyResult + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + var_date: Optional[datetime] = Field(default=None, description="UTC date when endpoint network topology took place (ISO date-time format).", alias="date") + network_topology_id: Optional[StrictStr] = Field(default=None, description="Network topology ID. Each network topology occurrence has a unique ID.", alias="networkTopologyId") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + target: Optional[StrictStr] = Field(default=None, description="IP of the target the network topology was performed against. This is typically a default gateway, proxy or VPN endpoint.") + target_port: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Port of the target the network topology was performed against.", alias="targetPort") + type: Optional[NetworkTopologyType] = None + icmp_ping: Optional[NetworkPing] = Field(default=None, alias="icmpPing") + is_icmp_blocked: Optional[StrictBool] = Field(default=None, description="Set to `true` if network target is blocking ICMP echo (ping) queries.", alias="isIcmpBlocked") + tcp_connect: Optional[TcpConnect] = Field(default=None, alias="tcpConnect") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + coordinates: Optional[RealUserTestCoordinates] = None + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + icmp_traceroute: Optional[Traceroute] = Field(default=None, alias="icmpTraceroute") + icmp_traceroutes: Optional[List[Traceroute]] = Field(default=None, alias="icmpTraceroutes") + __properties: ClassVar[List[str]] = ["agentId", "date", "networkTopologyId", "roundId", "target", "targetPort", "type", "icmpPing", "isIcmpBlocked", "tcpConnect", "systemMetrics", "coordinates", "networkProfile", "icmpTraceroute", "icmpTraceroutes"] + + 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 LocalNetworkTopologyResult 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={ + "agent_id", + "var_date", + "network_topology_id", + "round_id", + "target", + "target_port", + "type", + "is_icmp_blocked", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of icmp_ping + if self.icmp_ping: + _dict['icmpPing'] = self.icmp_ping.to_dict() + # override the default output from pydantic by calling `to_dict()` of tcp_connect + if self.tcp_connect: + _dict['tcpConnect'] = self.tcp_connect.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of coordinates + if self.coordinates: + _dict['coordinates'] = self.coordinates.to_dict() + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of icmp_traceroute + if self.icmp_traceroute: + _dict['icmpTraceroute'] = self.icmp_traceroute.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in icmp_traceroutes (list) + _items = [] + if self.icmp_traceroutes: + for _item in self.icmp_traceroutes: + if _item: + _items.append(_item.to_dict()) + _dict['icmpTraceroutes'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of LocalNetworkTopologyResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "date": obj.get("date"), + "networkTopologyId": obj.get("networkTopologyId"), + "roundId": obj.get("roundId"), + "target": obj.get("target"), + "targetPort": obj.get("targetPort"), + "type": obj.get("type"), + "icmpPing": NetworkPing.from_dict(obj.get("icmpPing")) if obj.get("icmpPing") is not None else None, + "isIcmpBlocked": obj.get("isIcmpBlocked"), + "tcpConnect": TcpConnect.from_dict(obj.get("tcpConnect")) if obj.get("tcpConnect") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None, + "coordinates": RealUserTestCoordinates.from_dict(obj.get("coordinates")) if obj.get("coordinates") is not None else None, + "networkProfile": NetworkProfile.from_dict(obj.get("networkProfile")) if obj.get("networkProfile") is not None else None, + "icmpTraceroute": Traceroute.from_dict(obj.get("icmpTraceroute")) if obj.get("icmpTraceroute") is not None else None, + "icmpTraceroutes": [Traceroute.from_dict(_item) for _item in obj.get("icmpTraceroutes")] if obj.get("icmpTraceroutes") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/local_network_topology_result_base.py b/endpoint/test_results_api/test_results_api/models/local_network_topology_result_base.py new file mode 100644 index 00000000..e3119074 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/local_network_topology_result_base.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.network_ping import NetworkPing +from test_results_api.models.network_topology_type import NetworkTopologyType +from test_results_api.models.system_metrics import SystemMetrics +from test_results_api.models.tcp_connect import TcpConnect +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class LocalNetworkTopologyResultBase(BaseModel): + """ + LocalNetworkTopologyResultBase + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + var_date: Optional[datetime] = Field(default=None, description="UTC date when endpoint network topology took place (ISO date-time format).", alias="date") + network_topology_id: Optional[StrictStr] = Field(default=None, description="Network topology ID. Each network topology occurrence has a unique ID.", alias="networkTopologyId") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + target: Optional[StrictStr] = Field(default=None, description="IP of the target the network topology was performed against. This is typically a default gateway, proxy or VPN endpoint.") + target_port: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Port of the target the network topology was performed against.", alias="targetPort") + type: Optional[NetworkTopologyType] = None + icmp_ping: Optional[NetworkPing] = Field(default=None, alias="icmpPing") + is_icmp_blocked: Optional[StrictBool] = Field(default=None, description="Set to `true` if network target is blocking ICMP echo (ping) queries.", alias="isIcmpBlocked") + tcp_connect: Optional[TcpConnect] = Field(default=None, alias="tcpConnect") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + __properties: ClassVar[List[str]] = ["agentId", "date", "networkTopologyId", "roundId", "target", "targetPort", "type", "icmpPing", "isIcmpBlocked", "tcpConnect", "systemMetrics"] + + 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 LocalNetworkTopologyResultBase 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={ + "agent_id", + "var_date", + "network_topology_id", + "round_id", + "target", + "target_port", + "type", + "is_icmp_blocked", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of icmp_ping + if self.icmp_ping: + _dict['icmpPing'] = self.icmp_ping.to_dict() + # override the default output from pydantic by calling `to_dict()` of tcp_connect + if self.tcp_connect: + _dict['tcpConnect'] = self.tcp_connect.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of LocalNetworkTopologyResultBase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "date": obj.get("date"), + "networkTopologyId": obj.get("networkTopologyId"), + "roundId": obj.get("roundId"), + "target": obj.get("target"), + "targetPort": obj.get("targetPort"), + "type": obj.get("type"), + "icmpPing": NetworkPing.from_dict(obj.get("icmpPing")) if obj.get("icmpPing") is not None else None, + "isIcmpBlocked": obj.get("isIcmpBlocked"), + "tcpConnect": TcpConnect.from_dict(obj.get("tcpConnect")) if obj.get("tcpConnect") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/local_network_topology_results.py b/endpoint/test_results_api/test_results_api/models/local_network_topology_results.py new file mode 100644 index 00000000..d09f427d --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/local_network_topology_results.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.local_network_topology_result_base import LocalNetworkTopologyResultBase +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class LocalNetworkTopologyResults(BaseModel): + """ + LocalNetworkTopologyResults + """ # noqa: E501 + results: Optional[List[LocalNetworkTopologyResultBase]] = None + __properties: ClassVar[List[str]] = ["results"] + + 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 LocalNetworkTopologyResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of LocalNetworkTopologyResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [LocalNetworkTopologyResultBase.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/multi_test_id_network_test_results.py b/endpoint/test_results_api/test_results_api/models/multi_test_id_network_test_results.py new file mode 100644 index 00000000..1a4a76a9 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/multi_test_id_network_test_results.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.network_test_result import NetworkTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class MultiTestIdNetworkTestResults(BaseModel): + """ + MultiTestIdNetworkTestResults + """ # noqa: E501 + results: Optional[List[NetworkTestResult]] = None + __properties: ClassVar[List[str]] = ["results"] + + 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 MultiTestIdNetworkTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of MultiTestIdNetworkTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [NetworkTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/multi_test_id_tests_data_rounds_search.py b/endpoint/test_results_api/test_results_api/models/multi_test_id_tests_data_rounds_search.py new file mode 100644 index 00000000..ed190025 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/multi_test_id_tests_data_rounds_search.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.multi_test_id_tests_data_search_filter import MultiTestIdTestsDataSearchFilter +from test_results_api.models.tests_data_search_sort import TestsDataSearchSort +from test_results_api.models.tests_data_threshold_filters import TestsDataThresholdFilters +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class MultiTestIdTestsDataRoundsSearch(BaseModel): + """ + MultiTestIdTestsDataRoundsSearch + """ # noqa: E501 + search_sort: Optional[List[TestsDataSearchSort]] = Field(default=None, alias="searchSort") + threshold_filter: Optional[TestsDataThresholdFilters] = Field(default=None, alias="thresholdFilter") + search_filters: Optional[MultiTestIdTestsDataSearchFilter] = Field(default=None, alias="searchFilters") + __properties: ClassVar[List[str]] = ["searchSort", "thresholdFilter", "searchFilters"] + + 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 MultiTestIdTestsDataRoundsSearch 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 search_sort (list) + _items = [] + if self.search_sort: + for _item in self.search_sort: + if _item: + _items.append(_item.to_dict()) + _dict['searchSort'] = _items + # override the default output from pydantic by calling `to_dict()` of threshold_filter + if self.threshold_filter: + _dict['thresholdFilter'] = self.threshold_filter.to_dict() + # override the default output from pydantic by calling `to_dict()` of search_filters + if self.search_filters: + _dict['searchFilters'] = self.search_filters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of MultiTestIdTestsDataRoundsSearch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "searchSort": [TestsDataSearchSort.from_dict(_item) for _item in obj.get("searchSort")] if obj.get("searchSort") is not None else None, + "thresholdFilter": TestsDataThresholdFilters.from_dict(obj.get("thresholdFilter")) if obj.get("thresholdFilter") is not None else None, + "searchFilters": MultiTestIdTestsDataSearchFilter.from_dict(obj.get("searchFilters")) if obj.get("searchFilters") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/multi_test_id_tests_data_search_filter.py b/endpoint/test_results_api/test_results_api/models/multi_test_id_tests_data_search_filter.py new file mode 100644 index 00000000..cb84d953 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/multi_test_id_tests_data_search_filter.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 MultiTestIdTestsDataSearchFilter(BaseModel): + """ + MultiTestIdTestsDataSearchFilter + """ # noqa: E501 + agent_id: Optional[List[StrictStr]] = Field(default=None, description="Filter using the `agent-id`.", alias="agentId") + test_id: Optional[List[StrictStr]] = Field(default=None, alias="testId") + __properties: ClassVar[List[str]] = ["agentId", "testId"] + + 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 MultiTestIdTestsDataSearchFilter 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 MultiTestIdTestsDataSearchFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "testId": obj.get("testId") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/network_dynamic_test_result.py b/endpoint/test_results_api/test_results_api/models/network_dynamic_test_result.py new file mode 100644 index 00000000..0dd5c179 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/network_dynamic_test_result.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.account_group_id import AccountGroupId +from test_results_api.models.dynamic_base_test_result_webex import DynamicBaseTestResultWebex +from test_results_api.models.dynamic_test_application import DynamicTestApplication +from test_results_api.models.network_profile import NetworkProfile +from test_results_api.models.system_metrics import SystemMetrics +from test_results_api.models.vpn_profile import VpnProfile +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class NetworkDynamicTestResult(BaseModel): + """ + NetworkDynamicTestResult + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + aid: Optional[AccountGroupId] = None + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + avg_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Average RTT for packets sent to destination.", alias="avgLatency") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error was encountered.", alias="errorDetails") + jitter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Standard deviation of latency.") + is_icmp_blocked: Optional[StrictBool] = Field(default=None, description="Set to `true` if network target is blocking ICMP echo (ping) queries.", alias="isIcmpBlocked") + loss: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percentage of packets not reaching destination.") + max_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum RTT for packets sent to destination.", alias="maxLatency") + min_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Minimum RTT for packets sent to destination.", alias="minLatency") + application: Optional[DynamicTestApplication] = None + webex: Optional[DynamicBaseTestResultWebex] = None + __properties: ClassVar[List[str]] = ["agentId", "aid", "roundId", "serverIp", "systemMetrics", "vpnProfile", "networkProfile", "avgLatency", "errorDetails", "jitter", "isIcmpBlocked", "loss", "maxLatency", "minLatency", "application", "webex"] + + 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 NetworkDynamicTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "agent_id", + "round_id", + "server_ip", + "avg_latency", + "error_details", + "jitter", + "is_icmp_blocked", + "loss", + "max_latency", + "min_latency", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of webex + if self.webex: + _dict['webex'] = self.webex.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NetworkDynamicTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "aid": AccountGroupId.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj.get("vpnProfile")) if obj.get("vpnProfile") is not None else None, + "networkProfile": NetworkProfile.from_dict(obj.get("networkProfile")) if obj.get("networkProfile") is not None else None, + "avgLatency": obj.get("avgLatency"), + "errorDetails": obj.get("errorDetails"), + "jitter": obj.get("jitter"), + "isIcmpBlocked": obj.get("isIcmpBlocked"), + "loss": obj.get("loss"), + "maxLatency": obj.get("maxLatency"), + "minLatency": obj.get("minLatency"), + "application": obj.get("application"), + "webex": DynamicBaseTestResultWebex.from_dict(obj.get("webex")) if obj.get("webex") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/network_dynamic_test_results.py b/endpoint/test_results_api/test_results_api/models/network_dynamic_test_results.py new file mode 100644 index 00000000..371c9c6a --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/network_dynamic_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.dynamic_test import DynamicTest +from test_results_api.models.network_dynamic_test_result import NetworkDynamicTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class NetworkDynamicTestResults(BaseModel): + """ + NetworkDynamicTestResults + """ # noqa: E501 + results: Optional[List[NetworkDynamicTestResult]] = None + test: Optional[DynamicTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 NetworkDynamicTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NetworkDynamicTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [NetworkDynamicTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": DynamicTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/network_interface.py b/endpoint/test_results_api/test_results_api/models/network_interface.py new file mode 100644 index 00000000..c59dbd15 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/network_interface.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.interface_hardware_type import InterfaceHardwareType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class NetworkInterface(BaseModel): + """ + NetworkInterface + """ # noqa: E501 + ip_address: Optional[StrictStr] = Field(default=None, description="Network IP address.", alias="ipAddress") + subnet_mask: Optional[StrictStr] = Field(default=None, description="Network subnet mask.", alias="subnetMask") + public_ip_address: Optional[StrictStr] = Field(default=None, description="Network public IP address.", alias="publicIpAddress") + local_prefix: Optional[StrictStr] = Field(default=None, description="Network local prefix.", alias="localPrefix") + public_ip_range: Optional[StrictStr] = Field(default=None, description="Network public IP range.", alias="publicIpRange") + dns_servers: Optional[List[StrictStr]] = Field(default=None, description="Network DNS servers.", alias="dnsServers") + hardware_type: Optional[InterfaceHardwareType] = Field(default=None, alias="hardwareType") + interface_name: Optional[StrictStr] = Field(default=None, description="Network interface name.", alias="interfaceName") + __properties: ClassVar[List[str]] = ["ipAddress", "subnetMask", "publicIpAddress", "localPrefix", "publicIpRange", "dnsServers", "hardwareType", "interfaceName"] + + 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 NetworkInterface 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_address", + "subnet_mask", + "public_ip_address", + "local_prefix", + "public_ip_range", + "dns_servers", + "interface_name", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NetworkInterface from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ipAddress": obj.get("ipAddress"), + "subnetMask": obj.get("subnetMask"), + "publicIpAddress": obj.get("publicIpAddress"), + "localPrefix": obj.get("localPrefix"), + "publicIpRange": obj.get("publicIpRange"), + "dnsServers": obj.get("dnsServers"), + "hardwareType": obj.get("hardwareType"), + "interfaceName": obj.get("interfaceName") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/network_metrics.py b/endpoint/test_results_api/test_results_api/models/network_metrics.py new file mode 100644 index 00000000..c829f6f0 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/network_metrics.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class NetworkMetrics(BaseModel): + """ + NetworkMetrics + """ # noqa: E501 + jitter: Optional[StrictInt] = Field(default=None, description="Network jitter.") + latency: Optional[StrictInt] = Field(default=None, description="Network latency.") + loss: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Network loss.") + target: Optional[StrictStr] = Field(default=None, description="Network target IP address.") + __properties: ClassVar[List[str]] = ["jitter", "latency", "loss", "target"] + + 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 NetworkMetrics 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "jitter", + "latency", + "loss", + "target", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NetworkMetrics from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "jitter": obj.get("jitter"), + "latency": obj.get("latency"), + "loss": obj.get("loss"), + "target": obj.get("target") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/network_ping.py b/endpoint/test_results_api/test_results_api/models/network_ping.py new file mode 100644 index 00000000..df584a3e --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/network_ping.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 NetworkPing(BaseModel): + """ + NetworkPing + """ # noqa: E501 + avg_rtt: Optional[StrictInt] = Field(default=None, description="Ping average response time.", alias="avgRtt") + max_rtt: Optional[StrictInt] = Field(default=None, description="Ping maximum response time.", alias="maxRtt") + mean_dev_rtt: Optional[StrictInt] = Field(default=None, description="Ping mean standard deviation response time.", alias="meanDevRtt") + min_rtt: Optional[StrictInt] = Field(default=None, description="Ping minimum response time.", alias="minRtt") + pkts_received: Optional[StrictInt] = Field(default=None, description="Ping packets received.", alias="pktsReceived") + pkts_sent: Optional[StrictInt] = Field(default=None, description="Ping packets sent.", alias="pktsSent") + error: Optional[StrictStr] = Field(default=None, description="Only present when there is an error.") + info_flags: Optional[List[StrictStr]] = Field(default=None, alias="infoFlags") + __properties: ClassVar[List[str]] = ["avgRtt", "maxRtt", "meanDevRtt", "minRtt", "pktsReceived", "pktsSent", "error", "infoFlags"] + + 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 NetworkPing 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={ + "avg_rtt", + "max_rtt", + "mean_dev_rtt", + "min_rtt", + "pkts_received", + "pkts_sent", + "error", + "info_flags", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NetworkPing from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "avgRtt": obj.get("avgRtt"), + "maxRtt": obj.get("maxRtt"), + "meanDevRtt": obj.get("meanDevRtt"), + "minRtt": obj.get("minRtt"), + "pktsReceived": obj.get("pktsReceived"), + "pktsSent": obj.get("pktsSent"), + "error": obj.get("error"), + "infoFlags": obj.get("infoFlags") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/network_profile.py b/endpoint/test_results_api/test_results_api/models/network_profile.py new file mode 100644 index 00000000..afbef86e --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/network_profile.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.ethernet_profile import EthernetProfile +from test_results_api.models.interface_hardware_type import InterfaceHardwareType +from test_results_api.models.network_interface import NetworkInterface +from test_results_api.models.network_proxy_profile import NetworkProxyProfile +from test_results_api.models.network_wireless_profile import NetworkWirelessProfile +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class NetworkProfile(BaseModel): + """ + NetworkProfile + """ # noqa: E501 + ip_address: Optional[StrictStr] = Field(default=None, description="Network IP address.", alias="ipAddress") + subnet_mask: Optional[StrictStr] = Field(default=None, description="Network subnet mask.", alias="subnetMask") + public_ip_address: Optional[StrictStr] = Field(default=None, description="Network public IP address.", alias="publicIpAddress") + local_prefix: Optional[StrictStr] = Field(default=None, description="Network local prefix.", alias="localPrefix") + public_ip_range: Optional[StrictStr] = Field(default=None, description="Network public IP range.", alias="publicIpRange") + dns_servers: Optional[List[StrictStr]] = Field(default=None, description="Network DNS servers.", alias="dnsServers") + hardware_type: Optional[InterfaceHardwareType] = Field(default=None, alias="hardwareType") + interface_name: Optional[StrictStr] = Field(default=None, description="Network interface name.", alias="interfaceName") + error: Optional[StrictStr] = Field(default=None, description="Only present when there is an error") + gateway: Optional[StrictStr] = Field(default=None, description="Network gateway address.") + wireless_profile: Optional[NetworkWirelessProfile] = Field(default=None, alias="wirelessProfile") + proxy_profile: Optional[NetworkProxyProfile] = Field(default=None, alias="proxyProfile") + ethernet_profile: Optional[EthernetProfile] = Field(default=None, alias="ethernetProfile") + previous_interface: Optional[NetworkInterface] = Field(default=None, alias="previousInterface") + __properties: ClassVar[List[str]] = ["ipAddress", "subnetMask", "publicIpAddress", "localPrefix", "publicIpRange", "dnsServers", "hardwareType", "interfaceName", "error", "gateway", "wirelessProfile", "proxyProfile", "ethernetProfile", "previousInterface"] + + 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 NetworkProfile 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "ip_address", + "subnet_mask", + "public_ip_address", + "local_prefix", + "public_ip_range", + "dns_servers", + "interface_name", + "error", + "gateway", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of wireless_profile + if self.wireless_profile: + _dict['wirelessProfile'] = self.wireless_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of proxy_profile + if self.proxy_profile: + _dict['proxyProfile'] = self.proxy_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of ethernet_profile + if self.ethernet_profile: + _dict['ethernetProfile'] = self.ethernet_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of previous_interface + if self.previous_interface: + _dict['previousInterface'] = self.previous_interface.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NetworkProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ipAddress": obj.get("ipAddress"), + "subnetMask": obj.get("subnetMask"), + "publicIpAddress": obj.get("publicIpAddress"), + "localPrefix": obj.get("localPrefix"), + "publicIpRange": obj.get("publicIpRange"), + "dnsServers": obj.get("dnsServers"), + "hardwareType": obj.get("hardwareType"), + "interfaceName": obj.get("interfaceName"), + "error": obj.get("error"), + "gateway": obj.get("gateway"), + "wirelessProfile": NetworkWirelessProfile.from_dict(obj.get("wirelessProfile")) if obj.get("wirelessProfile") is not None else None, + "proxyProfile": NetworkProxyProfile.from_dict(obj.get("proxyProfile")) if obj.get("proxyProfile") is not None else None, + "ethernetProfile": EthernetProfile.from_dict(obj.get("ethernetProfile")) if obj.get("ethernetProfile") is not None else None, + "previousInterface": NetworkInterface.from_dict(obj.get("previousInterface")) if obj.get("previousInterface") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/network_proxy_profile.py b/endpoint/test_results_api/test_results_api/models/network_proxy_profile.py new file mode 100644 index 00000000..408026aa --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/network_proxy_profile.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.network_proxy_profile_proxies_inner import NetworkProxyProfileProxiesInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class NetworkProxyProfile(BaseModel): + """ + NetworkProxyProfile + """ # noqa: E501 + method: Optional[StrictStr] = Field(default=None, description="Proxy profile method.") + proxies: Optional[List[NetworkProxyProfileProxiesInner]] = None + __properties: ClassVar[List[str]] = ["method", "proxies"] + + 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 NetworkProxyProfile 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={ + "method", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in proxies (list) + _items = [] + if self.proxies: + for _item in self.proxies: + if _item: + _items.append(_item.to_dict()) + _dict['proxies'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NetworkProxyProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "method": obj.get("method"), + "proxies": [NetworkProxyProfileProxiesInner.from_dict(_item) for _item in obj.get("proxies")] if obj.get("proxies") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/network_proxy_profile_proxies_inner.py b/endpoint/test_results_api/test_results_api/models/network_proxy_profile_proxies_inner.py new file mode 100644 index 00000000..f049d54c --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/network_proxy_profile_proxies_inner.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 NetworkProxyProfileProxiesInner(BaseModel): + """ + NetworkProxyProfileProxiesInner + """ # noqa: E501 + bypass: Optional[StrictStr] = Field(default=None, description="Proxy bypass expression.") + proxy: Optional[StrictStr] = Field(default=None, description="Proxy mode.") + __properties: ClassVar[List[str]] = ["bypass", "proxy"] + + 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 NetworkProxyProfileProxiesInner 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={ + "bypass", + "proxy", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NetworkProxyProfileProxiesInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bypass": obj.get("bypass"), + "proxy": obj.get("proxy") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/network_test_result.py b/endpoint/test_results_api/test_results_api/models/network_test_result.py new file mode 100644 index 00000000..24f6e721 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/network_test_result.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.account_group_id import AccountGroupId +from test_results_api.models.network_profile import NetworkProfile +from test_results_api.models.system_metrics import SystemMetrics +from test_results_api.models.vpn_profile import VpnProfile +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class NetworkTestResult(BaseModel): + """ + NetworkTestResult + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + aid: Optional[AccountGroupId] = None + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + avg_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Average RTT for packets sent to destination.", alias="avgLatency") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error was encountered.", alias="errorDetails") + jitter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Standard deviation of latency.") + is_icmp_blocked: Optional[StrictBool] = Field(default=None, description="Set to `true` if network target is blocking ICMP echo (ping) queries.", alias="isIcmpBlocked") + loss: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percentage of packets not reaching destination.") + max_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum RTT for packets sent to destination.", alias="maxLatency") + min_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Minimum RTT for packets sent to destination.", alias="minLatency") + __properties: ClassVar[List[str]] = ["agentId", "aid", "roundId", "serverIp", "systemMetrics", "vpnProfile", "networkProfile", "avgLatency", "errorDetails", "jitter", "isIcmpBlocked", "loss", "maxLatency", "minLatency"] + + 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 NetworkTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "agent_id", + "round_id", + "server_ip", + "avg_latency", + "error_details", + "jitter", + "is_icmp_blocked", + "loss", + "max_latency", + "min_latency", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NetworkTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "aid": AccountGroupId.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj.get("vpnProfile")) if obj.get("vpnProfile") is not None else None, + "networkProfile": NetworkProfile.from_dict(obj.get("networkProfile")) if obj.get("networkProfile") is not None else None, + "avgLatency": obj.get("avgLatency"), + "errorDetails": obj.get("errorDetails"), + "jitter": obj.get("jitter"), + "isIcmpBlocked": obj.get("isIcmpBlocked"), + "loss": obj.get("loss"), + "maxLatency": obj.get("maxLatency"), + "minLatency": obj.get("minLatency") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/network_test_results.py b/endpoint/test_results_api/test_results_api/models/network_test_results.py new file mode 100644 index 00000000..b75e9370 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/network_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_scheduled_test import EndpointScheduledTest +from test_results_api.models.network_test_result import NetworkTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class NetworkTestResults(BaseModel): + """ + NetworkTestResults + """ # noqa: E501 + results: Optional[List[NetworkTestResult]] = None + test: Optional[EndpointScheduledTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 NetworkTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NetworkTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [NetworkTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": EndpointScheduledTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/network_topology_type.py b/endpoint/test_results_api/test_results_api/models/network_topology_type.py new file mode 100644 index 00000000..3fd665aa --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/network_topology_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 NetworkTopologyType(str, Enum): + """ + NetworkTopologyType + """ + + """ + allowed enum values + """ + VPN = 'vpn' + PROXY = 'proxy' + GATEWAY = 'gateway' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of NetworkTopologyType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/network_wireless_profile.py b/endpoint/test_results_api/test_results_api/models/network_wireless_profile.py new file mode 100644 index 00000000..3c562554 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/network_wireless_profile.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 NetworkWirelessProfile(BaseModel): + """ + NetworkWirelessProfile + """ # noqa: E501 + ssid: Optional[StrictStr] = Field(default=None, description="Wireless network SSID.") + bssid: Optional[StrictStr] = Field(default=None, description="Wireless network BSSID.") + channel: Optional[StrictInt] = Field(default=None, description="Wireless network channel.") + phy_mode: Optional[StrictStr] = Field(default=None, description="Wireless network PHY mode.", alias="phyMode") + rssi: Optional[StrictInt] = Field(default=None, description="Wireless network RSSI.") + noise: Optional[StrictInt] = Field(default=None, description="Wireless network noise.") + quality: Optional[StrictInt] = Field(default=None, description="Wireless network quality.") + tx_rate: Optional[StrictInt] = Field(default=None, description="Wireless network transmitted rate.", alias="txRate") + vendor: Optional[StrictStr] = Field(default=None, description="Wireless network device vendor.") + __properties: ClassVar[List[str]] = ["ssid", "bssid", "channel", "phyMode", "rssi", "noise", "quality", "txRate", "vendor"] + + 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 NetworkWirelessProfile 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "ssid", + "bssid", + "channel", + "phy_mode", + "rssi", + "noise", + "quality", + "tx_rate", + "vendor", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NetworkWirelessProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ssid": obj.get("ssid"), + "bssid": obj.get("bssid"), + "channel": obj.get("channel"), + "phyMode": obj.get("phyMode"), + "rssi": obj.get("rssi"), + "noise": obj.get("noise"), + "quality": obj.get("quality"), + "txRate": obj.get("txRate"), + "vendor": obj.get("vendor") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/pagination_next_link.py b/endpoint/test_results_api/test_results_api/models/pagination_next_link.py new file mode 100644 index 00000000..72c8fbc9 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/pagination_next_link.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.pagination_next_link_links import PaginationNextLinkLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationNextLink(BaseModel): + """ + A links object containing a related link for forward pagination. + """ # noqa: E501 + links: Optional[PaginationNextLinkLinks] = 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 PaginationNextLink 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 PaginationNextLink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": PaginationNextLinkLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/pagination_next_link_links.py b/endpoint/test_results_api/test_results_api/models/pagination_next_link_links.py new file mode 100644 index 00000000..b805553c --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/pagination_next_link_links.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationNextLinkLinks(BaseModel): + """ + PaginationNextLinkLinks + """ # noqa: E501 + next: Optional[Link] = None + __properties: ClassVar[List[str]] = ["next"] + + 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 PaginationNextLinkLinks 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 next + if self.next: + _dict['next'] = self.next.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PaginationNextLinkLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "next": Link.from_dict(obj.get("next")) if obj.get("next") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/path_vis_base_test_result.py b/endpoint/test_results_api/test_results_api/models/path_vis_base_test_result.py new file mode 100644 index 00000000..1aff68bd --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/path_vis_base_test_result.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from test_results_api.models.account_group_id import AccountGroupId +from test_results_api.models.asn_details import AsnDetails +from test_results_api.models.system_metrics import SystemMetrics +from test_results_api.models.vpn_profile import VpnProfile +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisBaseTestResult(BaseModel): + """ + PathVisBaseTestResult + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + aid: Optional[AccountGroupId] = None + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + asn_details: Optional[AsnDetails] = Field(default=None, alias="asnDetails") + server: Optional[StrictStr] = Field(default=None, description="Target server, including port.") + source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source endpoint agent.", alias="sourceIp") + source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source endpoint agent.", alias="sourcePrefix") + __properties: ClassVar[List[str]] = ["agentId", "aid", "roundId", "serverIp", "systemMetrics", "vpnProfile", "asnDetails", "server", "sourceIp", "sourcePrefix"] + + 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 PathVisBaseTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "agent_id", + "round_id", + "server_ip", + "server", + "source_ip", + "source_prefix", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of asn_details + if self.asn_details: + _dict['asnDetails'] = self.asn_details.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisBaseTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "aid": AccountGroupId.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj.get("vpnProfile")) if obj.get("vpnProfile") is not None else None, + "asnDetails": AsnDetails.from_dict(obj.get("asnDetails")) if obj.get("asnDetails") is not None else None, + "server": obj.get("server"), + "sourceIp": obj.get("sourceIp"), + "sourcePrefix": obj.get("sourcePrefix") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/path_vis_detail_dynamic_test_result.py b/endpoint/test_results_api/test_results_api/models/path_vis_detail_dynamic_test_result.py new file mode 100644 index 00000000..2154a600 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/path_vis_detail_dynamic_test_result.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from test_results_api.models.account_group_id import AccountGroupId +from test_results_api.models.asn_details import AsnDetails +from test_results_api.models.dynamic_base_test_result_webex import DynamicBaseTestResultWebex +from test_results_api.models.dynamic_test_application import DynamicTestApplication +from test_results_api.models.path_vis_route import PathVisRoute +from test_results_api.models.system_metrics import SystemMetrics +from test_results_api.models.vpn_profile import VpnProfile +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisDetailDynamicTestResult(BaseModel): + """ + PathVisDetailDynamicTestResult + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + aid: Optional[AccountGroupId] = None + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + asn_details: Optional[AsnDetails] = Field(default=None, alias="asnDetails") + server: Optional[StrictStr] = Field(default=None, description="Target server, including port.") + source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source endpoint agent.", alias="sourceIp") + source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source endpoint agent.", alias="sourcePrefix") + routes: Optional[List[PathVisRoute]] = Field(default=None, description="Shows iterations of path trace, with each iteration specified by a pathId.") + vpn_routes: Optional[List[PathVisRoute]] = Field(default=None, description="Shows iterations of the VPN path trace, with each iteration specified by a pathId.", alias="vpnRoutes") + application: Optional[DynamicTestApplication] = None + webex: Optional[DynamicBaseTestResultWebex] = None + __properties: ClassVar[List[str]] = ["agentId", "aid", "roundId", "serverIp", "systemMetrics", "vpnProfile", "asnDetails", "server", "sourceIp", "sourcePrefix", "routes", "vpnRoutes", "application", "webex"] + + 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 PathVisDetailDynamicTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "agent_id", + "round_id", + "server_ip", + "server", + "source_ip", + "source_prefix", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of asn_details + if self.asn_details: + _dict['asnDetails'] = self.asn_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in routes (list) + _items = [] + if self.routes: + for _item in self.routes: + if _item: + _items.append(_item.to_dict()) + _dict['routes'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in vpn_routes (list) + _items = [] + if self.vpn_routes: + for _item in self.vpn_routes: + if _item: + _items.append(_item.to_dict()) + _dict['vpnRoutes'] = _items + # override the default output from pydantic by calling `to_dict()` of webex + if self.webex: + _dict['webex'] = self.webex.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisDetailDynamicTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "aid": AccountGroupId.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj.get("vpnProfile")) if obj.get("vpnProfile") is not None else None, + "asnDetails": AsnDetails.from_dict(obj.get("asnDetails")) if obj.get("asnDetails") is not None else None, + "server": obj.get("server"), + "sourceIp": obj.get("sourceIp"), + "sourcePrefix": obj.get("sourcePrefix"), + "routes": [PathVisRoute.from_dict(_item) for _item in obj.get("routes")] if obj.get("routes") is not None else None, + "vpnRoutes": [PathVisRoute.from_dict(_item) for _item in obj.get("vpnRoutes")] if obj.get("vpnRoutes") is not None else None, + "application": obj.get("application"), + "webex": DynamicBaseTestResultWebex.from_dict(obj.get("webex")) if obj.get("webex") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/path_vis_detail_dynamic_test_results.py b/endpoint/test_results_api/test_results_api/models/path_vis_detail_dynamic_test_results.py new file mode 100644 index 00000000..acf4e50d --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/path_vis_detail_dynamic_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.dynamic_test import DynamicTest +from test_results_api.models.path_vis_detail_dynamic_test_result import PathVisDetailDynamicTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisDetailDynamicTestResults(BaseModel): + """ + PathVisDetailDynamicTestResults + """ # noqa: E501 + results: Optional[List[PathVisDetailDynamicTestResult]] = None + test: Optional[DynamicTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 PathVisDetailDynamicTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisDetailDynamicTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisDetailDynamicTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": DynamicTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/path_vis_detail_test_result.py b/endpoint/test_results_api/test_results_api/models/path_vis_detail_test_result.py new file mode 100644 index 00000000..02ecc06c --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/path_vis_detail_test_result.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from test_results_api.models.account_group_id import AccountGroupId +from test_results_api.models.asn_details import AsnDetails +from test_results_api.models.path_vis_route import PathVisRoute +from test_results_api.models.system_metrics import SystemMetrics +from test_results_api.models.vpn_profile import VpnProfile +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisDetailTestResult(BaseModel): + """ + PathVisDetailTestResult + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + aid: Optional[AccountGroupId] = None + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + asn_details: Optional[AsnDetails] = Field(default=None, alias="asnDetails") + server: Optional[StrictStr] = Field(default=None, description="Target server, including port.") + source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source endpoint agent.", alias="sourceIp") + source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source endpoint agent.", alias="sourcePrefix") + routes: Optional[List[PathVisRoute]] = Field(default=None, description="Shows iterations of path trace, with each iteration specified by a pathId.") + vpn_routes: Optional[List[PathVisRoute]] = Field(default=None, description="Shows iterations of the VPN path trace, with each iteration specified by a pathId.", alias="vpnRoutes") + __properties: ClassVar[List[str]] = ["agentId", "aid", "roundId", "serverIp", "systemMetrics", "vpnProfile", "asnDetails", "server", "sourceIp", "sourcePrefix", "routes", "vpnRoutes"] + + 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 PathVisDetailTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "agent_id", + "round_id", + "server_ip", + "server", + "source_ip", + "source_prefix", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of asn_details + if self.asn_details: + _dict['asnDetails'] = self.asn_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in routes (list) + _items = [] + if self.routes: + for _item in self.routes: + if _item: + _items.append(_item.to_dict()) + _dict['routes'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in vpn_routes (list) + _items = [] + if self.vpn_routes: + for _item in self.vpn_routes: + if _item: + _items.append(_item.to_dict()) + _dict['vpnRoutes'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisDetailTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "aid": AccountGroupId.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj.get("vpnProfile")) if obj.get("vpnProfile") is not None else None, + "asnDetails": AsnDetails.from_dict(obj.get("asnDetails")) if obj.get("asnDetails") is not None else None, + "server": obj.get("server"), + "sourceIp": obj.get("sourceIp"), + "sourcePrefix": obj.get("sourcePrefix"), + "routes": [PathVisRoute.from_dict(_item) for _item in obj.get("routes")] if obj.get("routes") is not None else None, + "vpnRoutes": [PathVisRoute.from_dict(_item) for _item in obj.get("vpnRoutes")] if obj.get("vpnRoutes") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/path_vis_detail_test_results.py b/endpoint/test_results_api/test_results_api/models/path_vis_detail_test_results.py new file mode 100644 index 00000000..00e7f0d5 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/path_vis_detail_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_scheduled_test import EndpointScheduledTest +from test_results_api.models.path_vis_detail_test_result import PathVisDetailTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisDetailTestResults(BaseModel): + """ + PathVisDetailTestResults + """ # noqa: E501 + results: Optional[List[PathVisDetailTestResult]] = None + test: Optional[EndpointScheduledTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 PathVisDetailTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisDetailTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisDetailTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": EndpointScheduledTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/path_vis_dynamic_test_result.py b/endpoint/test_results_api/test_results_api/models/path_vis_dynamic_test_result.py new file mode 100644 index 00000000..d0cc7417 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/path_vis_dynamic_test_result.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from test_results_api.models.account_group_id import AccountGroupId +from test_results_api.models.asn_details import AsnDetails +from test_results_api.models.dynamic_base_test_result_webex import DynamicBaseTestResultWebex +from test_results_api.models.dynamic_test_application import DynamicTestApplication +from test_results_api.models.path_vis_endpoint import PathVisEndpoint +from test_results_api.models.system_metrics import SystemMetrics +from test_results_api.models.vpn_profile import VpnProfile +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisDynamicTestResult(BaseModel): + """ + PathVisDynamicTestResult + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + aid: Optional[AccountGroupId] = None + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + asn_details: Optional[AsnDetails] = Field(default=None, alias="asnDetails") + server: Optional[StrictStr] = Field(default=None, description="Target server, including port.") + source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source endpoint agent.", alias="sourceIp") + source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source endpoint agent.", alias="sourcePrefix") + application: Optional[DynamicTestApplication] = None + webex: Optional[DynamicBaseTestResultWebex] = None + location: Optional[StrictStr] = Field(default=None, description="Geographic location of the pathvis.") + endpoints: Optional[List[PathVisEndpoint]] = Field(default=None, description="Shows an iteration of path trace, with each iteration specified by a pathId.") + __properties: ClassVar[List[str]] = ["agentId", "aid", "roundId", "serverIp", "systemMetrics", "vpnProfile", "asnDetails", "server", "sourceIp", "sourcePrefix", "application", "webex", "location", "endpoints"] + + 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 PathVisDynamicTestResult 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={ + "agent_id", + "round_id", + "server_ip", + "server", + "source_ip", + "source_prefix", + "location", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of asn_details + if self.asn_details: + _dict['asnDetails'] = self.asn_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of webex + if self.webex: + _dict['webex'] = self.webex.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in endpoints (list) + _items = [] + if self.endpoints: + for _item in self.endpoints: + if _item: + _items.append(_item.to_dict()) + _dict['endpoints'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisDynamicTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "aid": AccountGroupId.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj.get("vpnProfile")) if obj.get("vpnProfile") is not None else None, + "asnDetails": AsnDetails.from_dict(obj.get("asnDetails")) if obj.get("asnDetails") is not None else None, + "server": obj.get("server"), + "sourceIp": obj.get("sourceIp"), + "sourcePrefix": obj.get("sourcePrefix"), + "application": obj.get("application"), + "webex": DynamicBaseTestResultWebex.from_dict(obj.get("webex")) if obj.get("webex") is not None else None, + "location": obj.get("location"), + "endpoints": [PathVisEndpoint.from_dict(_item) for _item in obj.get("endpoints")] if obj.get("endpoints") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/path_vis_dynamic_test_results.py b/endpoint/test_results_api/test_results_api/models/path_vis_dynamic_test_results.py new file mode 100644 index 00000000..9226cc55 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/path_vis_dynamic_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.dynamic_test import DynamicTest +from test_results_api.models.path_vis_dynamic_test_result import PathVisDynamicTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisDynamicTestResults(BaseModel): + """ + PathVisDynamicTestResults + """ # noqa: E501 + results: Optional[List[PathVisDynamicTestResult]] = None + test: Optional[DynamicTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 PathVisDynamicTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisDynamicTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisDynamicTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": DynamicTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/path_vis_endpoint.py b/endpoint/test_results_api/test_results_api/models/path_vis_endpoint.py new file mode 100644 index 00000000..3aa18d7e --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/path_vis_endpoint.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 PathVisEndpoint(BaseModel): + """ + PathVisEndpoint + """ # noqa: E501 + ip_address: Optional[StrictStr] = Field(default=None, description="IP address of the hop destination.", alias="ipAddress") + number_of_hops: Optional[StrictInt] = Field(default=None, description="Number of hops for path trace to destination.", alias="numberOfHops") + path_id: Optional[StrictStr] = Field(default=None, description="Unique ID of path trace.", alias="pathId") + response_time: Optional[StrictInt] = Field(default=None, description="RTT of the path trace to the destination in milliseconds.", alias="responseTime") + __properties: ClassVar[List[str]] = ["ipAddress", "numberOfHops", "pathId", "responseTime"] + + 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 PathVisEndpoint 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "ip_address", + "number_of_hops", + "path_id", + "response_time", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisEndpoint from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ipAddress": obj.get("ipAddress"), + "numberOfHops": obj.get("numberOfHops"), + "pathId": obj.get("pathId"), + "responseTime": obj.get("responseTime") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/path_vis_hop.py b/endpoint/test_results_api/test_results_api/models/path_vis_hop.py new file mode 100644 index 00000000..db8fb62c --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/path_vis_hop.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 PathVisHop(BaseModel): + """ + PathVisHop + """ # noqa: E501 + hop: Optional[StrictInt] = Field(default=None, description="The hop index.") + ip_address: Optional[StrictStr] = Field(default=None, description="IP address of the hop.", alias="ipAddress") + prefix: Optional[StrictStr] = Field(default=None, description="Prefix of IP address shown in CIDR.") + rdns: Optional[StrictStr] = Field(default=None, description="Reverse DNS entry of IP, if available.") + network: Optional[StrictStr] = Field(default=None, description="Autonomous System originating the prefix.") + response_time: Optional[StrictInt] = Field(default=None, description="RTT to the hop’s IP in milliseconds.", alias="responseTime") + location: Optional[StrictStr] = Field(default=None, description="Location information for the hop.") + __properties: ClassVar[List[str]] = ["hop", "ipAddress", "prefix", "rdns", "network", "responseTime", "location"] + + 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 PathVisHop 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={ + "hop", + "ip_address", + "prefix", + "rdns", + "network", + "response_time", + "location", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisHop from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "hop": obj.get("hop"), + "ipAddress": obj.get("ipAddress"), + "prefix": obj.get("prefix"), + "rdns": obj.get("rdns"), + "network": obj.get("network"), + "responseTime": obj.get("responseTime"), + "location": obj.get("location") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/path_vis_route.py b/endpoint/test_results_api/test_results_api/models/path_vis_route.py new file mode 100644 index 00000000..cb290de2 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/path_vis_route.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.path_vis_hop import PathVisHop +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisRoute(BaseModel): + """ + PathVisRoute + """ # noqa: E501 + path_id: Optional[StrictStr] = Field(default=None, description="Unique ID of path trace.", alias="pathId") + hops: Optional[List[PathVisHop]] = Field(default=None, description="Array of hop objects indicating each step in the traceroute.") + __properties: ClassVar[List[str]] = ["pathId", "hops"] + + 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 PathVisRoute 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={ + "path_id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in hops (list) + _items = [] + if self.hops: + for _item in self.hops: + if _item: + _items.append(_item.to_dict()) + _dict['hops'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisRoute from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pathId": obj.get("pathId"), + "hops": [PathVisHop.from_dict(_item) for _item in obj.get("hops")] if obj.get("hops") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/path_vis_test_result.py b/endpoint/test_results_api/test_results_api/models/path_vis_test_result.py new file mode 100644 index 00000000..aca98dda --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/path_vis_test_result.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from test_results_api.models.account_group_id import AccountGroupId +from test_results_api.models.asn_details import AsnDetails +from test_results_api.models.path_vis_endpoint import PathVisEndpoint +from test_results_api.models.system_metrics import SystemMetrics +from test_results_api.models.vpn_profile import VpnProfile +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisTestResult(BaseModel): + """ + PathVisTestResult + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + aid: Optional[AccountGroupId] = None + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + asn_details: Optional[AsnDetails] = Field(default=None, alias="asnDetails") + server: Optional[StrictStr] = Field(default=None, description="Target server, including port.") + source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source endpoint agent.", alias="sourceIp") + source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source endpoint agent.", alias="sourcePrefix") + location: Optional[StrictStr] = Field(default=None, description="Geographic location of the pathvis.") + endpoints: Optional[List[PathVisEndpoint]] = Field(default=None, description="Shows an iteration of path trace, with each iteration specified by a pathId.") + __properties: ClassVar[List[str]] = ["agentId", "aid", "roundId", "serverIp", "systemMetrics", "vpnProfile", "asnDetails", "server", "sourceIp", "sourcePrefix", "location", "endpoints"] + + 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 PathVisTestResult 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={ + "agent_id", + "round_id", + "server_ip", + "server", + "source_ip", + "source_prefix", + "location", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of asn_details + if self.asn_details: + _dict['asnDetails'] = self.asn_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in endpoints (list) + _items = [] + if self.endpoints: + for _item in self.endpoints: + if _item: + _items.append(_item.to_dict()) + _dict['endpoints'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "aid": AccountGroupId.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj.get("vpnProfile")) if obj.get("vpnProfile") is not None else None, + "asnDetails": AsnDetails.from_dict(obj.get("asnDetails")) if obj.get("asnDetails") is not None else None, + "server": obj.get("server"), + "sourceIp": obj.get("sourceIp"), + "sourcePrefix": obj.get("sourcePrefix"), + "location": obj.get("location"), + "endpoints": [PathVisEndpoint.from_dict(_item) for _item in obj.get("endpoints")] if obj.get("endpoints") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/path_vis_test_results.py b/endpoint/test_results_api/test_results_api/models/path_vis_test_results.py new file mode 100644 index 00000000..4de856dd --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/path_vis_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.endpoint_scheduled_test import EndpointScheduledTest +from test_results_api.models.path_vis_test_result import PathVisTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisTestResults(BaseModel): + """ + PathVisTestResults + """ # noqa: E501 + results: Optional[List[PathVisTestResult]] = None + test: Optional[EndpointScheduledTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 PathVisTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": EndpointScheduledTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/physical_memory_used_bytes.py b/endpoint/test_results_api/test_results_api/models/physical_memory_used_bytes.py new file mode 100644 index 00000000..9734c74a --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/physical_memory_used_bytes.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PhysicalMemoryUsedBytes(BaseModel): + """ + PhysicalMemoryUsedBytes + """ # noqa: E501 + min: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The minimum sampled memory usage value recorded during the monitored period.") + max: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The maximum sampled memory usage value recorded during the monitored period.") + mean: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The mean (average) value of memory usage sampled over the monitored period.") + median: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The median value of memory usage sampled over the monitored period.") + std_dev: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The standard deviation of memory usage sampled during the monitored period.", alias="stdDev") + count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total number of samples collected during the monitored period..") + __properties: ClassVar[List[str]] = ["min", "max", "mean", "median", "stdDev", "count"] + + 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 PhysicalMemoryUsedBytes 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "min", + "max", + "mean", + "median", + "std_dev", + "count", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PhysicalMemoryUsedBytes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "min": obj.get("min"), + "max": obj.get("max"), + "mean": obj.get("mean"), + "median": obj.get("median"), + "stdDev": obj.get("stdDev"), + "count": obj.get("count") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/platform.py b/endpoint/test_results_api/test_results_api/models/platform.py new file mode 100644 index 00000000..697b8818 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/platform.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 Platform(str, Enum): + """ + OS platform types + """ + + """ + allowed enum values + """ + WINDOWS = 'windows' + LINUX = 'linux' + MAC = 'mac' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Platform from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/post_fetch_dynamic_test_result_metrics200_response.py b/endpoint/test_results_api/test_results_api/models/post_fetch_dynamic_test_result_metrics200_response.py new file mode 100644 index 00000000..a78f6a61 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/post_fetch_dynamic_test_result_metrics200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from pydantic import Field +from test_results_api.models.dynamic_test import DynamicTest +from test_results_api.models.network_dynamic_test_result import NetworkDynamicTestResult +from test_results_api.models.pagination_next_link_links import PaginationNextLinkLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PostFetchDynamicTestResultMetrics200Response(BaseModel): + """ + PostFetchDynamicTestResultMetrics200Response + """ # noqa: E501 + results: Optional[List[NetworkDynamicTestResult]] = None + test: Optional[DynamicTest] = None + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[PaginationNextLinkLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "startDate", "endDate", "_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 PostFetchDynamicTestResultMetrics200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 PostFetchDynamicTestResultMetrics200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [NetworkDynamicTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": DynamicTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationNextLinkLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/post_fetch_test_result_metrics200_response.py b/endpoint/test_results_api/test_results_api/models/post_fetch_test_result_metrics200_response.py new file mode 100644 index 00000000..88ce74a8 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/post_fetch_test_result_metrics200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from pydantic import Field +from test_results_api.models.endpoint_scheduled_test import EndpointScheduledTest +from test_results_api.models.network_test_result import NetworkTestResult +from test_results_api.models.pagination_next_link_links import PaginationNextLinkLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PostFetchTestResultMetrics200Response(BaseModel): + """ + PostFetchTestResultMetrics200Response + """ # noqa: E501 + results: Optional[List[NetworkTestResult]] = None + test: Optional[EndpointScheduledTest] = None + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[PaginationNextLinkLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "startDate", "endDate", "_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 PostFetchTestResultMetrics200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 PostFetchTestResultMetrics200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [NetworkTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": EndpointScheduledTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationNextLinkLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/post_fetch_test_result_metrics_multi_test200_response.py b/endpoint/test_results_api/test_results_api/models/post_fetch_test_result_metrics_multi_test200_response.py new file mode 100644 index 00000000..7de0b449 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/post_fetch_test_result_metrics_multi_test200_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from pydantic import Field +from test_results_api.models.network_test_result import NetworkTestResult +from test_results_api.models.pagination_next_link_links import PaginationNextLinkLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PostFetchTestResultMetricsMultiTest200Response(BaseModel): + """ + PostFetchTestResultMetricsMultiTest200Response + """ # noqa: E501 + results: Optional[List[NetworkTestResult]] = None + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[PaginationNextLinkLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "startDate", "endDate", "_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 PostFetchTestResultMetricsMultiTest200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _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 PostFetchTestResultMetricsMultiTest200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [NetworkTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationNextLinkLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/query_window.py b/endpoint/test_results_api/test_results_api/models/query_window.py new file mode 100644 index 00000000..b71aa84a --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/query_window.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class QueryWindow(BaseModel): + """ + QueryWindow + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + __properties: ClassVar[List[str]] = ["startDate", "endDate"] + + 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 QueryWindow 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of QueryWindow from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/real_user_test_coordinates.py b/endpoint/test_results_api/test_results_api/models/real_user_test_coordinates.py new file mode 100644 index 00000000..01594124 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/real_user_test_coordinates.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RealUserTestCoordinates(BaseModel): + """ + Contains approximate GPS location of the endpoint agent, based on endpoint agent’s public IP address. + """ # noqa: E501 + latitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Numeric representations of GPS coordinates.") + location: Optional[StrictStr] = Field(default=None, description="Represents named geographical location.") + longitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Numeric representations of GPS coordinates.") + __properties: ClassVar[List[str]] = ["latitude", "location", "longitude"] + + 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 RealUserTestCoordinates 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={ + "latitude", + "location", + "longitude", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RealUserTestCoordinates from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "latitude": obj.get("latitude"), + "location": obj.get("location"), + "longitude": obj.get("longitude") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/real_user_test_network.py b/endpoint/test_results_api/test_results_api/models/real_user_test_network.py new file mode 100644 index 00000000..8e003541 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/real_user_test_network.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.network_profile import NetworkProfile +from test_results_api.models.real_user_test_network_gateway_ping import RealUserTestNetworkGatewayPing +from test_results_api.models.real_user_test_network_ping import RealUserTestNetworkPing +from test_results_api.models.real_user_test_network_traceroute import RealUserTestNetworkTraceroute +from test_results_api.models.real_user_test_network_vpn_ping import RealUserTestNetworkVpnPing +from test_results_api.models.real_user_test_network_vpn_traceroute import RealUserTestNetworkVpnTraceroute +from test_results_api.models.system_metrics import SystemMetrics +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RealUserTestNetwork(BaseModel): + """ + Contains details about network profile and conditions during session. + """ # noqa: E501 + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + gateway_ping: Optional[RealUserTestNetworkGatewayPing] = Field(default=None, alias="gatewayPing") + ping: Optional[RealUserTestNetworkPing] = None + traceroute: Optional[RealUserTestNetworkTraceroute] = None + connect_rtt: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Represents the number of milliseconds required to establish TCP connectivity with the target.", alias="connectRtt") + is_icmp_blocked: Optional[StrictBool] = Field(default=None, description="Set to `true` if network target is blocking ICMP echo (ping) queries.", alias="isIcmpBlocked") + errors: Optional[List[StrictStr]] = Field(default=None, description="Array of string representing possible network errors.") + vpn_ping: Optional[RealUserTestNetworkVpnPing] = Field(default=None, alias="vpnPing") + vpn_traceroute: Optional[RealUserTestNetworkVpnTraceroute] = Field(default=None, alias="vpnTraceroute") + __properties: ClassVar[List[str]] = ["networkProfile", "systemMetrics", "gatewayPing", "ping", "traceroute", "connectRtt", "isIcmpBlocked", "errors", "vpnPing", "vpnTraceroute"] + + 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 RealUserTestNetwork 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={ + "connect_rtt", + "is_icmp_blocked", + "errors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of gateway_ping + if self.gateway_ping: + _dict['gatewayPing'] = self.gateway_ping.to_dict() + # override the default output from pydantic by calling `to_dict()` of ping + if self.ping: + _dict['ping'] = self.ping.to_dict() + # override the default output from pydantic by calling `to_dict()` of traceroute + if self.traceroute: + _dict['traceroute'] = self.traceroute.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_ping + if self.vpn_ping: + _dict['vpnPing'] = self.vpn_ping.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_traceroute + if self.vpn_traceroute: + _dict['vpnTraceroute'] = self.vpn_traceroute.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RealUserTestNetwork from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "networkProfile": NetworkProfile.from_dict(obj.get("networkProfile")) if obj.get("networkProfile") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None, + "gatewayPing": RealUserTestNetworkGatewayPing.from_dict(obj.get("gatewayPing")) if obj.get("gatewayPing") is not None else None, + "ping": RealUserTestNetworkPing.from_dict(obj.get("ping")) if obj.get("ping") is not None else None, + "traceroute": RealUserTestNetworkTraceroute.from_dict(obj.get("traceroute")) if obj.get("traceroute") is not None else None, + "connectRtt": obj.get("connectRtt"), + "isIcmpBlocked": obj.get("isIcmpBlocked"), + "errors": obj.get("errors"), + "vpnPing": RealUserTestNetworkVpnPing.from_dict(obj.get("vpnPing")) if obj.get("vpnPing") is not None else None, + "vpnTraceroute": RealUserTestNetworkVpnTraceroute.from_dict(obj.get("vpnTraceroute")) if obj.get("vpnTraceroute") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/real_user_test_network_gateway_ping.py b/endpoint/test_results_api/test_results_api/models/real_user_test_network_gateway_ping.py new file mode 100644 index 00000000..14bcca9e --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/real_user_test_network_gateway_ping.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 RealUserTestNetworkGatewayPing(BaseModel): + """ + RealUserTestNetworkGatewayPing + """ # noqa: E501 + avg_rtt: Optional[StrictInt] = Field(default=None, description="Ping average response time.", alias="avgRtt") + max_rtt: Optional[StrictInt] = Field(default=None, description="Ping maximum response time.", alias="maxRtt") + mean_dev_rtt: Optional[StrictInt] = Field(default=None, description="Ping mean standard deviation response time.", alias="meanDevRtt") + min_rtt: Optional[StrictInt] = Field(default=None, description="Ping minimum response time.", alias="minRtt") + pkts_received: Optional[StrictInt] = Field(default=None, description="Ping packets received.", alias="pktsReceived") + pkts_sent: Optional[StrictInt] = Field(default=None, description="Ping packets sent.", alias="pktsSent") + error: Optional[StrictStr] = Field(default=None, description="Only present when there is an error.") + info_flags: Optional[List[StrictStr]] = Field(default=None, alias="infoFlags") + __properties: ClassVar[List[str]] = ["avgRtt", "maxRtt", "meanDevRtt", "minRtt", "pktsReceived", "pktsSent", "error", "infoFlags"] + + 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 RealUserTestNetworkGatewayPing 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={ + "avg_rtt", + "max_rtt", + "mean_dev_rtt", + "min_rtt", + "pkts_received", + "pkts_sent", + "error", + "info_flags", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RealUserTestNetworkGatewayPing from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "avgRtt": obj.get("avgRtt"), + "maxRtt": obj.get("maxRtt"), + "meanDevRtt": obj.get("meanDevRtt"), + "minRtt": obj.get("minRtt"), + "pktsReceived": obj.get("pktsReceived"), + "pktsSent": obj.get("pktsSent"), + "error": obj.get("error"), + "infoFlags": obj.get("infoFlags") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/real_user_test_network_ping.py b/endpoint/test_results_api/test_results_api/models/real_user_test_network_ping.py new file mode 100644 index 00000000..b070c31d --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/real_user_test_network_ping.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 RealUserTestNetworkPing(BaseModel): + """ + RealUserTestNetworkPing + """ # noqa: E501 + avg_rtt: Optional[StrictInt] = Field(default=None, description="Ping average response time.", alias="avgRtt") + max_rtt: Optional[StrictInt] = Field(default=None, description="Ping maximum response time.", alias="maxRtt") + mean_dev_rtt: Optional[StrictInt] = Field(default=None, description="Ping mean standard deviation response time.", alias="meanDevRtt") + min_rtt: Optional[StrictInt] = Field(default=None, description="Ping minimum response time.", alias="minRtt") + pkts_received: Optional[StrictInt] = Field(default=None, description="Ping packets received.", alias="pktsReceived") + pkts_sent: Optional[StrictInt] = Field(default=None, description="Ping packets sent.", alias="pktsSent") + error: Optional[StrictStr] = Field(default=None, description="Only present when there is an error.") + info_flags: Optional[List[StrictStr]] = Field(default=None, alias="infoFlags") + __properties: ClassVar[List[str]] = ["avgRtt", "maxRtt", "meanDevRtt", "minRtt", "pktsReceived", "pktsSent", "error", "infoFlags"] + + 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 RealUserTestNetworkPing 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={ + "avg_rtt", + "max_rtt", + "mean_dev_rtt", + "min_rtt", + "pkts_received", + "pkts_sent", + "error", + "info_flags", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RealUserTestNetworkPing from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "avgRtt": obj.get("avgRtt"), + "maxRtt": obj.get("maxRtt"), + "meanDevRtt": obj.get("meanDevRtt"), + "minRtt": obj.get("minRtt"), + "pktsReceived": obj.get("pktsReceived"), + "pktsSent": obj.get("pktsSent"), + "error": obj.get("error"), + "infoFlags": obj.get("infoFlags") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/real_user_test_network_result.py b/endpoint/test_results_api/test_results_api/models/real_user_test_network_result.py new file mode 100644 index 00000000..181707de --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/real_user_test_network_result.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.network_metrics import NetworkMetrics +from test_results_api.models.system_metrics import SystemMetrics +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RealUserTestNetworkResult(BaseModel): + """ + RealUserTestNetworkResult + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + var_date: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test took place (ISO date-time format).", alias="date") + id: Optional[StrictStr] = Field(default=None, description="Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID.") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + destination: Optional[NetworkMetrics] = None + vpn: Optional[NetworkMetrics] = None + proxy: Optional[NetworkMetrics] = None + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + __properties: ClassVar[List[str]] = ["agentId", "date", "id", "roundId", "destination", "vpn", "proxy", "systemMetrics"] + + 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 RealUserTestNetworkResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "agent_id", + "var_date", + "id", + "round_id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of destination + if self.destination: + _dict['destination'] = self.destination.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn + if self.vpn: + _dict['vpn'] = self.vpn.to_dict() + # override the default output from pydantic by calling `to_dict()` of proxy + if self.proxy: + _dict['proxy'] = self.proxy.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RealUserTestNetworkResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "date": obj.get("date"), + "id": obj.get("id"), + "roundId": obj.get("roundId"), + "destination": NetworkMetrics.from_dict(obj.get("destination")) if obj.get("destination") is not None else None, + "vpn": NetworkMetrics.from_dict(obj.get("vpn")) if obj.get("vpn") is not None else None, + "proxy": NetworkMetrics.from_dict(obj.get("proxy")) if obj.get("proxy") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/real_user_test_network_results.py b/endpoint/test_results_api/test_results_api/models/real_user_test_network_results.py new file mode 100644 index 00000000..7a096643 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/real_user_test_network_results.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.real_user_test_network_result import RealUserTestNetworkResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RealUserTestNetworkResults(BaseModel): + """ + RealUserTestNetworkResults + """ # noqa: E501 + results: Optional[List[RealUserTestNetworkResult]] = None + __properties: ClassVar[List[str]] = ["results"] + + 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 RealUserTestNetworkResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RealUserTestNetworkResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [RealUserTestNetworkResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/real_user_test_network_traceroute.py b/endpoint/test_results_api/test_results_api/models/real_user_test_network_traceroute.py new file mode 100644 index 00000000..e9174edd --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/real_user_test_network_traceroute.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.traceroute_hop import TracerouteHop +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RealUserTestNetworkTraceroute(BaseModel): + """ + RealUserTestNetworkTraceroute + """ # noqa: E501 + destination: Optional[StrictStr] = Field(default=None, description="The target IP address.") + error: Optional[StrictStr] = Field(default=None, description="Only present when there is an error") + info_flags: Optional[List[StrictStr]] = Field(default=None, alias="infoFlags") + internal_errors: Optional[List[StrictStr]] = Field(default=None, alias="internalErrors") + hops: Optional[List[TracerouteHop]] = None + __properties: ClassVar[List[str]] = ["destination", "error", "infoFlags", "internalErrors", "hops"] + + 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 RealUserTestNetworkTraceroute 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "destination", + "error", + "info_flags", + "internal_errors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in hops (list) + _items = [] + if self.hops: + for _item in self.hops: + if _item: + _items.append(_item.to_dict()) + _dict['hops'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RealUserTestNetworkTraceroute from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "destination": obj.get("destination"), + "error": obj.get("error"), + "infoFlags": obj.get("infoFlags"), + "internalErrors": obj.get("internalErrors"), + "hops": [TracerouteHop.from_dict(_item) for _item in obj.get("hops")] if obj.get("hops") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/real_user_test_network_vpn_ping.py b/endpoint/test_results_api/test_results_api/models/real_user_test_network_vpn_ping.py new file mode 100644 index 00000000..fd9e77c9 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/real_user_test_network_vpn_ping.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 RealUserTestNetworkVpnPing(BaseModel): + """ + RealUserTestNetworkVpnPing + """ # noqa: E501 + avg_rtt: Optional[StrictInt] = Field(default=None, description="Ping average response time.", alias="avgRtt") + max_rtt: Optional[StrictInt] = Field(default=None, description="Ping maximum response time.", alias="maxRtt") + mean_dev_rtt: Optional[StrictInt] = Field(default=None, description="Ping mean standard deviation response time.", alias="meanDevRtt") + min_rtt: Optional[StrictInt] = Field(default=None, description="Ping minimum response time.", alias="minRtt") + pkts_received: Optional[StrictInt] = Field(default=None, description="Ping packets received.", alias="pktsReceived") + pkts_sent: Optional[StrictInt] = Field(default=None, description="Ping packets sent.", alias="pktsSent") + error: Optional[StrictStr] = Field(default=None, description="Only present when there is an error.") + info_flags: Optional[List[StrictStr]] = Field(default=None, alias="infoFlags") + __properties: ClassVar[List[str]] = ["avgRtt", "maxRtt", "meanDevRtt", "minRtt", "pktsReceived", "pktsSent", "error", "infoFlags"] + + 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 RealUserTestNetworkVpnPing 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={ + "avg_rtt", + "max_rtt", + "mean_dev_rtt", + "min_rtt", + "pkts_received", + "pkts_sent", + "error", + "info_flags", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RealUserTestNetworkVpnPing from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "avgRtt": obj.get("avgRtt"), + "maxRtt": obj.get("maxRtt"), + "meanDevRtt": obj.get("meanDevRtt"), + "minRtt": obj.get("minRtt"), + "pktsReceived": obj.get("pktsReceived"), + "pktsSent": obj.get("pktsSent"), + "error": obj.get("error"), + "infoFlags": obj.get("infoFlags") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/real_user_test_network_vpn_traceroute.py b/endpoint/test_results_api/test_results_api/models/real_user_test_network_vpn_traceroute.py new file mode 100644 index 00000000..1174a249 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/real_user_test_network_vpn_traceroute.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.traceroute_hop import TracerouteHop +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RealUserTestNetworkVpnTraceroute(BaseModel): + """ + RealUserTestNetworkVpnTraceroute + """ # noqa: E501 + destination: Optional[StrictStr] = Field(default=None, description="The target IP address.") + error: Optional[StrictStr] = Field(default=None, description="Only present when there is an error") + info_flags: Optional[List[StrictStr]] = Field(default=None, alias="infoFlags") + internal_errors: Optional[List[StrictStr]] = Field(default=None, alias="internalErrors") + hops: Optional[List[TracerouteHop]] = None + __properties: ClassVar[List[str]] = ["destination", "error", "infoFlags", "internalErrors", "hops"] + + 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 RealUserTestNetworkVpnTraceroute 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "destination", + "error", + "info_flags", + "internal_errors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in hops (list) + _items = [] + if self.hops: + for _item in self.hops: + if _item: + _items.append(_item.to_dict()) + _dict['hops'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RealUserTestNetworkVpnTraceroute from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "destination": obj.get("destination"), + "error": obj.get("error"), + "infoFlags": obj.get("infoFlags"), + "internalErrors": obj.get("internalErrors"), + "hops": [TracerouteHop.from_dict(_item) for _item in obj.get("hops")] if obj.get("hops") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/real_user_test_page.py b/endpoint/test_results_api/test_results_api/models/real_user_test_page.py new file mode 100644 index 00000000..603c2435 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/real_user_test_page.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.real_user_test_page_page_timings import RealUserTestPagePageTimings +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RealUserTestPage(BaseModel): + """ + RealUserTestPage + """ # noqa: E501 + page_id: Optional[StrictStr] = Field(default=None, description="Web page ID. The page ID is unique only within an endpoint real user test.", alias="pageId") + page_title: Optional[StrictStr] = Field(default=None, description="Web page title.", alias="pageTitle") + page_url: Optional[StrictStr] = Field(default=None, description="Web page url", alias="pageUrl") + load_date: Optional[datetime] = Field(default=None, description="UTC date when page load started (ISO date-time format).", alias="loadDate") + response_code: Optional[StrictInt] = Field(default=None, description="HTTP response code.", alias="responseCode") + page_timings: Optional[RealUserTestPagePageTimings] = Field(default=None, alias="pageTimings") + __properties: ClassVar[List[str]] = ["pageId", "pageTitle", "pageUrl", "loadDate", "responseCode", "pageTimings"] + + 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 RealUserTestPage 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "page_id", + "page_title", + "page_url", + "load_date", + "response_code", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of page_timings + if self.page_timings: + _dict['pageTimings'] = self.page_timings.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RealUserTestPage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pageId": obj.get("pageId"), + "pageTitle": obj.get("pageTitle"), + "pageUrl": obj.get("pageUrl"), + "loadDate": obj.get("loadDate"), + "responseCode": obj.get("responseCode"), + "pageTimings": RealUserTestPagePageTimings.from_dict(obj.get("pageTimings")) if obj.get("pageTimings") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/real_user_test_page_page_timings.py b/endpoint/test_results_api/test_results_api/models/real_user_test_page_page_timings.py new file mode 100644 index 00000000..8da842eb --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/real_user_test_page_page_timings.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RealUserTestPagePageTimings(BaseModel): + """ + RealUserTestPagePageTimings + """ # noqa: E501 + on_content_load: Optional[StrictInt] = Field(default=None, description="DOM load time in milliseconds.", alias="onContentLoad") + on_load: Optional[StrictInt] = Field(default=None, description="Page load time in milliseconds.", alias="onLoad") + __properties: ClassVar[List[str]] = ["onContentLoad", "onLoad"] + + 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 RealUserTestPagePageTimings 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={ + "on_content_load", + "on_load", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RealUserTestPagePageTimings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "onContentLoad": obj.get("onContentLoad"), + "onLoad": obj.get("onLoad") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/real_user_test_page_result.py b/endpoint/test_results_api/test_results_api/models/real_user_test_page_result.py new file mode 100644 index 00000000..d8d8ae38 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/real_user_test_page_result.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.real_user_test_page_page_timings import RealUserTestPagePageTimings +from test_results_api.models.system_metrics import SystemMetrics +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RealUserTestPageResult(BaseModel): + """ + RealUserTestPageResult + """ # noqa: E501 + page_id: Optional[StrictStr] = Field(default=None, description="Web page ID. The page ID is unique only within an endpoint real user test.", alias="pageId") + page_title: Optional[StrictStr] = Field(default=None, description="Web page title.", alias="pageTitle") + page_url: Optional[StrictStr] = Field(default=None, description="Web page url", alias="pageUrl") + load_date: Optional[datetime] = Field(default=None, description="UTC date when page load started (ISO date-time format).", alias="loadDate") + response_code: Optional[StrictInt] = Field(default=None, description="HTTP response code.", alias="responseCode") + page_timings: Optional[RealUserTestPagePageTimings] = Field(default=None, alias="pageTimings") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + id: Optional[StrictStr] = Field(default=None, description="Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID.") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + response_time: Optional[StrictInt] = Field(default=None, description="HTTP server response in milliseconds.", alias="responseTime") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + __properties: ClassVar[List[str]] = ["pageId", "pageTitle", "pageUrl", "loadDate", "responseCode", "pageTimings", "agentId", "id", "roundId", "responseTime", "systemMetrics"] + + 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 RealUserTestPageResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "page_id", + "page_title", + "page_url", + "load_date", + "response_code", + "agent_id", + "id", + "round_id", + "response_time", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of page_timings + if self.page_timings: + _dict['pageTimings'] = self.page_timings.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RealUserTestPageResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pageId": obj.get("pageId"), + "pageTitle": obj.get("pageTitle"), + "pageUrl": obj.get("pageUrl"), + "loadDate": obj.get("loadDate"), + "responseCode": obj.get("responseCode"), + "pageTimings": RealUserTestPagePageTimings.from_dict(obj.get("pageTimings")) if obj.get("pageTimings") is not None else None, + "agentId": obj.get("agentId"), + "id": obj.get("id"), + "roundId": obj.get("roundId"), + "responseTime": obj.get("responseTime"), + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/real_user_test_page_results.py b/endpoint/test_results_api/test_results_api/models/real_user_test_page_results.py new file mode 100644 index 00000000..a0be53d4 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/real_user_test_page_results.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.real_user_test_page_result import RealUserTestPageResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RealUserTestPageResults(BaseModel): + """ + RealUserTestPageResults + """ # noqa: E501 + results: Optional[List[RealUserTestPageResult]] = None + __properties: ClassVar[List[str]] = ["results"] + + 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 RealUserTestPageResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RealUserTestPageResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [RealUserTestPageResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/self_links.py b/endpoint/test_results_api/test_results_api/models/self_links.py new file mode 100644 index 00000000..8e008dde --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_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 + + diff --git a/endpoint/test_results_api/test_results_api/models/self_links_links.py b/endpoint/test_results_api/test_results_api/models/self_links_links.py new file mode 100644 index 00000000..aadf61d2 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_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 + + diff --git a/endpoint/test_results_api/test_results_api/models/sort_order.py b/endpoint/test_results_api/test_results_api/models/sort_order.py new file mode 100644 index 00000000..7118d383 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/sort_order.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 SortOrder(str, Enum): + """ + Parameter indicates the ascending/descending order of the sorting, using either the asc or desc values. + """ + + """ + allowed enum values + """ + ASC = 'asc' + DESC = 'desc' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SortOrder from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/specific_agents_selector_type.py b/endpoint/test_results_api/test_results_api/models/specific_agents_selector_type.py new file mode 100644 index 00000000..b6b98b86 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/specific_agents_selector_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 SpecificAgentsSelectorType(str, Enum): + """ + SpecificAgentsSelectorType + """ + + """ + allowed enum values + """ + SPECIFIC_MINUS_AGENTS = 'specific-agents' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SpecificAgentsSelectorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/system_metrics.py b/endpoint/test_results_api/test_results_api/models/system_metrics.py new file mode 100644 index 00000000..aed64107 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/system_metrics.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +from test_results_api.models.cpu_utilization import CpuUtilization +from test_results_api.models.physical_memory_used_bytes import PhysicalMemoryUsedBytes +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SystemMetrics(BaseModel): + """ + SystemMetrics + """ # noqa: E501 + start_time_ms: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The start time of metrics collection, expressed in milliseconds since the Epoch.", alias="startTimeMs") + end_time_ms: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The end time of metrics collection, expressed in milliseconds since the Epoch.", alias="endTimeMs") + cpu_utilization: Optional[CpuUtilization] = Field(default=None, alias="cpuUtilization") + physical_memory_used_bytes: Optional[PhysicalMemoryUsedBytes] = Field(default=None, alias="physicalMemoryUsedBytes") + physical_memory_total_bytes: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total physical memory of the system.", alias="physicalMemoryTotalBytes") + __properties: ClassVar[List[str]] = ["startTimeMs", "endTimeMs", "cpuUtilization", "physicalMemoryUsedBytes", "physicalMemoryTotalBytes"] + + 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 SystemMetrics 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={ + "start_time_ms", + "end_time_ms", + "physical_memory_total_bytes", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of cpu_utilization + if self.cpu_utilization: + _dict['cpuUtilization'] = self.cpu_utilization.to_dict() + # override the default output from pydantic by calling `to_dict()` of physical_memory_used_bytes + if self.physical_memory_used_bytes: + _dict['physicalMemoryUsedBytes'] = self.physical_memory_used_bytes.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SystemMetrics from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startTimeMs": obj.get("startTimeMs"), + "endTimeMs": obj.get("endTimeMs"), + "cpuUtilization": CpuUtilization.from_dict(obj.get("cpuUtilization")) if obj.get("cpuUtilization") is not None else None, + "physicalMemoryUsedBytes": PhysicalMemoryUsedBytes.from_dict(obj.get("physicalMemoryUsedBytes")) if obj.get("physicalMemoryUsedBytes") is not None else None, + "physicalMemoryTotalBytes": obj.get("physicalMemoryTotalBytes") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/tcp_connect.py b/endpoint/test_results_api/test_results_api/models/tcp_connect.py new file mode 100644 index 00000000..3e45b34b --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/tcp_connect.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TcpConnect(BaseModel): + """ + TcpConnect + """ # noqa: E501 + rtt: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Represents the number of milliseconds required to establish TCP connectivity with the target") + error_code: Optional[StrictStr] = Field(default=None, description="Only present when there is an error", alias="errorCode") + error: Optional[StrictStr] = Field(default=None, description="Only present when there is an error") + info_flags: Optional[List[StrictStr]] = Field(default=None, alias="infoFlags") + __properties: ClassVar[List[str]] = ["rtt", "errorCode", "error", "infoFlags"] + + 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 TcpConnect 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "rtt", + "error_code", + "error", + "info_flags", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of TcpConnect from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "rtt": obj.get("rtt"), + "errorCode": obj.get("errorCode"), + "error": obj.get("error"), + "infoFlags": obj.get("infoFlags") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/test_interval.py b/endpoint/test_results_api/test_results_api/models/test_interval.py new file mode 100644 index 00000000..983a91bf --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/test_interval.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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)) + + diff --git a/endpoint/test_results_api/test_results_api/models/test_probe_mode.py b/endpoint/test_results_api/test_results_api/models/test_probe_mode.py new file mode 100644 index 00000000..900d3046 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/test_probe_mode.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 TestProbeMode(str, Enum): + """ + Probe mode used by network test, only valid when the protocol is set to TCP. + """ + + """ + allowed enum values + """ + AUTO = 'auto' + SACK = 'sack' + SYN = 'syn' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestProbeMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/test_result.py b/endpoint/test_results_api/test_results_api/models/test_result.py new file mode 100644 index 00000000..5da866e6 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/test_result.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 +from test_results_api.models.account_group_id import AccountGroupId +from test_results_api.models.system_metrics import SystemMetrics +from test_results_api.models.vpn_profile import VpnProfile +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestResult(BaseModel): + """ + TestResult + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + aid: Optional[AccountGroupId] = None + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + __properties: ClassVar[List[str]] = ["agentId", "aid", "roundId", "serverIp", "systemMetrics", "vpnProfile"] + + 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 TestResult 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={ + "agent_id", + "round_id", + "server_ip", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of TestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "aid": AccountGroupId.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "systemMetrics": SystemMetrics.from_dict(obj.get("systemMetrics")) if obj.get("systemMetrics") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj.get("vpnProfile")) if obj.get("vpnProfile") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/test_ssl_version_id.py b/endpoint/test_results_api/test_results_api/models/test_ssl_version_id.py new file mode 100644 index 00000000..05e41046 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/test_ssl_version_id.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 TestSslVersionId(str, Enum): + """ + SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. + """ + + """ + allowed enum values + """ + ENUM_0 = '0' + ENUM_3 = '3' + ENUM_4 = '4' + ENUM_5 = '5' + ENUM_6 = '6' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestSslVersionId from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/tests_data_rounds_search.py b/endpoint/test_results_api/test_results_api/models/tests_data_rounds_search.py new file mode 100644 index 00000000..41b6418f --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/tests_data_rounds_search.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.tests_data_search_filter import TestsDataSearchFilter +from test_results_api.models.tests_data_search_sort import TestsDataSearchSort +from test_results_api.models.tests_data_threshold_filters import TestsDataThresholdFilters +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestsDataRoundsSearch(BaseModel): + """ + TestsDataRoundsSearch + """ # noqa: E501 + search_sort: Optional[List[TestsDataSearchSort]] = Field(default=None, alias="searchSort") + threshold_filter: Optional[TestsDataThresholdFilters] = Field(default=None, alias="thresholdFilter") + search_filters: Optional[TestsDataSearchFilter] = Field(default=None, alias="searchFilters") + __properties: ClassVar[List[str]] = ["searchSort", "thresholdFilter", "searchFilters"] + + 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 TestsDataRoundsSearch 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 search_sort (list) + _items = [] + if self.search_sort: + for _item in self.search_sort: + if _item: + _items.append(_item.to_dict()) + _dict['searchSort'] = _items + # override the default output from pydantic by calling `to_dict()` of threshold_filter + if self.threshold_filter: + _dict['thresholdFilter'] = self.threshold_filter.to_dict() + # override the default output from pydantic by calling `to_dict()` of search_filters + if self.search_filters: + _dict['searchFilters'] = self.search_filters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of TestsDataRoundsSearch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "searchSort": [TestsDataSearchSort.from_dict(_item) for _item in obj.get("searchSort")] if obj.get("searchSort") is not None else None, + "thresholdFilter": TestsDataThresholdFilters.from_dict(obj.get("thresholdFilter")) if obj.get("thresholdFilter") is not None else None, + "searchFilters": TestsDataSearchFilter.from_dict(obj.get("searchFilters")) if obj.get("searchFilters") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/tests_data_search_filter.py b/endpoint/test_results_api/test_results_api/models/tests_data_search_filter.py new file mode 100644 index 00000000..c472e75d --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/tests_data_search_filter.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 TestsDataSearchFilter(BaseModel): + """ + TestsDataSearchFilter + """ # noqa: E501 + agent_id: Optional[List[StrictStr]] = Field(default=None, description="Filter using the `agent-id`.", alias="agentId") + __properties: ClassVar[List[str]] = ["agentId"] + + 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 TestsDataSearchFilter 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 TestsDataSearchFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/tests_data_search_sort.py b/endpoint/test_results_api/test_results_api/models/tests_data_search_sort.py new file mode 100644 index 00000000..e87be271 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/tests_data_search_sort.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.sort_order import SortOrder +from test_results_api.models.tests_data_search_sort_key import TestsDataSearchSortKey +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestsDataSearchSort(BaseModel): + """ + TestsDataSearchSort + """ # noqa: E501 + sort: Optional[TestsDataSearchSortKey] = None + order: Optional[SortOrder] = None + __properties: ClassVar[List[str]] = ["sort", "order"] + + 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 TestsDataSearchSort 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 TestsDataSearchSort from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "sort": obj.get("sort"), + "order": obj.get("order") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/tests_data_search_sort_key.py b/endpoint/test_results_api/test_results_api/models/tests_data_search_sort_key.py new file mode 100644 index 00000000..c38bbfde --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/tests_data_search_sort_key.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 TestsDataSearchSortKey(str, Enum): + """ + TestsDataSearchSortKey + """ + + """ + allowed enum values + """ + ROUND_MINUS_ID = 'round-id' + LOSS = 'loss' + LATENCY = 'latency' + JITTER = 'jitter' + CPU = 'cpu' + MEMORY = 'memory' + SIGNAL_MINUS_QUALITY = 'signal-quality' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestsDataSearchSortKey from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/tests_data_threshold_filter.py b/endpoint/test_results_api/test_results_api/models/tests_data_threshold_filter.py new file mode 100644 index 00000000..bfda69b5 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/tests_data_threshold_filter.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +from test_results_api.models.threshold_filter_name import ThresholdFilterName +from test_results_api.models.threshold_filter_operator import ThresholdFilterOperator +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestsDataThresholdFilter(BaseModel): + """ + The metric is filtered based on the threshold value and operator provided. + """ # noqa: E501 + name: Optional[ThresholdFilterName] = None + value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The threshold value.") + operator: Optional[ThresholdFilterOperator] = None + __properties: ClassVar[List[str]] = ["name", "value", "operator"] + + 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 TestsDataThresholdFilter 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 TestsDataThresholdFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value"), + "operator": obj.get("operator") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/tests_data_threshold_filters.py b/endpoint/test_results_api/test_results_api/models/tests_data_threshold_filters.py new file mode 100644 index 00000000..6f1600ec --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/tests_data_threshold_filters.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.conditional_operator import ConditionalOperator +from test_results_api.models.tests_data_threshold_filter import TestsDataThresholdFilter +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestsDataThresholdFilters(BaseModel): + """ + All filters are applied based on the conditional operator (and/or). + """ # noqa: E501 + filters: Optional[List[TestsDataThresholdFilter]] = None + conditional_operator: Optional[ConditionalOperator] = Field(default=None, alias="conditionalOperator") + __properties: ClassVar[List[str]] = ["filters", "conditionalOperator"] + + 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 TestsDataThresholdFilters 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 filters (list) + _items = [] + if self.filters: + for _item in self.filters: + if _item: + _items.append(_item.to_dict()) + _dict['filters'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of TestsDataThresholdFilters from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "filters": [TestsDataThresholdFilter.from_dict(_item) for _item in obj.get("filters")] if obj.get("filters") is not None else None, + "conditionalOperator": obj.get("conditionalOperator") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/threshold_filter_name.py b/endpoint/test_results_api/test_results_api/models/threshold_filter_name.py new file mode 100644 index 00000000..53e71780 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/threshold_filter_name.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 ThresholdFilterName(str, Enum): + """ + Metric on which the threshold filter is applied. + """ + + """ + allowed enum values + """ + LOSS = 'loss' + LATENCY = 'latency' + JITTER = 'jitter' + CPU = 'cpu' + MEMORY = 'memory' + SIGNAL_MINUS_QUALITY = 'signal-quality' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ThresholdFilterName from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/threshold_filter_operator.py b/endpoint/test_results_api/test_results_api/models/threshold_filter_operator.py new file mode 100644 index 00000000..9824ea0a --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/threshold_filter_operator.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 ThresholdFilterOperator(str, Enum): + """ + ThresholdFilterOperator + """ + + """ + allowed enum values + """ + GTE = 'gte' + LTE = 'lte' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ThresholdFilterOperator from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/traceroute.py b/endpoint/test_results_api/test_results_api/models/traceroute.py new file mode 100644 index 00000000..4db0699c --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/traceroute.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.traceroute_hop import TracerouteHop +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Traceroute(BaseModel): + """ + Traceroute + """ # noqa: E501 + destination: Optional[StrictStr] = Field(default=None, description="The target IP address.") + error: Optional[StrictStr] = Field(default=None, description="Only present when there is an error") + info_flags: Optional[List[StrictStr]] = Field(default=None, alias="infoFlags") + internal_errors: Optional[List[StrictStr]] = Field(default=None, alias="internalErrors") + hops: Optional[List[TracerouteHop]] = None + __properties: ClassVar[List[str]] = ["destination", "error", "infoFlags", "internalErrors", "hops"] + + 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 Traceroute 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "destination", + "error", + "info_flags", + "internal_errors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in hops (list) + _items = [] + if self.hops: + for _item in self.hops: + if _item: + _items.append(_item.to_dict()) + _dict['hops'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Traceroute from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "destination": obj.get("destination"), + "error": obj.get("error"), + "infoFlags": obj.get("infoFlags"), + "internalErrors": obj.get("internalErrors"), + "hops": [TracerouteHop.from_dict(_item) for _item in obj.get("hops")] if obj.get("hops") is not None else None + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/traceroute_hop.py b/endpoint/test_results_api/test_results_api/models/traceroute_hop.py new file mode 100644 index 00000000..a0fd7f48 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/traceroute_hop.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 TracerouteHop(BaseModel): + """ + TracerouteHop + """ # noqa: E501 + hop: Optional[StrictInt] = Field(default=None, description="The hop index.") + ip_address: Optional[StrictStr] = Field(default=None, description="IP address of the hop.", alias="ipAddress") + prefix: Optional[StrictStr] = Field(default=None, description="Prefix of IP address shown in CIDR.") + asn: Optional[StrictInt] = Field(default=None, description="Unique number assigned to an organization (also referred to as service provider).") + delay: Optional[StrictInt] = Field(default=None, description="Hop delay") + mpls: Optional[List[StrictStr]] = Field(default=None, description="Hop Multiprotocol Label Switching.") + name: Optional[StrictStr] = Field(default=None, description="The hop name.") + __properties: ClassVar[List[str]] = ["hop", "ipAddress", "prefix", "asn", "delay", "mpls", "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 TracerouteHop 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={ + "hop", + "ip_address", + "prefix", + "asn", + "delay", + "mpls", + "name", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of TracerouteHop from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "hop": obj.get("hop"), + "ipAddress": obj.get("ipAddress"), + "prefix": obj.get("prefix"), + "asn": obj.get("asn"), + "delay": obj.get("delay"), + "mpls": obj.get("mpls"), + "name": obj.get("name") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/trigger.py b/endpoint/test_results_api/test_results_api/models/trigger.py new file mode 100644 index 00000000..c7d5a6c5 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/trigger.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 Trigger(str, Enum): + """ + Trigger + """ + + """ + allowed enum values + """ + AUTO = 'auto' + USER = 'user' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Trigger from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/models/unauthorized_error.py b/endpoint/test_results_api/test_results_api/models/unauthorized_error.py new file mode 100644 index 00000000..fdb7dd1f --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 + + diff --git a/endpoint/test_results_api/test_results_api/models/vpn_profile.py b/endpoint/test_results_api/test_results_api/models/vpn_profile.py new file mode 100644 index 00000000..c8819d91 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/vpn_profile.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_api.models.vpn_type import VpnType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class VpnProfile(BaseModel): + """ + VpnProfile + """ # noqa: E501 + vpn_client_addresses: Optional[List[StrictStr]] = Field(default=None, description="A list of private IP addresses assigned to the device by the VPN server.", alias="vpnClientAddresses") + vpn_client_network_range: Optional[List[StrictStr]] = Field(default=None, description="A list of private networks assigned to the device by the VPN server.", alias="vpnClientNetworkRange") + vpn_gateway_address: Optional[StrictStr] = Field(default=None, description="IP address of the VPN gateway.", alias="vpnGatewayAddress") + vpn_type: Optional[VpnType] = Field(default=None, alias="vpnType") + __properties: ClassVar[List[str]] = ["vpnClientAddresses", "vpnClientNetworkRange", "vpnGatewayAddress", "vpnType"] + + 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 VpnProfile 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={ + "vpn_client_addresses", + "vpn_client_network_range", + "vpn_gateway_address", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of VpnProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "vpnClientAddresses": obj.get("vpnClientAddresses"), + "vpnClientNetworkRange": obj.get("vpnClientNetworkRange"), + "vpnGatewayAddress": obj.get("vpnGatewayAddress"), + "vpnType": obj.get("vpnType") + }) + return _obj + + diff --git a/endpoint/test_results_api/test_results_api/models/vpn_type.py b/endpoint/test_results_api/test_results_api/models/vpn_type.py new file mode 100644 index 00000000..fbfb3034 --- /dev/null +++ b/endpoint/test_results_api/test_results_api/models/vpn_type.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 VpnType(str, Enum): + """ + Name of the VPN provider. + """ + + """ + allowed enum values + """ + CISCO_MINUS_ANYCONNECT = 'cisco-anyconnect' + PALO_MINUS_ALTO_MINUS_GLOBALPROTECT = 'palo-alto-globalprotect' + IVANTI_MINUS_CONNECT_MINUS_SECURE = 'ivanti-connect-secure' + ZSCALER_MINUS_INTERNET_MINUS_ACCESS = 'zscaler-internet-access' + F5_MINUS_BIG_MINUS_IP = 'f5-big-ip' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of VpnType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/test_results_api/test_results_api/py.typed b/endpoint/test_results_api/test_results_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/endpoint/test_results_api/test_results_api/rest.py b/endpoint/test_results_api/test_results_api/rest.py new file mode 100644 index 00000000..bf7a153d --- /dev/null +++ b/endpoint/test_results_api/test_results_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint 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 test_results_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) diff --git a/endpoint/test_results_api/tox.ini b/endpoint/test_results_api/tox.ini new file mode 100644 index 00000000..a8148126 --- /dev/null +++ b/endpoint/test_results_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=test_results_api diff --git a/endpoint/tests_api/.github/workflows/python.yml b/endpoint/tests_api/.github/workflows/python.yml new file mode 100644 index 00000000..939fd9f1 --- /dev/null +++ b/endpoint/tests_api/.github/workflows/python.yml @@ -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: tests_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 diff --git a/endpoint/tests_api/.gitignore b/endpoint/tests_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/endpoint/tests_api/.gitignore @@ -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 diff --git a/endpoint/tests_api/.gitlab-ci.yml b/endpoint/tests_api/.gitlab-ci.yml new file mode 100644 index 00000000..7e659eac --- /dev/null +++ b/endpoint/tests_api/.gitlab-ci.yml @@ -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=tests_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 diff --git a/endpoint/tests_api/.openapi-generator-ignore b/endpoint/tests_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/endpoint/tests_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/endpoint/tests_api/.openapi-generator/FILES b/endpoint/tests_api/.openapi-generator/FILES new file mode 100644 index 00000000..66a177e0 --- /dev/null +++ b/endpoint/tests_api/.openapi-generator/FILES @@ -0,0 +1,191 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/AccountGroupId.md +docs/AgentLabelsSelectorType.md +docs/AllAgentsSelectorType.md +docs/DynamicTest.md +docs/DynamicTestApplication.md +docs/DynamicTestLinks.md +docs/DynamicTestLinksSelf.md +docs/DynamicTestLinksTestResults.md +docs/DynamicTestRequest.md +docs/DynamicTests.md +docs/DynamicTestsAgentToServerApi.md +docs/EndpointAgentLabelsSelectorConfig.md +docs/EndpointAgentSelectorConfig.md +docs/EndpointAgentToServerInstantTest.md +docs/EndpointAgentToServerTest.md +docs/EndpointAgentToServerTestRequest.md +docs/EndpointAgentToServerTests.md +docs/EndpointAgentToServerType.md +docs/EndpointAllAgentsSelectorConfig.md +docs/EndpointHttpServerBaseTest.md +docs/EndpointHttpServerInstantTest.md +docs/EndpointHttpServerTest.md +docs/EndpointHttpServerTestRequest.md +docs/EndpointHttpServerTests.md +docs/EndpointHttpServerType.md +docs/EndpointInstantTest.md +docs/EndpointScheduledTestType.md +docs/EndpointSpecificAgentsSelectorConfig.md +docs/EndpointTest.md +docs/EndpointTestAgentSelectorType.md +docs/EndpointTestAid.md +docs/EndpointTestAuthType.md +docs/EndpointTestLinks.md +docs/EndpointTestLinksSelf.md +docs/EndpointTestLinksTestResults.md +docs/EndpointTestProtocol.md +docs/EndpointTests.md +docs/Error.md +docs/GetDynamicTestDetail200Response.md +docs/GetDynamicTestsList200Response.md +docs/GetEndpointAgentToserverTestsList200Response.md +docs/GetEndpointHttpserverTestDetail200Response.md +docs/GetEndpointHttpserverTestsList200Response.md +docs/GetEndpointTestsList200Response.md +docs/Link.md +docs/ListEndpointScheduledTestsApi.md +docs/PostEndpointAgentToServerTest201Response.md +docs/ScheduledTestsAgentToServerApi.md +docs/ScheduledTestsHTTPServerApi.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/SpecificAgentsSelectorType.md +docs/TestInterval.md +docs/TestProbeMode.md +docs/TestSslVersionId.md +docs/UnauthorizedError.md +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_account_group_id.py +test/test_agent_labels_selector_type.py +test/test_all_agents_selector_type.py +test/test_dynamic_test.py +test/test_dynamic_test_application.py +test/test_dynamic_test_links.py +test/test_dynamic_test_links_self.py +test/test_dynamic_test_links_test_results.py +test/test_dynamic_test_request.py +test/test_dynamic_tests.py +test/test_dynamic_tests_agent_to_server_api.py +test/test_endpoint_agent_labels_selector_config.py +test/test_endpoint_agent_selector_config.py +test/test_endpoint_agent_to_server_instant_test.py +test/test_endpoint_agent_to_server_test.py +test/test_endpoint_agent_to_server_test_request.py +test/test_endpoint_agent_to_server_tests.py +test/test_endpoint_agent_to_server_type.py +test/test_endpoint_all_agents_selector_config.py +test/test_endpoint_http_server_base_test.py +test/test_endpoint_http_server_instant_test.py +test/test_endpoint_http_server_test.py +test/test_endpoint_http_server_test_request.py +test/test_endpoint_http_server_tests.py +test/test_endpoint_http_server_type.py +test/test_endpoint_instant_test.py +test/test_endpoint_scheduled_test_type.py +test/test_endpoint_specific_agents_selector_config.py +test/test_endpoint_test.py +test/test_endpoint_test_agent_selector_type.py +test/test_endpoint_test_aid.py +test/test_endpoint_test_auth_type.py +test/test_endpoint_test_links.py +test/test_endpoint_test_links_self.py +test/test_endpoint_test_links_test_results.py +test/test_endpoint_test_protocol.py +test/test_endpoint_tests.py +test/test_error.py +test/test_get_dynamic_test_detail200_response.py +test/test_get_dynamic_tests_list200_response.py +test/test_get_endpoint_agent_toserver_tests_list200_response.py +test/test_get_endpoint_httpserver_test_detail200_response.py +test/test_get_endpoint_httpserver_tests_list200_response.py +test/test_get_endpoint_tests_list200_response.py +test/test_link.py +test/test_list_endpoint_scheduled_tests_api.py +test/test_post_endpoint_agent_to_server_test201_response.py +test/test_scheduled_tests_agent_to_server_api.py +test/test_scheduled_tests_http_server_api.py +test/test_self_links.py +test/test_self_links_links.py +test/test_specific_agents_selector_type.py +test/test_test_interval.py +test/test_test_probe_mode.py +test/test_test_ssl_version_id.py +test/test_unauthorized_error.py +tests_api/__init__.py +tests_api/api/__init__.py +tests_api/api/dynamic_tests_agent_to_server_api.py +tests_api/api/list_endpoint_scheduled_tests_api.py +tests_api/api/scheduled_tests_agent_to_server_api.py +tests_api/api/scheduled_tests_http_server_api.py +tests_api/api_client.py +tests_api/api_response.py +tests_api/configuration.py +tests_api/exceptions.py +tests_api/models/__init__.py +tests_api/models/account_group_id.py +tests_api/models/agent_labels_selector_type.py +tests_api/models/all_agents_selector_type.py +tests_api/models/dynamic_test.py +tests_api/models/dynamic_test_application.py +tests_api/models/dynamic_test_links.py +tests_api/models/dynamic_test_links_self.py +tests_api/models/dynamic_test_links_test_results.py +tests_api/models/dynamic_test_request.py +tests_api/models/dynamic_tests.py +tests_api/models/endpoint_agent_labels_selector_config.py +tests_api/models/endpoint_agent_selector_config.py +tests_api/models/endpoint_agent_to_server_instant_test.py +tests_api/models/endpoint_agent_to_server_test.py +tests_api/models/endpoint_agent_to_server_test_request.py +tests_api/models/endpoint_agent_to_server_tests.py +tests_api/models/endpoint_agent_to_server_type.py +tests_api/models/endpoint_all_agents_selector_config.py +tests_api/models/endpoint_http_server_base_test.py +tests_api/models/endpoint_http_server_instant_test.py +tests_api/models/endpoint_http_server_test.py +tests_api/models/endpoint_http_server_test_request.py +tests_api/models/endpoint_http_server_tests.py +tests_api/models/endpoint_http_server_type.py +tests_api/models/endpoint_instant_test.py +tests_api/models/endpoint_scheduled_test_type.py +tests_api/models/endpoint_specific_agents_selector_config.py +tests_api/models/endpoint_test.py +tests_api/models/endpoint_test_agent_selector_type.py +tests_api/models/endpoint_test_aid.py +tests_api/models/endpoint_test_auth_type.py +tests_api/models/endpoint_test_links.py +tests_api/models/endpoint_test_links_self.py +tests_api/models/endpoint_test_links_test_results.py +tests_api/models/endpoint_test_protocol.py +tests_api/models/endpoint_tests.py +tests_api/models/error.py +tests_api/models/get_dynamic_test_detail200_response.py +tests_api/models/get_dynamic_tests_list200_response.py +tests_api/models/get_endpoint_agent_toserver_tests_list200_response.py +tests_api/models/get_endpoint_httpserver_test_detail200_response.py +tests_api/models/get_endpoint_httpserver_tests_list200_response.py +tests_api/models/get_endpoint_tests_list200_response.py +tests_api/models/link.py +tests_api/models/post_endpoint_agent_to_server_test201_response.py +tests_api/models/self_links.py +tests_api/models/self_links_links.py +tests_api/models/specific_agents_selector_type.py +tests_api/models/test_interval.py +tests_api/models/test_probe_mode.py +tests_api/models/test_ssl_version_id.py +tests_api/models/unauthorized_error.py +tests_api/py.typed +tests_api/rest.py +tox.ini diff --git a/endpoint/tests_api/.openapi-generator/VERSION b/endpoint/tests_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/endpoint/tests_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/endpoint/tests_api/.travis.yml b/endpoint/tests_api/.travis.yml new file mode 100644 index 00000000..df7c4097 --- /dev/null +++ b/endpoint/tests_api/.travis.yml @@ -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=tests_api diff --git a/endpoint/tests_api/README.md b/endpoint/tests_api/README.md new file mode 100644 index 00000000..e2f769bf --- /dev/null +++ b/endpoint/tests_api/README.md @@ -0,0 +1,183 @@ +# tests-api + +## Overview +Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + +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 tests_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 tests_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 tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DynamicTestsAgentToServerApi(api_client) + test_id = '584739201' # str | Unique ID of endpoint test. + 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 endpoint dynamic test + api_response = api_instance.get_dynamic_test_detail(test_id, aid=aid) + print("The response of DynamicTestsAgentToServerApi->get_dynamic_test_detail:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling DynamicTestsAgentToServerApi->get_dynamic_test_detail: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DynamicTestsAgentToServerApi* | [**get_dynamic_test_detail**](docs/DynamicTestsAgentToServerApi.md#get_dynamic_test_detail) | **GET** /v7/endpoint/tests/dynamic-tests/agent-to-server/{testId} | Retrieve endpoint dynamic test +*DynamicTestsAgentToServerApi* | [**get_dynamic_tests_list**](docs/DynamicTestsAgentToServerApi.md#get_dynamic_tests_list) | **GET** /v7/endpoint/tests/dynamic-tests/agent-to-server | List endpoint dynamic tests +*DynamicTestsAgentToServerApi* | [**post_dynamic_test**](docs/DynamicTestsAgentToServerApi.md#post_dynamic_test) | **POST** /v7/endpoint/tests/dynamic-tests/agent-to-server | Create endpoint dynamic test +*ListEndpointScheduledTestsApi* | [**get_endpoint_tests_list**](docs/ListEndpointScheduledTestsApi.md#get_endpoint_tests_list) | **GET** /v7/endpoint/tests/scheduled-tests | List endpoint scheduled tests +*ScheduledTestsAgentToServerApi* | [**get_endpoint_agent_to_server_detail**](docs/ScheduledTestsAgentToServerApi.md#get_endpoint_agent_to_server_detail) | **GET** /v7/endpoint/tests/scheduled-tests/agent-to-server/{testId} | Retrieve agent to server endpoint scheduled test +*ScheduledTestsAgentToServerApi* | [**get_endpoint_agent_toserver_tests_list**](docs/ScheduledTestsAgentToServerApi.md#get_endpoint_agent_toserver_tests_list) | **GET** /v7/endpoint/tests/scheduled-tests/agent-to-server | List agent to server endpoint scheduled tests +*ScheduledTestsAgentToServerApi* | [**post_endpoint_agent_to_server_test**](docs/ScheduledTestsAgentToServerApi.md#post_endpoint_agent_to_server_test) | **POST** /v7/endpoint/tests/scheduled-tests/agent-to-server | Creates agent to server endpoint scheduled test +*ScheduledTestsHTTPServerApi* | [**get_endpoint_httpserver_test_detail**](docs/ScheduledTestsHTTPServerApi.md#get_endpoint_httpserver_test_detail) | **GET** /v7/endpoint/tests/scheduled-tests/http-server/{testId} | Retrieves HTTP server endpoint scheduled test +*ScheduledTestsHTTPServerApi* | [**get_endpoint_httpserver_tests_list**](docs/ScheduledTestsHTTPServerApi.md#get_endpoint_httpserver_tests_list) | **GET** /v7/endpoint/tests/scheduled-tests/http-server | List HTTP server endpoint scheduled tests +*ScheduledTestsHTTPServerApi* | [**post_endpoint_httpserver_test**](docs/ScheduledTestsHTTPServerApi.md#post_endpoint_httpserver_test) | **POST** /v7/endpoint/tests/scheduled-tests/http-server | Create HTTP server endpoint scheduled test + + +## Documentation For Models + + - [AccountGroupId](docs/AccountGroupId.md) + - [AgentLabelsSelectorType](docs/AgentLabelsSelectorType.md) + - [AllAgentsSelectorType](docs/AllAgentsSelectorType.md) + - [DynamicTest](docs/DynamicTest.md) + - [DynamicTestApplication](docs/DynamicTestApplication.md) + - [DynamicTestLinks](docs/DynamicTestLinks.md) + - [DynamicTestLinksSelf](docs/DynamicTestLinksSelf.md) + - [DynamicTestLinksTestResults](docs/DynamicTestLinksTestResults.md) + - [DynamicTestRequest](docs/DynamicTestRequest.md) + - [DynamicTests](docs/DynamicTests.md) + - [EndpointAgentLabelsSelectorConfig](docs/EndpointAgentLabelsSelectorConfig.md) + - [EndpointAgentSelectorConfig](docs/EndpointAgentSelectorConfig.md) + - [EndpointAgentToServerInstantTest](docs/EndpointAgentToServerInstantTest.md) + - [EndpointAgentToServerTest](docs/EndpointAgentToServerTest.md) + - [EndpointAgentToServerTestRequest](docs/EndpointAgentToServerTestRequest.md) + - [EndpointAgentToServerTests](docs/EndpointAgentToServerTests.md) + - [EndpointAgentToServerType](docs/EndpointAgentToServerType.md) + - [EndpointAllAgentsSelectorConfig](docs/EndpointAllAgentsSelectorConfig.md) + - [EndpointHttpServerBaseTest](docs/EndpointHttpServerBaseTest.md) + - [EndpointHttpServerInstantTest](docs/EndpointHttpServerInstantTest.md) + - [EndpointHttpServerTest](docs/EndpointHttpServerTest.md) + - [EndpointHttpServerTestRequest](docs/EndpointHttpServerTestRequest.md) + - [EndpointHttpServerTests](docs/EndpointHttpServerTests.md) + - [EndpointHttpServerType](docs/EndpointHttpServerType.md) + - [EndpointInstantTest](docs/EndpointInstantTest.md) + - [EndpointScheduledTestType](docs/EndpointScheduledTestType.md) + - [EndpointSpecificAgentsSelectorConfig](docs/EndpointSpecificAgentsSelectorConfig.md) + - [EndpointTest](docs/EndpointTest.md) + - [EndpointTestAgentSelectorType](docs/EndpointTestAgentSelectorType.md) + - [EndpointTestAid](docs/EndpointTestAid.md) + - [EndpointTestAuthType](docs/EndpointTestAuthType.md) + - [EndpointTestLinks](docs/EndpointTestLinks.md) + - [EndpointTestLinksSelf](docs/EndpointTestLinksSelf.md) + - [EndpointTestLinksTestResults](docs/EndpointTestLinksTestResults.md) + - [EndpointTestProtocol](docs/EndpointTestProtocol.md) + - [EndpointTests](docs/EndpointTests.md) + - [Error](docs/Error.md) + - [GetDynamicTestDetail200Response](docs/GetDynamicTestDetail200Response.md) + - [GetDynamicTestsList200Response](docs/GetDynamicTestsList200Response.md) + - [GetEndpointAgentToserverTestsList200Response](docs/GetEndpointAgentToserverTestsList200Response.md) + - [GetEndpointHttpserverTestDetail200Response](docs/GetEndpointHttpserverTestDetail200Response.md) + - [GetEndpointHttpserverTestsList200Response](docs/GetEndpointHttpserverTestsList200Response.md) + - [GetEndpointTestsList200Response](docs/GetEndpointTestsList200Response.md) + - [Link](docs/Link.md) + - [PostEndpointAgentToServerTest201Response](docs/PostEndpointAgentToServerTest201Response.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [SpecificAgentsSelectorType](docs/SpecificAgentsSelectorType.md) + - [TestInterval](docs/TestInterval.md) + - [TestProbeMode](docs/TestProbeMode.md) + - [TestSslVersionId](docs/TestSslVersionId.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/endpoint/tests_api/docs/AccountGroupId.md b/endpoint/tests_api/docs/AccountGroupId.md new file mode 100644 index 00000000..b32f8257 --- /dev/null +++ b/endpoint/tests_api/docs/AccountGroupId.md @@ -0,0 +1,28 @@ +# AccountGroupId + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] + +## Example + +```python +from tests_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) + + diff --git a/endpoint/tests_api/docs/AgentLabelsSelectorType.md b/endpoint/tests_api/docs/AgentLabelsSelectorType.md new file mode 100644 index 00000000..aa3d0399 --- /dev/null +++ b/endpoint/tests_api/docs/AgentLabelsSelectorType.md @@ -0,0 +1,10 @@ +# AgentLabelsSelectorType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/AllAgentsSelectorType.md b/endpoint/tests_api/docs/AllAgentsSelectorType.md new file mode 100644 index 00000000..049c7eec --- /dev/null +++ b/endpoint/tests_api/docs/AllAgentsSelectorType.md @@ -0,0 +1,10 @@ +# AllAgentsSelectorType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/DynamicTest.md b/endpoint/tests_api/docs/DynamicTest.md new file mode 100644 index 00000000..4d8209c2 --- /dev/null +++ b/endpoint/tests_api/docs/DynamicTest.md @@ -0,0 +1,43 @@ +# DynamicTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**DynamicTestLinks**](DynamicTestLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**application** | [**DynamicTestApplication**](DynamicTestApplication.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] [readonly] +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [readonly] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] [readonly] +**test_id** | **str** | Each test is assigned a unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] + +## Example + +```python +from tests_api.models.dynamic_test import DynamicTest + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicTest from a JSON string +dynamic_test_instance = DynamicTest.from_json(json) +# print the JSON string representation of the object +print DynamicTest.to_json() + +# convert the object into a dict +dynamic_test_dict = dynamic_test_instance.to_dict() +# create an instance of DynamicTest from a dict +dynamic_test_form_dict = dynamic_test.from_dict(dynamic_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/DynamicTestApplication.md b/endpoint/tests_api/docs/DynamicTestApplication.md new file mode 100644 index 00000000..f6055344 --- /dev/null +++ b/endpoint/tests_api/docs/DynamicTestApplication.md @@ -0,0 +1,11 @@ +# DynamicTestApplication + +Which supported application to monitor. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/DynamicTestLinks.md b/endpoint/tests_api/docs/DynamicTestLinks.md new file mode 100644 index 00000000..e1115752 --- /dev/null +++ b/endpoint/tests_api/docs/DynamicTestLinks.md @@ -0,0 +1,30 @@ +# DynamicTestLinks + +A list of links that can be accessed to get more information. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**DynamicTestLinksSelf**](DynamicTestLinksSelf.md) | | [optional] +**test_results** | [**DynamicTestLinksTestResults**](DynamicTestLinksTestResults.md) | | [optional] + +## Example + +```python +from tests_api.models.dynamic_test_links import DynamicTestLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicTestLinks from a JSON string +dynamic_test_links_instance = DynamicTestLinks.from_json(json) +# print the JSON string representation of the object +print DynamicTestLinks.to_json() + +# convert the object into a dict +dynamic_test_links_dict = dynamic_test_links_instance.to_dict() +# create an instance of DynamicTestLinks from a dict +dynamic_test_links_form_dict = dynamic_test_links.from_dict(dynamic_test_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/DynamicTestLinksSelf.md b/endpoint/tests_api/docs/DynamicTestLinksSelf.md new file mode 100644 index 00000000..ff5f2ec8 --- /dev/null +++ b/endpoint/tests_api/docs/DynamicTestLinksSelf.md @@ -0,0 +1,35 @@ +# DynamicTestLinksSelf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from tests_api.models.dynamic_test_links_self import DynamicTestLinksSelf + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicTestLinksSelf from a JSON string +dynamic_test_links_self_instance = DynamicTestLinksSelf.from_json(json) +# print the JSON string representation of the object +print DynamicTestLinksSelf.to_json() + +# convert the object into a dict +dynamic_test_links_self_dict = dynamic_test_links_self_instance.to_dict() +# create an instance of DynamicTestLinksSelf from a dict +dynamic_test_links_self_form_dict = dynamic_test_links_self.from_dict(dynamic_test_links_self_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/DynamicTestLinksTestResults.md b/endpoint/tests_api/docs/DynamicTestLinksTestResults.md new file mode 100644 index 00000000..ca309850 --- /dev/null +++ b/endpoint/tests_api/docs/DynamicTestLinksTestResults.md @@ -0,0 +1,35 @@ +# DynamicTestLinksTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from tests_api.models.dynamic_test_links_test_results import DynamicTestLinksTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicTestLinksTestResults from a JSON string +dynamic_test_links_test_results_instance = DynamicTestLinksTestResults.from_json(json) +# print the JSON string representation of the object +print DynamicTestLinksTestResults.to_json() + +# convert the object into a dict +dynamic_test_links_test_results_dict = dynamic_test_links_test_results_instance.to_dict() +# create an instance of DynamicTestLinksTestResults from a dict +dynamic_test_links_test_results_form_dict = dynamic_test_links_test_results.from_dict(dynamic_test_links_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/DynamicTestRequest.md b/endpoint/tests_api/docs/DynamicTestRequest.md new file mode 100644 index 00000000..ab98b95f --- /dev/null +++ b/endpoint/tests_api/docs/DynamicTestRequest.md @@ -0,0 +1,47 @@ +# DynamicTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**DynamicTestLinks**](DynamicTestLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**application** | [**DynamicTestApplication**](DynamicTestApplication.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] [readonly] +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [readonly] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] [readonly] +**test_id** | **str** | Each test is assigned a unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | [optional] +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute this test. | [optional] + +## Example + +```python +from tests_api.models.dynamic_test_request import DynamicTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicTestRequest from a JSON string +dynamic_test_request_instance = DynamicTestRequest.from_json(json) +# print the JSON string representation of the object +print DynamicTestRequest.to_json() + +# convert the object into a dict +dynamic_test_request_dict = dynamic_test_request_instance.to_dict() +# create an instance of DynamicTestRequest from a dict +dynamic_test_request_form_dict = dynamic_test_request.from_dict(dynamic_test_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) + + diff --git a/endpoint/tests_api/docs/DynamicTests.md b/endpoint/tests_api/docs/DynamicTests.md new file mode 100644 index 00000000..faf60540 --- /dev/null +++ b/endpoint/tests_api/docs/DynamicTests.md @@ -0,0 +1,28 @@ +# DynamicTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[DynamicTest]**](DynamicTest.md) | | [optional] + +## Example + +```python +from tests_api.models.dynamic_tests import DynamicTests + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicTests from a JSON string +dynamic_tests_instance = DynamicTests.from_json(json) +# print the JSON string representation of the object +print DynamicTests.to_json() + +# convert the object into a dict +dynamic_tests_dict = dynamic_tests_instance.to_dict() +# create an instance of DynamicTests from a dict +dynamic_tests_form_dict = dynamic_tests.from_dict(dynamic_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/DynamicTestsAgentToServerApi.md b/endpoint/tests_api/docs/DynamicTestsAgentToServerApi.md new file mode 100644 index 00000000..d1cb853d --- /dev/null +++ b/endpoint/tests_api/docs/DynamicTestsAgentToServerApi.md @@ -0,0 +1,268 @@ +# tests_api.DynamicTestsAgentToServerApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_dynamic_test_detail**](DynamicTestsAgentToServerApi.md#get_dynamic_test_detail) | **GET** /v7/endpoint/tests/dynamic-tests/agent-to-server/{testId} | Retrieve endpoint dynamic test +[**get_dynamic_tests_list**](DynamicTestsAgentToServerApi.md#get_dynamic_tests_list) | **GET** /v7/endpoint/tests/dynamic-tests/agent-to-server | List endpoint dynamic tests +[**post_dynamic_test**](DynamicTestsAgentToServerApi.md#post_dynamic_test) | **POST** /v7/endpoint/tests/dynamic-tests/agent-to-server | Create endpoint dynamic test + + +# **get_dynamic_test_detail** +> GetDynamicTestDetail200Response get_dynamic_test_detail(test_id, aid=aid) + +Retrieve endpoint dynamic test + +Returns details of an endpoint dynamic test, including test type, name, intervals, targets. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_dynamic_test_detail200_response import GetDynamicTestDetail200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DynamicTestsAgentToServerApi(api_client) + test_id = '584739201' # str | Unique ID of endpoint test. + 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 endpoint dynamic test + api_response = api_instance.get_dynamic_test_detail(test_id, aid=aid) + print("The response of DynamicTestsAgentToServerApi->get_dynamic_test_detail:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DynamicTestsAgentToServerApi->get_dynamic_test_detail: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Unique ID of endpoint test. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetDynamicTestDetail200Response**](GetDynamicTestDetail200Response.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_dynamic_tests_list** +> GetDynamicTestsList200Response get_dynamic_tests_list(aid=aid) + +List endpoint dynamic tests + +Returns a list of all endpoint dynamic tests configured in ThousandEyes. This list does not contain saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_dynamic_tests_list200_response import GetDynamicTestsList200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DynamicTestsAgentToServerApi(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 endpoint dynamic tests + api_response = api_instance.get_dynamic_tests_list(aid=aid) + print("The response of DynamicTestsAgentToServerApi->get_dynamic_tests_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DynamicTestsAgentToServerApi->get_dynamic_tests_list: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetDynamicTestsList200Response**](GetDynamicTestsList200Response.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 | - | +**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) + +# **post_dynamic_test** +> DynamicTest post_dynamic_test(dynamic_test_request, aid=aid) + +Create endpoint dynamic test + +Create a new endpoint dynamic test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.dynamic_test import DynamicTest +from tests_api.models.dynamic_test_request import DynamicTestRequest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DynamicTestsAgentToServerApi(api_client) + dynamic_test_request = tests_api.DynamicTestRequest() # DynamicTestRequest | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create endpoint dynamic test + api_response = api_instance.post_dynamic_test(dynamic_test_request, aid=aid) + print("The response of DynamicTestsAgentToServerApi->post_dynamic_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DynamicTestsAgentToServerApi->post_dynamic_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dynamic_test_request** | [**DynamicTestRequest**](DynamicTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**DynamicTest**](DynamicTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/tests_api/docs/EndpointAgentLabelsSelectorConfig.md b/endpoint/tests_api/docs/EndpointAgentLabelsSelectorConfig.md new file mode 100644 index 00000000..856ae255 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointAgentLabelsSelectorConfig.md @@ -0,0 +1,31 @@ +# EndpointAgentLabelsSelectorConfig + +Agent labels selection object. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**AgentLabelsSelectorType**](AgentLabelsSelectorType.md) | | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] + +## Example + +```python +from tests_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentLabelsSelectorConfig from a JSON string +endpoint_agent_labels_selector_config_instance = EndpointAgentLabelsSelectorConfig.from_json(json) +# print the JSON string representation of the object +print EndpointAgentLabelsSelectorConfig.to_json() + +# convert the object into a dict +endpoint_agent_labels_selector_config_dict = endpoint_agent_labels_selector_config_instance.to_dict() +# create an instance of EndpointAgentLabelsSelectorConfig from a dict +endpoint_agent_labels_selector_config_form_dict = endpoint_agent_labels_selector_config.from_dict(endpoint_agent_labels_selector_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointAgentSelectorConfig.md b/endpoint/tests_api/docs/EndpointAgentSelectorConfig.md new file mode 100644 index 00000000..0a78dd15 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointAgentSelectorConfig.md @@ -0,0 +1,32 @@ +# EndpointAgentSelectorConfig + +Agents selection object based on agentSelectorType. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**SpecificAgentsSelectorType**](SpecificAgentsSelectorType.md) | | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] + +## Example + +```python +from tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentSelectorConfig from a JSON string +endpoint_agent_selector_config_instance = EndpointAgentSelectorConfig.from_json(json) +# print the JSON string representation of the object +print EndpointAgentSelectorConfig.to_json() + +# convert the object into a dict +endpoint_agent_selector_config_dict = endpoint_agent_selector_config_instance.to_dict() +# create an instance of EndpointAgentSelectorConfig from a dict +endpoint_agent_selector_config_form_dict = endpoint_agent_selector_config.from_dict(endpoint_agent_selector_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointAgentToServerInstantTest.md b/endpoint/tests_api/docs/EndpointAgentToServerInstantTest.md new file mode 100644 index 00000000..f418c94a --- /dev/null +++ b/endpoint/tests_api/docs/EndpointAgentToServerInstantTest.md @@ -0,0 +1,36 @@ +# EndpointAgentToServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**test_name** | **str** | Name of the test. | +**server_name** | **str** | A server address without a protocol or IP address. | + +## Example + +```python +from tests_api.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentToServerInstantTest from a JSON string +endpoint_agent_to_server_instant_test_instance = EndpointAgentToServerInstantTest.from_json(json) +# print the JSON string representation of the object +print EndpointAgentToServerInstantTest.to_json() + +# convert the object into a dict +endpoint_agent_to_server_instant_test_dict = endpoint_agent_to_server_instant_test_instance.to_dict() +# create an instance of EndpointAgentToServerInstantTest from a dict +endpoint_agent_to_server_instant_test_form_dict = endpoint_agent_to_server_instant_test.from_dict(endpoint_agent_to_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointAgentToServerTest.md b/endpoint/tests_api/docs/EndpointAgentToServerTest.md new file mode 100644 index 00000000..fb8840ad --- /dev/null +++ b/endpoint/tests_api/docs/EndpointAgentToServerTest.md @@ -0,0 +1,43 @@ +# EndpointAgentToServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**EndpointTestLinks**](EndpointTestLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**is_saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**server** | **str** | Target domain name or IP address. | [optional] +**test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] +**type** | [**EndpointAgentToServerType**](EndpointAgentToServerType.md) | | [optional] + +## Example + +```python +from tests_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentToServerTest from a JSON string +endpoint_agent_to_server_test_instance = EndpointAgentToServerTest.from_json(json) +# print the JSON string representation of the object +print EndpointAgentToServerTest.to_json() + +# convert the object into a dict +endpoint_agent_to_server_test_dict = endpoint_agent_to_server_test_instance.to_dict() +# create an instance of EndpointAgentToServerTest from a dict +endpoint_agent_to_server_test_form_dict = endpoint_agent_to_server_test.from_dict(endpoint_agent_to_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointAgentToServerTestRequest.md b/endpoint/tests_api/docs/EndpointAgentToServerTestRequest.md new file mode 100644 index 00000000..e87bba80 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointAgentToServerTestRequest.md @@ -0,0 +1,37 @@ +# EndpointAgentToServerTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**test_name** | **str** | Name of the test. | +**server_name** | **str** | A server address without a protocol or IP address. | +**interval** | [**TestInterval**](TestInterval.md) | | + +## Example + +```python +from tests_api.models.endpoint_agent_to_server_test_request import EndpointAgentToServerTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentToServerTestRequest from a JSON string +endpoint_agent_to_server_test_request_instance = EndpointAgentToServerTestRequest.from_json(json) +# print the JSON string representation of the object +print EndpointAgentToServerTestRequest.to_json() + +# convert the object into a dict +endpoint_agent_to_server_test_request_dict = endpoint_agent_to_server_test_request_instance.to_dict() +# create an instance of EndpointAgentToServerTestRequest from a dict +endpoint_agent_to_server_test_request_form_dict = endpoint_agent_to_server_test_request.from_dict(endpoint_agent_to_server_test_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) + + diff --git a/endpoint/tests_api/docs/EndpointAgentToServerTests.md b/endpoint/tests_api/docs/EndpointAgentToServerTests.md new file mode 100644 index 00000000..3db44741 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointAgentToServerTests.md @@ -0,0 +1,28 @@ +# EndpointAgentToServerTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[EndpointAgentToServerTest]**](EndpointAgentToServerTest.md) | | [optional] + +## Example + +```python +from tests_api.models.endpoint_agent_to_server_tests import EndpointAgentToServerTests + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentToServerTests from a JSON string +endpoint_agent_to_server_tests_instance = EndpointAgentToServerTests.from_json(json) +# print the JSON string representation of the object +print EndpointAgentToServerTests.to_json() + +# convert the object into a dict +endpoint_agent_to_server_tests_dict = endpoint_agent_to_server_tests_instance.to_dict() +# create an instance of EndpointAgentToServerTests from a dict +endpoint_agent_to_server_tests_form_dict = endpoint_agent_to_server_tests.from_dict(endpoint_agent_to_server_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointAgentToServerType.md b/endpoint/tests_api/docs/EndpointAgentToServerType.md new file mode 100644 index 00000000..a2abd7c3 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointAgentToServerType.md @@ -0,0 +1,11 @@ +# EndpointAgentToServerType + +Type of test being queried. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointAllAgentsSelectorConfig.md b/endpoint/tests_api/docs/EndpointAllAgentsSelectorConfig.md new file mode 100644 index 00000000..58a5b63b --- /dev/null +++ b/endpoint/tests_api/docs/EndpointAllAgentsSelectorConfig.md @@ -0,0 +1,30 @@ +# EndpointAllAgentsSelectorConfig + +Any agent selection object. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**AllAgentsSelectorType**](AllAgentsSelectorType.md) | | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] + +## Example + +```python +from tests_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAllAgentsSelectorConfig from a JSON string +endpoint_all_agents_selector_config_instance = EndpointAllAgentsSelectorConfig.from_json(json) +# print the JSON string representation of the object +print EndpointAllAgentsSelectorConfig.to_json() + +# convert the object into a dict +endpoint_all_agents_selector_config_dict = endpoint_all_agents_selector_config_instance.to_dict() +# create an instance of EndpointAllAgentsSelectorConfig from a dict +endpoint_all_agents_selector_config_form_dict = endpoint_all_agents_selector_config.from_dict(endpoint_all_agents_selector_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointHttpServerBaseTest.md b/endpoint/tests_api/docs/EndpointHttpServerBaseTest.md new file mode 100644 index 00000000..238aa6f9 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointHttpServerBaseTest.md @@ -0,0 +1,36 @@ +# EndpointHttpServerBaseTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] + +## Example + +```python +from tests_api.models.endpoint_http_server_base_test import EndpointHttpServerBaseTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointHttpServerBaseTest from a JSON string +endpoint_http_server_base_test_instance = EndpointHttpServerBaseTest.from_json(json) +# print the JSON string representation of the object +print EndpointHttpServerBaseTest.to_json() + +# convert the object into a dict +endpoint_http_server_base_test_dict = endpoint_http_server_base_test_instance.to_dict() +# create an instance of EndpointHttpServerBaseTest from a dict +endpoint_http_server_base_test_form_dict = endpoint_http_server_base_test.from_dict(endpoint_http_server_base_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointHttpServerInstantTest.md b/endpoint/tests_api/docs/EndpointHttpServerInstantTest.md new file mode 100644 index 00000000..58b2bbf8 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointHttpServerInstantTest.md @@ -0,0 +1,46 @@ +# EndpointHttpServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**test_name** | **str** | Name of the test. | +**auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | +**target_response_time** | **int** | Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red). | +**password** | **str** | Password for Basic/NTLM authentication. | [optional] + +## Example + +```python +from tests_api.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointHttpServerInstantTest from a JSON string +endpoint_http_server_instant_test_instance = EndpointHttpServerInstantTest.from_json(json) +# print the JSON string representation of the object +print EndpointHttpServerInstantTest.to_json() + +# convert the object into a dict +endpoint_http_server_instant_test_dict = endpoint_http_server_instant_test_instance.to_dict() +# create an instance of EndpointHttpServerInstantTest from a dict +endpoint_http_server_instant_test_form_dict = endpoint_http_server_instant_test.from_dict(endpoint_http_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointHttpServerTest.md b/endpoint/tests_api/docs/EndpointHttpServerTest.md new file mode 100644 index 00000000..c9b1e4b4 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointHttpServerTest.md @@ -0,0 +1,58 @@ +# EndpointHttpServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**EndpointTestLinks**](EndpointTestLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**is_saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**server** | **str** | Target domain name or IP address. | [optional] +**test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] +**type** | [**EndpointHttpServerType**](EndpointHttpServerType.md) | | [optional] +**auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] +**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] + +## Example + +```python +from tests_api.models.endpoint_http_server_test import EndpointHttpServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointHttpServerTest from a JSON string +endpoint_http_server_test_instance = EndpointHttpServerTest.from_json(json) +# print the JSON string representation of the object +print EndpointHttpServerTest.to_json() + +# convert the object into a dict +endpoint_http_server_test_dict = endpoint_http_server_test_instance.to_dict() +# create an instance of EndpointHttpServerTest from a dict +endpoint_http_server_test_form_dict = endpoint_http_server_test.from_dict(endpoint_http_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointHttpServerTestRequest.md b/endpoint/tests_api/docs/EndpointHttpServerTestRequest.md new file mode 100644 index 00000000..4afd2624 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointHttpServerTestRequest.md @@ -0,0 +1,47 @@ +# EndpointHttpServerTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**test_name** | **str** | Name of the test. | +**auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | +**target_response_time** | **int** | Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red). | +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**interval** | [**TestInterval**](TestInterval.md) | | + +## Example + +```python +from tests_api.models.endpoint_http_server_test_request import EndpointHttpServerTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointHttpServerTestRequest from a JSON string +endpoint_http_server_test_request_instance = EndpointHttpServerTestRequest.from_json(json) +# print the JSON string representation of the object +print EndpointHttpServerTestRequest.to_json() + +# convert the object into a dict +endpoint_http_server_test_request_dict = endpoint_http_server_test_request_instance.to_dict() +# create an instance of EndpointHttpServerTestRequest from a dict +endpoint_http_server_test_request_form_dict = endpoint_http_server_test_request.from_dict(endpoint_http_server_test_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) + + diff --git a/endpoint/tests_api/docs/EndpointHttpServerTests.md b/endpoint/tests_api/docs/EndpointHttpServerTests.md new file mode 100644 index 00000000..00c0da5c --- /dev/null +++ b/endpoint/tests_api/docs/EndpointHttpServerTests.md @@ -0,0 +1,28 @@ +# EndpointHttpServerTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[EndpointHttpServerTest]**](EndpointHttpServerTest.md) | | [optional] + +## Example + +```python +from tests_api.models.endpoint_http_server_tests import EndpointHttpServerTests + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointHttpServerTests from a JSON string +endpoint_http_server_tests_instance = EndpointHttpServerTests.from_json(json) +# print the JSON string representation of the object +print EndpointHttpServerTests.to_json() + +# convert the object into a dict +endpoint_http_server_tests_dict = endpoint_http_server_tests_instance.to_dict() +# create an instance of EndpointHttpServerTests from a dict +endpoint_http_server_tests_form_dict = endpoint_http_server_tests.from_dict(endpoint_http_server_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointHttpServerType.md b/endpoint/tests_api/docs/EndpointHttpServerType.md new file mode 100644 index 00000000..1cf13c82 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointHttpServerType.md @@ -0,0 +1,11 @@ +# EndpointHttpServerType + +Type of test being queried. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointInstantTest.md b/endpoint/tests_api/docs/EndpointInstantTest.md new file mode 100644 index 00000000..466789f6 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointInstantTest.md @@ -0,0 +1,35 @@ +# EndpointInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**test_name** | **str** | Name of the test. | + +## Example + +```python +from tests_api.models.endpoint_instant_test import EndpointInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointInstantTest from a JSON string +endpoint_instant_test_instance = EndpointInstantTest.from_json(json) +# print the JSON string representation of the object +print EndpointInstantTest.to_json() + +# convert the object into a dict +endpoint_instant_test_dict = endpoint_instant_test_instance.to_dict() +# create an instance of EndpointInstantTest from a dict +endpoint_instant_test_form_dict = endpoint_instant_test.from_dict(endpoint_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointScheduledTestType.md b/endpoint/tests_api/docs/EndpointScheduledTestType.md new file mode 100644 index 00000000..4fb1f891 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointScheduledTestType.md @@ -0,0 +1,11 @@ +# EndpointScheduledTestType + +Type of test being queried. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointSpecificAgentsSelectorConfig.md b/endpoint/tests_api/docs/EndpointSpecificAgentsSelectorConfig.md new file mode 100644 index 00000000..9e5366bd --- /dev/null +++ b/endpoint/tests_api/docs/EndpointSpecificAgentsSelectorConfig.md @@ -0,0 +1,31 @@ +# EndpointSpecificAgentsSelectorConfig + +Specific agents selection object. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_selector_type** | [**SpecificAgentsSelectorType**](SpecificAgentsSelectorType.md) | | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] + +## Example + +```python +from tests_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointSpecificAgentsSelectorConfig from a JSON string +endpoint_specific_agents_selector_config_instance = EndpointSpecificAgentsSelectorConfig.from_json(json) +# print the JSON string representation of the object +print EndpointSpecificAgentsSelectorConfig.to_json() + +# convert the object into a dict +endpoint_specific_agents_selector_config_dict = endpoint_specific_agents_selector_config_instance.to_dict() +# create an instance of EndpointSpecificAgentsSelectorConfig from a dict +endpoint_specific_agents_selector_config_form_dict = endpoint_specific_agents_selector_config.from_dict(endpoint_specific_agents_selector_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointTest.md b/endpoint/tests_api/docs/EndpointTest.md new file mode 100644 index 00000000..ff05c4da --- /dev/null +++ b/endpoint/tests_api/docs/EndpointTest.md @@ -0,0 +1,43 @@ +# EndpointTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**EndpointTestLinks**](EndpointTestLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**is_saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**server** | **str** | Target domain name or IP address. | [optional] +**test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] +**type** | [**EndpointScheduledTestType**](EndpointScheduledTestType.md) | | [optional] + +## Example + +```python +from tests_api.models.endpoint_test import EndpointTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTest from a JSON string +endpoint_test_instance = EndpointTest.from_json(json) +# print the JSON string representation of the object +print EndpointTest.to_json() + +# convert the object into a dict +endpoint_test_dict = endpoint_test_instance.to_dict() +# create an instance of EndpointTest from a dict +endpoint_test_form_dict = endpoint_test.from_dict(endpoint_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointTestAgentSelectorType.md b/endpoint/tests_api/docs/EndpointTestAgentSelectorType.md new file mode 100644 index 00000000..cac1391f --- /dev/null +++ b/endpoint/tests_api/docs/EndpointTestAgentSelectorType.md @@ -0,0 +1,11 @@ +# EndpointTestAgentSelectorType + +Retrieve either all available agents, a specific list of agents, or a list of agent labels. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointTestAid.md b/endpoint/tests_api/docs/EndpointTestAid.md new file mode 100644 index 00000000..6e615cb7 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointTestAid.md @@ -0,0 +1,28 @@ +# EndpointTestAid + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] + +## Example + +```python +from tests_api.models.endpoint_test_aid import EndpointTestAid + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestAid from a JSON string +endpoint_test_aid_instance = EndpointTestAid.from_json(json) +# print the JSON string representation of the object +print EndpointTestAid.to_json() + +# convert the object into a dict +endpoint_test_aid_dict = endpoint_test_aid_instance.to_dict() +# create an instance of EndpointTestAid from a dict +endpoint_test_aid_form_dict = endpoint_test_aid.from_dict(endpoint_test_aid_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointTestAuthType.md b/endpoint/tests_api/docs/EndpointTestAuthType.md new file mode 100644 index 00000000..979915c2 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointTestAuthType.md @@ -0,0 +1,11 @@ +# EndpointTestAuthType + +HTTP authentication type. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointTestLinks.md b/endpoint/tests_api/docs/EndpointTestLinks.md new file mode 100644 index 00000000..fb676cca --- /dev/null +++ b/endpoint/tests_api/docs/EndpointTestLinks.md @@ -0,0 +1,30 @@ +# EndpointTestLinks + +A list of links that can be accessed to get more information. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**EndpointTestLinksSelf**](EndpointTestLinksSelf.md) | | [optional] +**test_results** | [**EndpointTestLinksTestResults**](EndpointTestLinksTestResults.md) | | [optional] + +## Example + +```python +from tests_api.models.endpoint_test_links import EndpointTestLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestLinks from a JSON string +endpoint_test_links_instance = EndpointTestLinks.from_json(json) +# print the JSON string representation of the object +print EndpointTestLinks.to_json() + +# convert the object into a dict +endpoint_test_links_dict = endpoint_test_links_instance.to_dict() +# create an instance of EndpointTestLinks from a dict +endpoint_test_links_form_dict = endpoint_test_links.from_dict(endpoint_test_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointTestLinksSelf.md b/endpoint/tests_api/docs/EndpointTestLinksSelf.md new file mode 100644 index 00000000..54709a6c --- /dev/null +++ b/endpoint/tests_api/docs/EndpointTestLinksSelf.md @@ -0,0 +1,35 @@ +# EndpointTestLinksSelf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from tests_api.models.endpoint_test_links_self import EndpointTestLinksSelf + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestLinksSelf from a JSON string +endpoint_test_links_self_instance = EndpointTestLinksSelf.from_json(json) +# print the JSON string representation of the object +print EndpointTestLinksSelf.to_json() + +# convert the object into a dict +endpoint_test_links_self_dict = endpoint_test_links_self_instance.to_dict() +# create an instance of EndpointTestLinksSelf from a dict +endpoint_test_links_self_form_dict = endpoint_test_links_self.from_dict(endpoint_test_links_self_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointTestLinksTestResults.md b/endpoint/tests_api/docs/EndpointTestLinksTestResults.md new file mode 100644 index 00000000..02247f1d --- /dev/null +++ b/endpoint/tests_api/docs/EndpointTestLinksTestResults.md @@ -0,0 +1,35 @@ +# EndpointTestLinksTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from tests_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestLinksTestResults from a JSON string +endpoint_test_links_test_results_instance = EndpointTestLinksTestResults.from_json(json) +# print the JSON string representation of the object +print EndpointTestLinksTestResults.to_json() + +# convert the object into a dict +endpoint_test_links_test_results_dict = endpoint_test_links_test_results_instance.to_dict() +# create an instance of EndpointTestLinksTestResults from a dict +endpoint_test_links_test_results_form_dict = endpoint_test_links_test_results.from_dict(endpoint_test_links_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointTestProtocol.md b/endpoint/tests_api/docs/EndpointTestProtocol.md new file mode 100644 index 00000000..c1e002b3 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointTestProtocol.md @@ -0,0 +1,11 @@ +# EndpointTestProtocol + +Protocol used to perform the test. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/EndpointTests.md b/endpoint/tests_api/docs/EndpointTests.md new file mode 100644 index 00000000..de309810 --- /dev/null +++ b/endpoint/tests_api/docs/EndpointTests.md @@ -0,0 +1,28 @@ +# EndpointTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[EndpointTest]**](EndpointTest.md) | | [optional] + +## Example + +```python +from tests_api.models.endpoint_tests import EndpointTests + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTests from a JSON string +endpoint_tests_instance = EndpointTests.from_json(json) +# print the JSON string representation of the object +print EndpointTests.to_json() + +# convert the object into a dict +endpoint_tests_dict = endpoint_tests_instance.to_dict() +# create an instance of EndpointTests from a dict +endpoint_tests_form_dict = endpoint_tests.from_dict(endpoint_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/Error.md b/endpoint/tests_api/docs/Error.md new file mode 100644 index 00000000..7bc50c49 --- /dev/null +++ b/endpoint/tests_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from tests_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/GetDynamicTestDetail200Response.md b/endpoint/tests_api/docs/GetDynamicTestDetail200Response.md new file mode 100644 index 00000000..ab973312 --- /dev/null +++ b/endpoint/tests_api/docs/GetDynamicTestDetail200Response.md @@ -0,0 +1,43 @@ +# GetDynamicTestDetail200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**application** | [**DynamicTestApplication**](DynamicTestApplication.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] [readonly] +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [readonly] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] [readonly] +**test_id** | **str** | Each test is assigned a unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] + +## Example + +```python +from tests_api.models.get_dynamic_test_detail200_response import GetDynamicTestDetail200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDynamicTestDetail200Response from a JSON string +get_dynamic_test_detail200_response_instance = GetDynamicTestDetail200Response.from_json(json) +# print the JSON string representation of the object +print GetDynamicTestDetail200Response.to_json() + +# convert the object into a dict +get_dynamic_test_detail200_response_dict = get_dynamic_test_detail200_response_instance.to_dict() +# create an instance of GetDynamicTestDetail200Response from a dict +get_dynamic_test_detail200_response_form_dict = get_dynamic_test_detail200_response.from_dict(get_dynamic_test_detail200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/GetDynamicTestsList200Response.md b/endpoint/tests_api/docs/GetDynamicTestsList200Response.md new file mode 100644 index 00000000..12505905 --- /dev/null +++ b/endpoint/tests_api/docs/GetDynamicTestsList200Response.md @@ -0,0 +1,29 @@ +# GetDynamicTestsList200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[DynamicTest]**](DynamicTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_dynamic_tests_list200_response import GetDynamicTestsList200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDynamicTestsList200Response from a JSON string +get_dynamic_tests_list200_response_instance = GetDynamicTestsList200Response.from_json(json) +# print the JSON string representation of the object +print GetDynamicTestsList200Response.to_json() + +# convert the object into a dict +get_dynamic_tests_list200_response_dict = get_dynamic_tests_list200_response_instance.to_dict() +# create an instance of GetDynamicTestsList200Response from a dict +get_dynamic_tests_list200_response_form_dict = get_dynamic_tests_list200_response.from_dict(get_dynamic_tests_list200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/GetEndpointAgentToserverTestsList200Response.md b/endpoint/tests_api/docs/GetEndpointAgentToserverTestsList200Response.md new file mode 100644 index 00000000..1f014f1c --- /dev/null +++ b/endpoint/tests_api/docs/GetEndpointAgentToserverTestsList200Response.md @@ -0,0 +1,29 @@ +# GetEndpointAgentToserverTestsList200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[EndpointAgentToServerTest]**](EndpointAgentToServerTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_endpoint_agent_toserver_tests_list200_response import GetEndpointAgentToserverTestsList200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointAgentToserverTestsList200Response from a JSON string +get_endpoint_agent_toserver_tests_list200_response_instance = GetEndpointAgentToserverTestsList200Response.from_json(json) +# print the JSON string representation of the object +print GetEndpointAgentToserverTestsList200Response.to_json() + +# convert the object into a dict +get_endpoint_agent_toserver_tests_list200_response_dict = get_endpoint_agent_toserver_tests_list200_response_instance.to_dict() +# create an instance of GetEndpointAgentToserverTestsList200Response from a dict +get_endpoint_agent_toserver_tests_list200_response_form_dict = get_endpoint_agent_toserver_tests_list200_response.from_dict(get_endpoint_agent_toserver_tests_list200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/GetEndpointHttpserverTestDetail200Response.md b/endpoint/tests_api/docs/GetEndpointHttpserverTestDetail200Response.md new file mode 100644 index 00000000..a709ea08 --- /dev/null +++ b/endpoint/tests_api/docs/GetEndpointHttpserverTestDetail200Response.md @@ -0,0 +1,58 @@ +# GetEndpointHttpserverTestDetail200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**is_saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**server** | **str** | Target domain name or IP address. | [optional] +**test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] +**type** | [**EndpointHttpServerType**](EndpointHttpServerType.md) | | [optional] +**auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] +**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] + +## Example + +```python +from tests_api.models.get_endpoint_httpserver_test_detail200_response import GetEndpointHttpserverTestDetail200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointHttpserverTestDetail200Response from a JSON string +get_endpoint_httpserver_test_detail200_response_instance = GetEndpointHttpserverTestDetail200Response.from_json(json) +# print the JSON string representation of the object +print GetEndpointHttpserverTestDetail200Response.to_json() + +# convert the object into a dict +get_endpoint_httpserver_test_detail200_response_dict = get_endpoint_httpserver_test_detail200_response_instance.to_dict() +# create an instance of GetEndpointHttpserverTestDetail200Response from a dict +get_endpoint_httpserver_test_detail200_response_form_dict = get_endpoint_httpserver_test_detail200_response.from_dict(get_endpoint_httpserver_test_detail200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/GetEndpointHttpserverTestsList200Response.md b/endpoint/tests_api/docs/GetEndpointHttpserverTestsList200Response.md new file mode 100644 index 00000000..c3d0fcc7 --- /dev/null +++ b/endpoint/tests_api/docs/GetEndpointHttpserverTestsList200Response.md @@ -0,0 +1,29 @@ +# GetEndpointHttpserverTestsList200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[EndpointHttpServerTest]**](EndpointHttpServerTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_endpoint_httpserver_tests_list200_response import GetEndpointHttpserverTestsList200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointHttpserverTestsList200Response from a JSON string +get_endpoint_httpserver_tests_list200_response_instance = GetEndpointHttpserverTestsList200Response.from_json(json) +# print the JSON string representation of the object +print GetEndpointHttpserverTestsList200Response.to_json() + +# convert the object into a dict +get_endpoint_httpserver_tests_list200_response_dict = get_endpoint_httpserver_tests_list200_response_instance.to_dict() +# create an instance of GetEndpointHttpserverTestsList200Response from a dict +get_endpoint_httpserver_tests_list200_response_form_dict = get_endpoint_httpserver_tests_list200_response.from_dict(get_endpoint_httpserver_tests_list200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/GetEndpointTestsList200Response.md b/endpoint/tests_api/docs/GetEndpointTestsList200Response.md new file mode 100644 index 00000000..a5d2d066 --- /dev/null +++ b/endpoint/tests_api/docs/GetEndpointTestsList200Response.md @@ -0,0 +1,29 @@ +# GetEndpointTestsList200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[EndpointTest]**](EndpointTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_endpoint_tests_list200_response import GetEndpointTestsList200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetEndpointTestsList200Response from a JSON string +get_endpoint_tests_list200_response_instance = GetEndpointTestsList200Response.from_json(json) +# print the JSON string representation of the object +print GetEndpointTestsList200Response.to_json() + +# convert the object into a dict +get_endpoint_tests_list200_response_dict = get_endpoint_tests_list200_response_instance.to_dict() +# create an instance of GetEndpointTestsList200Response from a dict +get_endpoint_tests_list200_response_form_dict = get_endpoint_tests_list200_response.from_dict(get_endpoint_tests_list200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/Link.md b/endpoint/tests_api/docs/Link.md new file mode 100644 index 00000000..5ea009ee --- /dev/null +++ b/endpoint/tests_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from tests_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/ListEndpointScheduledTestsApi.md b/endpoint/tests_api/docs/ListEndpointScheduledTestsApi.md new file mode 100644 index 00000000..d2036bd6 --- /dev/null +++ b/endpoint/tests_api/docs/ListEndpointScheduledTestsApi.md @@ -0,0 +1,92 @@ +# tests_api.ListEndpointScheduledTestsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_endpoint_tests_list**](ListEndpointScheduledTestsApi.md#get_endpoint_tests_list) | **GET** /v7/endpoint/tests/scheduled-tests | List endpoint scheduled tests + + +# **get_endpoint_tests_list** +> GetEndpointTestsList200Response get_endpoint_tests_list(aid=aid) + +List endpoint scheduled tests + +Returns a list of all endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_endpoint_tests_list200_response import GetEndpointTestsList200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.ListEndpointScheduledTestsApi(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 endpoint scheduled tests + api_response = api_instance.get_endpoint_tests_list(aid=aid) + print("The response of ListEndpointScheduledTestsApi->get_endpoint_tests_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ListEndpointScheduledTestsApi->get_endpoint_tests_list: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetEndpointTestsList200Response**](GetEndpointTestsList200Response.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 | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/tests_api/docs/PostEndpointAgentToServerTest201Response.md b/endpoint/tests_api/docs/PostEndpointAgentToServerTest201Response.md new file mode 100644 index 00000000..795fddd3 --- /dev/null +++ b/endpoint/tests_api/docs/PostEndpointAgentToServerTest201Response.md @@ -0,0 +1,43 @@ +# PostEndpointAgentToServerTest201Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [readonly] [default to True] +**is_saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**server** | **str** | Target domain name or IP address. | [optional] +**test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] +**aid** | [**EndpointTestAid**](EndpointTestAid.md) | | [optional] +**test_name** | **str** | Name of the test. | [optional] +**type** | [**EndpointAgentToServerType**](EndpointAgentToServerType.md) | | [optional] + +## Example + +```python +from tests_api.models.post_endpoint_agent_to_server_test201_response import PostEndpointAgentToServerTest201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of PostEndpointAgentToServerTest201Response from a JSON string +post_endpoint_agent_to_server_test201_response_instance = PostEndpointAgentToServerTest201Response.from_json(json) +# print the JSON string representation of the object +print PostEndpointAgentToServerTest201Response.to_json() + +# convert the object into a dict +post_endpoint_agent_to_server_test201_response_dict = post_endpoint_agent_to_server_test201_response_instance.to_dict() +# create an instance of PostEndpointAgentToServerTest201Response from a dict +post_endpoint_agent_to_server_test201_response_form_dict = post_endpoint_agent_to_server_test201_response.from_dict(post_endpoint_agent_to_server_test201_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/ScheduledTestsAgentToServerApi.md b/endpoint/tests_api/docs/ScheduledTestsAgentToServerApi.md new file mode 100644 index 00000000..f24f771a --- /dev/null +++ b/endpoint/tests_api/docs/ScheduledTestsAgentToServerApi.md @@ -0,0 +1,268 @@ +# tests_api.ScheduledTestsAgentToServerApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_endpoint_agent_to_server_detail**](ScheduledTestsAgentToServerApi.md#get_endpoint_agent_to_server_detail) | **GET** /v7/endpoint/tests/scheduled-tests/agent-to-server/{testId} | Retrieve agent to server endpoint scheduled test +[**get_endpoint_agent_toserver_tests_list**](ScheduledTestsAgentToServerApi.md#get_endpoint_agent_toserver_tests_list) | **GET** /v7/endpoint/tests/scheduled-tests/agent-to-server | List agent to server endpoint scheduled tests +[**post_endpoint_agent_to_server_test**](ScheduledTestsAgentToServerApi.md#post_endpoint_agent_to_server_test) | **POST** /v7/endpoint/tests/scheduled-tests/agent-to-server | Creates agent to server endpoint scheduled test + + +# **get_endpoint_agent_to_server_detail** +> PostEndpointAgentToServerTest201Response get_endpoint_agent_to_server_detail(test_id, aid=aid) + +Retrieve agent to server endpoint scheduled test + +Retrieves details of an agent to server endpoint scheduled test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.post_endpoint_agent_to_server_test201_response import PostEndpointAgentToServerTest201Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.ScheduledTestsAgentToServerApi(api_client) + test_id = '584739201' # str | Unique ID of endpoint test. + 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 to server endpoint scheduled test + api_response = api_instance.get_endpoint_agent_to_server_detail(test_id, aid=aid) + print("The response of ScheduledTestsAgentToServerApi->get_endpoint_agent_to_server_detail:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ScheduledTestsAgentToServerApi->get_endpoint_agent_to_server_detail: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Unique ID of endpoint test. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**PostEndpointAgentToServerTest201Response**](PostEndpointAgentToServerTest201Response.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_endpoint_agent_toserver_tests_list** +> GetEndpointAgentToserverTestsList200Response get_endpoint_agent_toserver_tests_list(aid=aid) + +List agent to server endpoint scheduled tests + +Returns a list of all agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_endpoint_agent_toserver_tests_list200_response import GetEndpointAgentToserverTestsList200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.ScheduledTestsAgentToServerApi(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 to server endpoint scheduled tests + api_response = api_instance.get_endpoint_agent_toserver_tests_list(aid=aid) + print("The response of ScheduledTestsAgentToServerApi->get_endpoint_agent_toserver_tests_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ScheduledTestsAgentToServerApi->get_endpoint_agent_toserver_tests_list: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetEndpointAgentToserverTestsList200Response**](GetEndpointAgentToserverTestsList200Response.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 | - | +**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) + +# **post_endpoint_agent_to_server_test** +> PostEndpointAgentToServerTest201Response post_endpoint_agent_to_server_test(endpoint_agent_to_server_test_request, aid=aid) + +Creates agent to server endpoint scheduled test + +Creates a new endpoint test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.endpoint_agent_to_server_test_request import EndpointAgentToServerTestRequest +from tests_api.models.post_endpoint_agent_to_server_test201_response import PostEndpointAgentToServerTest201Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.ScheduledTestsAgentToServerApi(api_client) + endpoint_agent_to_server_test_request = tests_api.EndpointAgentToServerTestRequest() # EndpointAgentToServerTestRequest | + 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: + # Creates agent to server endpoint scheduled test + api_response = api_instance.post_endpoint_agent_to_server_test(endpoint_agent_to_server_test_request, aid=aid) + print("The response of ScheduledTestsAgentToServerApi->post_endpoint_agent_to_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ScheduledTestsAgentToServerApi->post_endpoint_agent_to_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **endpoint_agent_to_server_test_request** | [**EndpointAgentToServerTestRequest**](EndpointAgentToServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**PostEndpointAgentToServerTest201Response**](PostEndpointAgentToServerTest201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/tests_api/docs/ScheduledTestsHTTPServerApi.md b/endpoint/tests_api/docs/ScheduledTestsHTTPServerApi.md new file mode 100644 index 00000000..f7c8a078 --- /dev/null +++ b/endpoint/tests_api/docs/ScheduledTestsHTTPServerApi.md @@ -0,0 +1,268 @@ +# tests_api.ScheduledTestsHTTPServerApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_endpoint_httpserver_test_detail**](ScheduledTestsHTTPServerApi.md#get_endpoint_httpserver_test_detail) | **GET** /v7/endpoint/tests/scheduled-tests/http-server/{testId} | Retrieves HTTP server endpoint scheduled test +[**get_endpoint_httpserver_tests_list**](ScheduledTestsHTTPServerApi.md#get_endpoint_httpserver_tests_list) | **GET** /v7/endpoint/tests/scheduled-tests/http-server | List HTTP server endpoint scheduled tests +[**post_endpoint_httpserver_test**](ScheduledTestsHTTPServerApi.md#post_endpoint_httpserver_test) | **POST** /v7/endpoint/tests/scheduled-tests/http-server | Create HTTP server endpoint scheduled test + + +# **get_endpoint_httpserver_test_detail** +> GetEndpointHttpserverTestDetail200Response get_endpoint_httpserver_test_detail(test_id, aid=aid) + +Retrieves HTTP server endpoint scheduled test + +Retrieves details of an HTTP Server endpoint scheduled test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_endpoint_httpserver_test_detail200_response import GetEndpointHttpserverTestDetail200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.ScheduledTestsHTTPServerApi(api_client) + test_id = '584739201' # str | Unique ID of endpoint test. + 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: + # Retrieves HTTP server endpoint scheduled test + api_response = api_instance.get_endpoint_httpserver_test_detail(test_id, aid=aid) + print("The response of ScheduledTestsHTTPServerApi->get_endpoint_httpserver_test_detail:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ScheduledTestsHTTPServerApi->get_endpoint_httpserver_test_detail: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Unique ID of endpoint test. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetEndpointHttpserverTestDetail200Response**](GetEndpointHttpserverTestDetail200Response.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_endpoint_httpserver_tests_list** +> GetEndpointHttpserverTestsList200Response get_endpoint_httpserver_tests_list(aid=aid) + +List HTTP server endpoint scheduled tests + +Returns a list of agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_endpoint_httpserver_tests_list200_response import GetEndpointHttpserverTestsList200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.ScheduledTestsHTTPServerApi(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 HTTP server endpoint scheduled tests + api_response = api_instance.get_endpoint_httpserver_tests_list(aid=aid) + print("The response of ScheduledTestsHTTPServerApi->get_endpoint_httpserver_tests_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ScheduledTestsHTTPServerApi->get_endpoint_httpserver_tests_list: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetEndpointHttpserverTestsList200Response**](GetEndpointHttpserverTestsList200Response.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 | - | +**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) + +# **post_endpoint_httpserver_test** +> EndpointHttpServerTest post_endpoint_httpserver_test(endpoint_http_server_test_request, aid=aid) + +Create HTTP server endpoint scheduled test + +Creates a new HTTP server endpoint test in ThousandEyes, using properties specified in the POST data. Please note that only users with Account Admin privileges have the authorization to create new tests; regular users are restricted from using POST-based methods. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.endpoint_http_server_test import EndpointHttpServerTest +from tests_api.models.endpoint_http_server_test_request import EndpointHttpServerTestRequest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.ScheduledTestsHTTPServerApi(api_client) + endpoint_http_server_test_request = tests_api.EndpointHttpServerTestRequest() # EndpointHttpServerTestRequest | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create HTTP server endpoint scheduled test + api_response = api_instance.post_endpoint_httpserver_test(endpoint_http_server_test_request, aid=aid) + print("The response of ScheduledTestsHTTPServerApi->post_endpoint_httpserver_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ScheduledTestsHTTPServerApi->post_endpoint_httpserver_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **endpoint_http_server_test_request** | [**EndpointHttpServerTestRequest**](EndpointHttpServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointHttpServerTest**](EndpointHttpServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/endpoint/tests_api/docs/SelfLinks.md b/endpoint/tests_api/docs/SelfLinks.md new file mode 100644 index 00000000..1d2c760d --- /dev/null +++ b/endpoint/tests_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/SelfLinksLinks.md b/endpoint/tests_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..acf19c78 --- /dev/null +++ b/endpoint/tests_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from tests_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/SpecificAgentsSelectorType.md b/endpoint/tests_api/docs/SpecificAgentsSelectorType.md new file mode 100644 index 00000000..e0b875a0 --- /dev/null +++ b/endpoint/tests_api/docs/SpecificAgentsSelectorType.md @@ -0,0 +1,10 @@ +# SpecificAgentsSelectorType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/TestInterval.md b/endpoint/tests_api/docs/TestInterval.md new file mode 100644 index 00000000..e0e57d69 --- /dev/null +++ b/endpoint/tests_api/docs/TestInterval.md @@ -0,0 +1,11 @@ +# TestInterval + +Interval between test runs in seconds. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/TestProbeMode.md b/endpoint/tests_api/docs/TestProbeMode.md new file mode 100644 index 00000000..2e0ad614 --- /dev/null +++ b/endpoint/tests_api/docs/TestProbeMode.md @@ -0,0 +1,11 @@ +# TestProbeMode + +Probe mode used by network test, only valid when the protocol is set to TCP. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/TestSslVersionId.md b/endpoint/tests_api/docs/TestSslVersionId.md new file mode 100644 index 00000000..fb9ac0f8 --- /dev/null +++ b/endpoint/tests_api/docs/TestSslVersionId.md @@ -0,0 +1,11 @@ +# TestSslVersionId + +SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/docs/UnauthorizedError.md b/endpoint/tests_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..55006614 --- /dev/null +++ b/endpoint/tests_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from tests_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/endpoint/tests_api/git_push.sh b/endpoint/tests_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/endpoint/tests_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/endpoint/tests_api/pyproject.toml b/endpoint/tests_api/pyproject.toml new file mode 100644 index 00000000..c1cb484b --- /dev/null +++ b/endpoint/tests_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "tests_api" +version = "1.0.0" +description = "Endpoint Tests API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Endpoint Tests API"] +include = ["tests_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/endpoint/tests_api/requirements.txt b/endpoint/tests_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/endpoint/tests_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/endpoint/tests_api/setup.cfg b/endpoint/tests_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/endpoint/tests_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/endpoint/tests_api/setup.py b/endpoint/tests_api/setup.py new file mode 100644 index 00000000..27a660b8 --- /dev/null +++ b/endpoint/tests_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "tests-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Endpoint Tests API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Endpoint Tests API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + """, # noqa: E501 + package_data={"tests_api": ["py.typed"]}, +) diff --git a/endpoint/tests_api/test-requirements.txt b/endpoint/tests_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/endpoint/tests_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/endpoint/tests_api/test/__init__.py b/endpoint/tests_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/endpoint/tests_api/test/test_account_group_id.py b/endpoint/tests_api/test/test_account_group_id.py new file mode 100644 index 00000000..f5825497 --- /dev/null +++ b/endpoint/tests_api/test/test_account_group_id.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.account_group_id import AccountGroupId + +class TestAccountGroupId(unittest.TestCase): + """AccountGroupId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroupId: + """Test AccountGroupId + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroupId` + """ + model = AccountGroupId() + if include_optional: + return AccountGroupId( + aid = '11' + ) + else: + return AccountGroupId( + ) + """ + + def testAccountGroupId(self): + """Test AccountGroupId""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_agent_labels_selector_type.py b/endpoint/tests_api/test/test_agent_labels_selector_type.py new file mode 100644 index 00000000..ba298551 --- /dev/null +++ b/endpoint/tests_api/test/test_agent_labels_selector_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.agent_labels_selector_type import AgentLabelsSelectorType + +class TestAgentLabelsSelectorType(unittest.TestCase): + """AgentLabelsSelectorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAgentLabelsSelectorType(self): + """Test AgentLabelsSelectorType""" + # inst = AgentLabelsSelectorType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_all_agents_selector_type.py b/endpoint/tests_api/test/test_all_agents_selector_type.py new file mode 100644 index 00000000..1399901d --- /dev/null +++ b/endpoint/tests_api/test/test_all_agents_selector_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.all_agents_selector_type import AllAgentsSelectorType + +class TestAllAgentsSelectorType(unittest.TestCase): + """AllAgentsSelectorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAllAgentsSelectorType(self): + """Test AllAgentsSelectorType""" + # inst = AllAgentsSelectorType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_dynamic_test.py b/endpoint/tests_api/test/test_dynamic_test.py new file mode 100644 index 00000000..5737bbb9 --- /dev/null +++ b/endpoint/tests_api/test/test_dynamic_test.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.dynamic_test import DynamicTest + +class TestDynamicTest(unittest.TestCase): + """DynamicTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicTest: + """Test DynamicTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicTest` + """ + model = DynamicTest() + if include_optional: + return DynamicTest( + links = tests_api.models.dynamic_test_links.DynamicTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}], ), + agent_selector_config = tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + application = 'webex', + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + has_path_trace_in_session = True, + has_ping = True, + has_traceroute = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + protocol = 'icmp', + tcp_probe_mode = 'auto', + test_id = '281474976710706', + aid = None, + test_name = 'Test name' + ) + else: + return DynamicTest( + ) + """ + + def testDynamicTest(self): + """Test DynamicTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_dynamic_test_application.py b/endpoint/tests_api/test/test_dynamic_test_application.py new file mode 100644 index 00000000..3c81a700 --- /dev/null +++ b/endpoint/tests_api/test/test_dynamic_test_application.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.dynamic_test_application import DynamicTestApplication + +class TestDynamicTestApplication(unittest.TestCase): + """DynamicTestApplication unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDynamicTestApplication(self): + """Test DynamicTestApplication""" + # inst = DynamicTestApplication() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_dynamic_test_links.py b/endpoint/tests_api/test/test_dynamic_test_links.py new file mode 100644 index 00000000..820a585e --- /dev/null +++ b/endpoint/tests_api/test/test_dynamic_test_links.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.dynamic_test_links import DynamicTestLinks + +class TestDynamicTestLinks(unittest.TestCase): + """DynamicTestLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicTestLinks: + """Test DynamicTestLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicTestLinks` + """ + model = DynamicTestLinks() + if include_optional: + return DynamicTestLinks( + var_self = None, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}] + ) + else: + return DynamicTestLinks( + ) + """ + + def testDynamicTestLinks(self): + """Test DynamicTestLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_dynamic_test_links_self.py b/endpoint/tests_api/test/test_dynamic_test_links_self.py new file mode 100644 index 00000000..bc9eaa98 --- /dev/null +++ b/endpoint/tests_api/test/test_dynamic_test_links_self.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.dynamic_test_links_self import DynamicTestLinksSelf + +class TestDynamicTestLinksSelf(unittest.TestCase): + """DynamicTestLinksSelf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicTestLinksSelf: + """Test DynamicTestLinksSelf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicTestLinksSelf` + """ + model = DynamicTestLinksSelf() + if include_optional: + return DynamicTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return DynamicTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testDynamicTestLinksSelf(self): + """Test DynamicTestLinksSelf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_dynamic_test_links_test_results.py b/endpoint/tests_api/test/test_dynamic_test_links_test_results.py new file mode 100644 index 00000000..bb781385 --- /dev/null +++ b/endpoint/tests_api/test/test_dynamic_test_links_test_results.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.dynamic_test_links_test_results import DynamicTestLinksTestResults + +class TestDynamicTestLinksTestResults(unittest.TestCase): + """DynamicTestLinksTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicTestLinksTestResults: + """Test DynamicTestLinksTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicTestLinksTestResults` + """ + model = DynamicTestLinksTestResults() + if include_optional: + return DynamicTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return DynamicTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testDynamicTestLinksTestResults(self): + """Test DynamicTestLinksTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_dynamic_test_request.py b/endpoint/tests_api/test/test_dynamic_test_request.py new file mode 100644 index 00000000..35e07498 --- /dev/null +++ b/endpoint/tests_api/test/test_dynamic_test_request.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.dynamic_test_request import DynamicTestRequest + +class TestDynamicTestRequest(unittest.TestCase): + """DynamicTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicTestRequest: + """Test DynamicTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicTestRequest` + """ + model = DynamicTestRequest() + if include_optional: + return DynamicTestRequest( + links = tests_api.models.dynamic_test_links.DynamicTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}], ), + agent_selector_config = tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + application = 'webex', + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + has_path_trace_in_session = True, + has_ping = True, + has_traceroute = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + protocol = 'icmp', + tcp_probe_mode = 'auto', + test_id = '281474976710706', + aid = None, + test_name = 'Test name', + agent_selector_type = 'all-agents', + agents = ["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"], + endpoint_agent_labels = ["567","214"], + max_machines = 250 + ) + else: + return DynamicTestRequest( + ) + """ + + def testDynamicTestRequest(self): + """Test DynamicTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_dynamic_tests.py b/endpoint/tests_api/test/test_dynamic_tests.py new file mode 100644 index 00000000..f5cf7f8f --- /dev/null +++ b/endpoint/tests_api/test/test_dynamic_tests.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.dynamic_tests import DynamicTests + +class TestDynamicTests(unittest.TestCase): + """DynamicTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamicTests: + """Test DynamicTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamicTests` + """ + model = DynamicTests() + if include_optional: + return DynamicTests( + tests = [ + tests_api.models.dynamic_test.DynamicTest( + _links = tests_api.models.dynamic_test_links.DynamicTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}], ), + agent_selector_config = tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + application = 'webex', + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + has_path_trace_in_session = null, + has_ping = True, + has_traceroute = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = null, + protocol = 'icmp', + tcp_probe_mode = null, + test_id = '281474976710706', + aid = null, + test_name = 'Test name', ) + ] + ) + else: + return DynamicTests( + ) + """ + + def testDynamicTests(self): + """Test DynamicTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_dynamic_tests_agent_to_server_api.py b/endpoint/tests_api/test/test_dynamic_tests_agent_to_server_api.py new file mode 100644 index 00000000..1eb12d7d --- /dev/null +++ b/endpoint/tests_api/test/test_dynamic_tests_agent_to_server_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest + +from tests_api.api.dynamic_tests_agent_to_server_api import DynamicTestsAgentToServerApi + + +class TestDynamicTestsAgentToServerApi(unittest.TestCase): + """DynamicTestsAgentToServerApi unit test stubs""" + + def setUp(self) -> None: + self.api = DynamicTestsAgentToServerApi() + + def tearDown(self) -> None: + pass + + def test_get_dynamic_test_detail(self) -> None: + """Test case for get_dynamic_test_detail + + Retrieve endpoint dynamic test + """ + pass + + def test_get_dynamic_tests_list(self) -> None: + """Test case for get_dynamic_tests_list + + List endpoint dynamic tests + """ + pass + + def test_post_dynamic_test(self) -> None: + """Test case for post_dynamic_test + + Create endpoint dynamic test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_agent_labels_selector_config.py b/endpoint/tests_api/test/test_endpoint_agent_labels_selector_config.py new file mode 100644 index 00000000..5009c5db --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_agent_labels_selector_config.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig + +class TestEndpointAgentLabelsSelectorConfig(unittest.TestCase): + """EndpointAgentLabelsSelectorConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentLabelsSelectorConfig: + """Test EndpointAgentLabelsSelectorConfig + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentLabelsSelectorConfig` + """ + model = EndpointAgentLabelsSelectorConfig() + if include_optional: + return EndpointAgentLabelsSelectorConfig( + agent_selector_type = 'agent-labels', + max_machines = 10, + endpoint_agent_labels = ["567","214"] + ) + else: + return EndpointAgentLabelsSelectorConfig( + ) + """ + + def testEndpointAgentLabelsSelectorConfig(self): + """Test EndpointAgentLabelsSelectorConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_agent_selector_config.py b/endpoint/tests_api/test/test_endpoint_agent_selector_config.py new file mode 100644 index 00000000..b897da84 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_agent_selector_config.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig + +class TestEndpointAgentSelectorConfig(unittest.TestCase): + """EndpointAgentSelectorConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentSelectorConfig: + """Test EndpointAgentSelectorConfig + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentSelectorConfig` + """ + model = EndpointAgentSelectorConfig() + if include_optional: + return EndpointAgentSelectorConfig( + agent_selector_type = 'specific-agents', + max_machines = 10, + endpoint_agent_labels = ["567","214"], + agents = ["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"] + ) + else: + return EndpointAgentSelectorConfig( + ) + """ + + def testEndpointAgentSelectorConfig(self): + """Test EndpointAgentSelectorConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_agent_to_server_instant_test.py b/endpoint/tests_api/test/test_endpoint_agent_to_server_instant_test.py new file mode 100644 index 00000000..e4287ade --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_agent_to_server_instant_test.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest + +class TestEndpointAgentToServerInstantTest(unittest.TestCase): + """EndpointAgentToServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentToServerInstantTest: + """Test EndpointAgentToServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentToServerInstantTest` + """ + model = EndpointAgentToServerInstantTest() + if include_optional: + return EndpointAgentToServerInstantTest( + agent_selector_type = 'all-agents', + agents = ["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"], + has_ping = True, + has_traceroute = True, + endpoint_agent_labels = ["567","214"], + max_machines = 10, + port = 80, + test_name = 'Test name', + server_name = 'www.example.com' + ) + else: + return EndpointAgentToServerInstantTest( + agent_selector_type = 'all-agents', + max_machines = 10, + test_name = 'Test name', + server_name = 'www.example.com', + ) + """ + + def testEndpointAgentToServerInstantTest(self): + """Test EndpointAgentToServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_agent_to_server_test.py b/endpoint/tests_api/test/test_endpoint_agent_to_server_test.py new file mode 100644 index 00000000..630b102c --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_agent_to_server_test.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest + +class TestEndpointAgentToServerTest(unittest.TestCase): + """EndpointAgentToServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentToServerTest: + """Test EndpointAgentToServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentToServerTest` + """ + model = EndpointAgentToServerTest() + if include_optional: + return EndpointAgentToServerTest( + links = tests_api.models.endpoint_test_links.EndpointTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}], ), + agent_selector_config = tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = None, + test_name = 'Test name', + type = 'agent-to-server' + ) + else: + return EndpointAgentToServerTest( + ) + """ + + def testEndpointAgentToServerTest(self): + """Test EndpointAgentToServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_agent_to_server_test_request.py b/endpoint/tests_api/test/test_endpoint_agent_to_server_test_request.py new file mode 100644 index 00000000..e2b62e72 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_agent_to_server_test_request.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_agent_to_server_test_request import EndpointAgentToServerTestRequest + +class TestEndpointAgentToServerTestRequest(unittest.TestCase): + """EndpointAgentToServerTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentToServerTestRequest: + """Test EndpointAgentToServerTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentToServerTestRequest` + """ + model = EndpointAgentToServerTestRequest() + if include_optional: + return EndpointAgentToServerTestRequest( + agent_selector_type = 'all-agents', + agents = ["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"], + has_ping = True, + has_traceroute = True, + endpoint_agent_labels = ["567","214"], + max_machines = 10, + port = 80, + test_name = 'Test name', + server_name = 'www.example.com', + interval = 120 + ) + else: + return EndpointAgentToServerTestRequest( + agent_selector_type = 'all-agents', + max_machines = 10, + test_name = 'Test name', + server_name = 'www.example.com', + interval = 120, + ) + """ + + def testEndpointAgentToServerTestRequest(self): + """Test EndpointAgentToServerTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_agent_to_server_tests.py b/endpoint/tests_api/test/test_endpoint_agent_to_server_tests.py new file mode 100644 index 00000000..a8d776a5 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_agent_to_server_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_agent_to_server_tests import EndpointAgentToServerTests + +class TestEndpointAgentToServerTests(unittest.TestCase): + """EndpointAgentToServerTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentToServerTests: + """Test EndpointAgentToServerTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentToServerTests` + """ + model = EndpointAgentToServerTests() + if include_optional: + return EndpointAgentToServerTests( + tests = [ + null + ] + ) + else: + return EndpointAgentToServerTests( + ) + """ + + def testEndpointAgentToServerTests(self): + """Test EndpointAgentToServerTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_agent_to_server_type.py b/endpoint/tests_api/test/test_endpoint_agent_to_server_type.py new file mode 100644 index 00000000..1582afa2 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_agent_to_server_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_agent_to_server_type import EndpointAgentToServerType + +class TestEndpointAgentToServerType(unittest.TestCase): + """EndpointAgentToServerType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointAgentToServerType(self): + """Test EndpointAgentToServerType""" + # inst = EndpointAgentToServerType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_all_agents_selector_config.py b/endpoint/tests_api/test/test_endpoint_all_agents_selector_config.py new file mode 100644 index 00000000..042649d9 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_all_agents_selector_config.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig + +class TestEndpointAllAgentsSelectorConfig(unittest.TestCase): + """EndpointAllAgentsSelectorConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAllAgentsSelectorConfig: + """Test EndpointAllAgentsSelectorConfig + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAllAgentsSelectorConfig` + """ + model = EndpointAllAgentsSelectorConfig() + if include_optional: + return EndpointAllAgentsSelectorConfig( + agent_selector_type = 'all-agents', + max_machines = 10 + ) + else: + return EndpointAllAgentsSelectorConfig( + ) + """ + + def testEndpointAllAgentsSelectorConfig(self): + """Test EndpointAllAgentsSelectorConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_http_server_base_test.py b/endpoint/tests_api/test/test_endpoint_http_server_base_test.py new file mode 100644 index 00000000..789bedb0 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_http_server_base_test.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_http_server_base_test import EndpointHttpServerBaseTest + +class TestEndpointHttpServerBaseTest(unittest.TestCase): + """EndpointHttpServerBaseTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointHttpServerBaseTest: + """Test EndpointHttpServerBaseTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointHttpServerBaseTest` + """ + model = EndpointHttpServerBaseTest() + if include_optional: + return EndpointHttpServerBaseTest( + auth_type = 'none', + has_path_trace_in_session = True, + http_time_limit = 5000, + protocol = 'icmp', + url = 'www.example.com', + username = 'username', + ssl_version_id = '0', + tcp_probe_mode = 'auto', + verify_certificate = False + ) + else: + return EndpointHttpServerBaseTest( + ) + """ + + def testEndpointHttpServerBaseTest(self): + """Test EndpointHttpServerBaseTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_http_server_instant_test.py b/endpoint/tests_api/test/test_endpoint_http_server_instant_test.py new file mode 100644 index 00000000..06de8cf4 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_http_server_instant_test.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest + +class TestEndpointHttpServerInstantTest(unittest.TestCase): + """EndpointHttpServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointHttpServerInstantTest: + """Test EndpointHttpServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointHttpServerInstantTest` + """ + model = EndpointHttpServerInstantTest() + if include_optional: + return EndpointHttpServerInstantTest( + agent_selector_type = 'all-agents', + agents = [0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1, 66eec0f1-72b4-4755-aa83-3aed61d17f3c], + has_ping = True, + has_traceroute = True, + endpoint_agent_labels = [567, 214], + max_machines = 10, + port = 80, + test_name = 'Test name', + auth_type = 'none', + has_path_trace_in_session = True, + http_time_limit = 5000, + protocol = 'icmp', + url = 'www.example.com', + username = 'username', + ssl_version_id = '0', + tcp_probe_mode = 'auto', + verify_certificate = False, + target_response_time = 1000, + password = 'password' + ) + else: + return EndpointHttpServerInstantTest( + agent_selector_type = 'all-agents', + max_machines = 10, + test_name = 'Test name', + http_time_limit = 5000, + url = 'www.example.com', + ssl_version_id = '0', + verify_certificate = False, + target_response_time = 1000, + ) + """ + + def testEndpointHttpServerInstantTest(self): + """Test EndpointHttpServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_http_server_test.py b/endpoint/tests_api/test/test_endpoint_http_server_test.py new file mode 100644 index 00000000..f6e67f64 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_http_server_test.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_http_server_test import EndpointHttpServerTest + +class TestEndpointHttpServerTest(unittest.TestCase): + """EndpointHttpServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointHttpServerTest: + """Test EndpointHttpServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointHttpServerTest` + """ + model = EndpointHttpServerTest() + if include_optional: + return EndpointHttpServerTest( + links = tests_api.models.endpoint_test_links.EndpointTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}], ), + agent_selector_config = tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = None, + test_name = 'Test name', + type = 'http-server', + auth_type = 'none', + http_time_limit = 5000, + url = 'www.example.com', + username = 'username', + ssl_version_id = '0', + tcp_probe_mode = 'auto', + verify_certificate = False, + content_regex = '(regex)+', + follow_redirects = True, + http_target_time = 100, + http_version = 1, + post_body = 'body', + ssl_version = 'Auto', + use_ntlm = False, + user_agent = 'curl' + ) + else: + return EndpointHttpServerTest( + ) + """ + + def testEndpointHttpServerTest(self): + """Test EndpointHttpServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_http_server_test_request.py b/endpoint/tests_api/test/test_endpoint_http_server_test_request.py new file mode 100644 index 00000000..a59ede30 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_http_server_test_request.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_http_server_test_request import EndpointHttpServerTestRequest + +class TestEndpointHttpServerTestRequest(unittest.TestCase): + """EndpointHttpServerTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointHttpServerTestRequest: + """Test EndpointHttpServerTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointHttpServerTestRequest` + """ + model = EndpointHttpServerTestRequest() + if include_optional: + return EndpointHttpServerTestRequest( + agent_selector_type = 'all-agents', + agents = [0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1, 66eec0f1-72b4-4755-aa83-3aed61d17f3c], + has_ping = True, + has_traceroute = True, + endpoint_agent_labels = [567, 214], + max_machines = 10, + port = 80, + test_name = 'Test name', + auth_type = 'none', + has_path_trace_in_session = True, + http_time_limit = 5000, + protocol = 'icmp', + url = 'www.example.com', + username = 'username', + ssl_version_id = '0', + tcp_probe_mode = 'auto', + verify_certificate = False, + target_response_time = 1000, + password = 'password', + interval = 120 + ) + else: + return EndpointHttpServerTestRequest( + agent_selector_type = 'all-agents', + max_machines = 10, + test_name = 'Test name', + http_time_limit = 5000, + url = 'www.example.com', + ssl_version_id = '0', + verify_certificate = False, + target_response_time = 1000, + interval = 120, + ) + """ + + def testEndpointHttpServerTestRequest(self): + """Test EndpointHttpServerTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_http_server_tests.py b/endpoint/tests_api/test/test_endpoint_http_server_tests.py new file mode 100644 index 00000000..c3eed5b9 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_http_server_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_http_server_tests import EndpointHttpServerTests + +class TestEndpointHttpServerTests(unittest.TestCase): + """EndpointHttpServerTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointHttpServerTests: + """Test EndpointHttpServerTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointHttpServerTests` + """ + model = EndpointHttpServerTests() + if include_optional: + return EndpointHttpServerTests( + tests = [ + null + ] + ) + else: + return EndpointHttpServerTests( + ) + """ + + def testEndpointHttpServerTests(self): + """Test EndpointHttpServerTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_http_server_type.py b/endpoint/tests_api/test/test_endpoint_http_server_type.py new file mode 100644 index 00000000..234274de --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_http_server_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_http_server_type import EndpointHttpServerType + +class TestEndpointHttpServerType(unittest.TestCase): + """EndpointHttpServerType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointHttpServerType(self): + """Test EndpointHttpServerType""" + # inst = EndpointHttpServerType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_instant_test.py b/endpoint/tests_api/test/test_endpoint_instant_test.py new file mode 100644 index 00000000..8f53277d --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_instant_test.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_instant_test import EndpointInstantTest + +class TestEndpointInstantTest(unittest.TestCase): + """EndpointInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointInstantTest: + """Test EndpointInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointInstantTest` + """ + model = EndpointInstantTest() + if include_optional: + return EndpointInstantTest( + agent_selector_type = 'all-agents', + agents = ["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"], + has_ping = True, + has_traceroute = True, + endpoint_agent_labels = ["567","214"], + max_machines = 10, + port = 80, + test_name = 'Test name' + ) + else: + return EndpointInstantTest( + agent_selector_type = 'all-agents', + max_machines = 10, + test_name = 'Test name', + ) + """ + + def testEndpointInstantTest(self): + """Test EndpointInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_scheduled_test_type.py b/endpoint/tests_api/test/test_endpoint_scheduled_test_type.py new file mode 100644 index 00000000..e8fcb7fd --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_scheduled_test_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_scheduled_test_type import EndpointScheduledTestType + +class TestEndpointScheduledTestType(unittest.TestCase): + """EndpointScheduledTestType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointScheduledTestType(self): + """Test EndpointScheduledTestType""" + # inst = EndpointScheduledTestType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_specific_agents_selector_config.py b/endpoint/tests_api/test/test_endpoint_specific_agents_selector_config.py new file mode 100644 index 00000000..0072eae4 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_specific_agents_selector_config.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig + +class TestEndpointSpecificAgentsSelectorConfig(unittest.TestCase): + """EndpointSpecificAgentsSelectorConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointSpecificAgentsSelectorConfig: + """Test EndpointSpecificAgentsSelectorConfig + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointSpecificAgentsSelectorConfig` + """ + model = EndpointSpecificAgentsSelectorConfig() + if include_optional: + return EndpointSpecificAgentsSelectorConfig( + agent_selector_type = 'specific-agents', + max_machines = 10, + agents = ["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"] + ) + else: + return EndpointSpecificAgentsSelectorConfig( + ) + """ + + def testEndpointSpecificAgentsSelectorConfig(self): + """Test EndpointSpecificAgentsSelectorConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_test.py b/endpoint/tests_api/test/test_endpoint_test.py new file mode 100644 index 00000000..4e9de434 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_test.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_test import EndpointTest + +class TestEndpointTest(unittest.TestCase): + """EndpointTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTest: + """Test EndpointTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTest` + """ + model = EndpointTest() + if include_optional: + return EndpointTest( + links = tests_api.models.endpoint_test_links.EndpointTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}], ), + agent_selector_config = tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = None, + test_name = 'Test name', + type = 'agent-to-server' + ) + else: + return EndpointTest( + ) + """ + + def testEndpointTest(self): + """Test EndpointTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_test_agent_selector_type.py b/endpoint/tests_api/test/test_endpoint_test_agent_selector_type.py new file mode 100644 index 00000000..7861989f --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_test_agent_selector_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType + +class TestEndpointTestAgentSelectorType(unittest.TestCase): + """EndpointTestAgentSelectorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointTestAgentSelectorType(self): + """Test EndpointTestAgentSelectorType""" + # inst = EndpointTestAgentSelectorType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_test_aid.py b/endpoint/tests_api/test/test_endpoint_test_aid.py new file mode 100644 index 00000000..42631a49 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_test_aid.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_test_aid import EndpointTestAid + +class TestEndpointTestAid(unittest.TestCase): + """EndpointTestAid unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTestAid: + """Test EndpointTestAid + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTestAid` + """ + model = EndpointTestAid() + if include_optional: + return EndpointTestAid( + aid = '11' + ) + else: + return EndpointTestAid( + ) + """ + + def testEndpointTestAid(self): + """Test EndpointTestAid""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_test_auth_type.py b/endpoint/tests_api/test/test_endpoint_test_auth_type.py new file mode 100644 index 00000000..59490f7e --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_test_auth_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_test_auth_type import EndpointTestAuthType + +class TestEndpointTestAuthType(unittest.TestCase): + """EndpointTestAuthType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointTestAuthType(self): + """Test EndpointTestAuthType""" + # inst = EndpointTestAuthType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_test_links.py b/endpoint/tests_api/test/test_endpoint_test_links.py new file mode 100644 index 00000000..2fc9f8e3 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_test_links.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_test_links import EndpointTestLinks + +class TestEndpointTestLinks(unittest.TestCase): + """EndpointTestLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTestLinks: + """Test EndpointTestLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTestLinks` + """ + model = EndpointTestLinks() + if include_optional: + return EndpointTestLinks( + var_self = None, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}] + ) + else: + return EndpointTestLinks( + ) + """ + + def testEndpointTestLinks(self): + """Test EndpointTestLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_test_links_self.py b/endpoint/tests_api/test/test_endpoint_test_links_self.py new file mode 100644 index 00000000..a676a512 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_test_links_self.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_test_links_self import EndpointTestLinksSelf + +class TestEndpointTestLinksSelf(unittest.TestCase): + """EndpointTestLinksSelf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTestLinksSelf: + """Test EndpointTestLinksSelf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTestLinksSelf` + """ + model = EndpointTestLinksSelf() + if include_optional: + return EndpointTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return EndpointTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testEndpointTestLinksSelf(self): + """Test EndpointTestLinksSelf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_test_links_test_results.py b/endpoint/tests_api/test/test_endpoint_test_links_test_results.py new file mode 100644 index 00000000..4d149584 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_test_links_test_results.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults + +class TestEndpointTestLinksTestResults(unittest.TestCase): + """EndpointTestLinksTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTestLinksTestResults: + """Test EndpointTestLinksTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTestLinksTestResults` + """ + model = EndpointTestLinksTestResults() + if include_optional: + return EndpointTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return EndpointTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testEndpointTestLinksTestResults(self): + """Test EndpointTestLinksTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_test_protocol.py b/endpoint/tests_api/test/test_endpoint_test_protocol.py new file mode 100644 index 00000000..2a178d36 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_test_protocol.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol + +class TestEndpointTestProtocol(unittest.TestCase): + """EndpointTestProtocol unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointTestProtocol(self): + """Test EndpointTestProtocol""" + # inst = EndpointTestProtocol() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_endpoint_tests.py b/endpoint/tests_api/test/test_endpoint_tests.py new file mode 100644 index 00000000..9264d059 --- /dev/null +++ b/endpoint/tests_api/test/test_endpoint_tests.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.endpoint_tests import EndpointTests + +class TestEndpointTests(unittest.TestCase): + """EndpointTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointTests: + """Test EndpointTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointTests` + """ + model = EndpointTests() + if include_optional: + return EndpointTests( + tests = [ + tests_api.models.endpoint_test.EndpointTest( + _links = tests_api.models.endpoint_test_links.EndpointTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}], ), + agent_selector_config = tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = null, + test_name = 'Test name', + type = 'agent-to-server', ) + ] + ) + else: + return EndpointTests( + ) + """ + + def testEndpointTests(self): + """Test EndpointTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_error.py b/endpoint/tests_api/test/test_error.py new file mode 100644 index 00000000..24240de1 --- /dev/null +++ b/endpoint/tests_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_get_dynamic_test_detail200_response.py b/endpoint/tests_api/test/test_get_dynamic_test_detail200_response.py new file mode 100644 index 00000000..21e6c019 --- /dev/null +++ b/endpoint/tests_api/test/test_get_dynamic_test_detail200_response.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.get_dynamic_test_detail200_response import GetDynamicTestDetail200Response + +class TestGetDynamicTestDetail200Response(unittest.TestCase): + """GetDynamicTestDetail200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDynamicTestDetail200Response: + """Test GetDynamicTestDetail200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetDynamicTestDetail200Response` + """ + model = GetDynamicTestDetail200Response() + if include_optional: + return GetDynamicTestDetail200Response( + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + agent_selector_config = tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + application = 'webex', + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + has_path_trace_in_session = True, + has_ping = True, + has_traceroute = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + protocol = 'icmp', + tcp_probe_mode = 'auto', + test_id = '281474976710706', + aid = None, + test_name = 'Test name' + ) + else: + return GetDynamicTestDetail200Response( + ) + """ + + def testGetDynamicTestDetail200Response(self): + """Test GetDynamicTestDetail200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_get_dynamic_tests_list200_response.py b/endpoint/tests_api/test/test_get_dynamic_tests_list200_response.py new file mode 100644 index 00000000..a400d093 --- /dev/null +++ b/endpoint/tests_api/test/test_get_dynamic_tests_list200_response.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.get_dynamic_tests_list200_response import GetDynamicTestsList200Response + +class TestGetDynamicTestsList200Response(unittest.TestCase): + """GetDynamicTestsList200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDynamicTestsList200Response: + """Test GetDynamicTestsList200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetDynamicTestsList200Response` + """ + model = GetDynamicTestsList200Response() + if include_optional: + return GetDynamicTestsList200Response( + tests = [ + tests_api.models.dynamic_test.DynamicTest( + _links = tests_api.models.dynamic_test_links.DynamicTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}], ), + agent_selector_config = tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + application = 'webex', + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + has_path_trace_in_session = null, + has_ping = True, + has_traceroute = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = null, + protocol = 'icmp', + tcp_probe_mode = null, + test_id = '281474976710706', + aid = null, + test_name = 'Test name', ) + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetDynamicTestsList200Response( + ) + """ + + def testGetDynamicTestsList200Response(self): + """Test GetDynamicTestsList200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_get_endpoint_agent_toserver_tests_list200_response.py b/endpoint/tests_api/test/test_get_endpoint_agent_toserver_tests_list200_response.py new file mode 100644 index 00000000..948e3862 --- /dev/null +++ b/endpoint/tests_api/test/test_get_endpoint_agent_toserver_tests_list200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.get_endpoint_agent_toserver_tests_list200_response import GetEndpointAgentToserverTestsList200Response + +class TestGetEndpointAgentToserverTestsList200Response(unittest.TestCase): + """GetEndpointAgentToserverTestsList200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointAgentToserverTestsList200Response: + """Test GetEndpointAgentToserverTestsList200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointAgentToserverTestsList200Response` + """ + model = GetEndpointAgentToserverTestsList200Response() + if include_optional: + return GetEndpointAgentToserverTestsList200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetEndpointAgentToserverTestsList200Response( + ) + """ + + def testGetEndpointAgentToserverTestsList200Response(self): + """Test GetEndpointAgentToserverTestsList200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_get_endpoint_httpserver_test_detail200_response.py b/endpoint/tests_api/test/test_get_endpoint_httpserver_test_detail200_response.py new file mode 100644 index 00000000..f25cdd29 --- /dev/null +++ b/endpoint/tests_api/test/test_get_endpoint_httpserver_test_detail200_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.get_endpoint_httpserver_test_detail200_response import GetEndpointHttpserverTestDetail200Response + +class TestGetEndpointHttpserverTestDetail200Response(unittest.TestCase): + """GetEndpointHttpserverTestDetail200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointHttpserverTestDetail200Response: + """Test GetEndpointHttpserverTestDetail200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointHttpserverTestDetail200Response` + """ + model = GetEndpointHttpserverTestDetail200Response() + if include_optional: + return GetEndpointHttpserverTestDetail200Response( + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + agent_selector_config = tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = None, + test_name = 'Test name', + type = 'http-server', + auth_type = 'none', + http_time_limit = 5000, + url = 'www.example.com', + username = 'username', + ssl_version_id = '0', + tcp_probe_mode = 'auto', + verify_certificate = False, + content_regex = '(regex)+', + follow_redirects = True, + http_target_time = 100, + http_version = 1, + post_body = 'body', + ssl_version = 'Auto', + use_ntlm = False, + user_agent = 'curl' + ) + else: + return GetEndpointHttpserverTestDetail200Response( + ) + """ + + def testGetEndpointHttpserverTestDetail200Response(self): + """Test GetEndpointHttpserverTestDetail200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_get_endpoint_httpserver_tests_list200_response.py b/endpoint/tests_api/test/test_get_endpoint_httpserver_tests_list200_response.py new file mode 100644 index 00000000..537549ac --- /dev/null +++ b/endpoint/tests_api/test/test_get_endpoint_httpserver_tests_list200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.get_endpoint_httpserver_tests_list200_response import GetEndpointHttpserverTestsList200Response + +class TestGetEndpointHttpserverTestsList200Response(unittest.TestCase): + """GetEndpointHttpserverTestsList200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointHttpserverTestsList200Response: + """Test GetEndpointHttpserverTestsList200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointHttpserverTestsList200Response` + """ + model = GetEndpointHttpserverTestsList200Response() + if include_optional: + return GetEndpointHttpserverTestsList200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetEndpointHttpserverTestsList200Response( + ) + """ + + def testGetEndpointHttpserverTestsList200Response(self): + """Test GetEndpointHttpserverTestsList200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_get_endpoint_tests_list200_response.py b/endpoint/tests_api/test/test_get_endpoint_tests_list200_response.py new file mode 100644 index 00000000..48db68e6 --- /dev/null +++ b/endpoint/tests_api/test/test_get_endpoint_tests_list200_response.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.get_endpoint_tests_list200_response import GetEndpointTestsList200Response + +class TestGetEndpointTestsList200Response(unittest.TestCase): + """GetEndpointTestsList200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetEndpointTestsList200Response: + """Test GetEndpointTestsList200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetEndpointTestsList200Response` + """ + model = GetEndpointTestsList200Response() + if include_optional: + return GetEndpointTestsList200Response( + tests = [ + tests_api.models.endpoint_test.EndpointTest( + _links = tests_api.models.endpoint_test_links.EndpointTestLinks( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"}], ), + agent_selector_config = tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = null, + test_name = 'Test name', + type = 'agent-to-server', ) + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetEndpointTestsList200Response( + ) + """ + + def testGetEndpointTestsList200Response(self): + """Test GetEndpointTestsList200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_link.py b/endpoint/tests_api/test/test_link.py new file mode 100644 index 00000000..32283cee --- /dev/null +++ b/endpoint/tests_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_list_endpoint_scheduled_tests_api.py b/endpoint/tests_api/test/test_list_endpoint_scheduled_tests_api.py new file mode 100644 index 00000000..50ff1c66 --- /dev/null +++ b/endpoint/tests_api/test/test_list_endpoint_scheduled_tests_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest + +from tests_api.api.list_endpoint_scheduled_tests_api import ListEndpointScheduledTestsApi + + +class TestListEndpointScheduledTestsApi(unittest.TestCase): + """ListEndpointScheduledTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = ListEndpointScheduledTestsApi() + + def tearDown(self) -> None: + pass + + def test_get_endpoint_tests_list(self) -> None: + """Test case for get_endpoint_tests_list + + List endpoint scheduled tests + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_post_endpoint_agent_to_server_test201_response.py b/endpoint/tests_api/test/test_post_endpoint_agent_to_server_test201_response.py new file mode 100644 index 00000000..9b9f2c64 --- /dev/null +++ b/endpoint/tests_api/test/test_post_endpoint_agent_to_server_test201_response.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.post_endpoint_agent_to_server_test201_response import PostEndpointAgentToServerTest201Response + +class TestPostEndpointAgentToServerTest201Response(unittest.TestCase): + """PostEndpointAgentToServerTest201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PostEndpointAgentToServerTest201Response: + """Test PostEndpointAgentToServerTest201Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PostEndpointAgentToServerTest201Response` + """ + model = PostEndpointAgentToServerTest201Response() + if include_optional: + return PostEndpointAgentToServerTest201Response( + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + agent_selector_config = tests_api.models.endpoint_agent_selector_config.EndpointAgentSelectorConfig(), + created_date = '2022-07-17T22:00:54Z', + interval = 120, + is_enabled = True, + is_saved_event = False, + has_path_trace_in_session = True, + modified_date = '2022-07-17T22:00:54Z', + network_measurements = True, + port = 80, + protocol = 'icmp', + server = 'www.example.com', + test_id = '281474976710706', + aid = None, + test_name = 'Test name', + type = 'agent-to-server' + ) + else: + return PostEndpointAgentToServerTest201Response( + ) + """ + + def testPostEndpointAgentToServerTest201Response(self): + """Test PostEndpointAgentToServerTest201Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_scheduled_tests_agent_to_server_api.py b/endpoint/tests_api/test/test_scheduled_tests_agent_to_server_api.py new file mode 100644 index 00000000..a0d33bbb --- /dev/null +++ b/endpoint/tests_api/test/test_scheduled_tests_agent_to_server_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest + +from tests_api.api.scheduled_tests_agent_to_server_api import ScheduledTestsAgentToServerApi + + +class TestScheduledTestsAgentToServerApi(unittest.TestCase): + """ScheduledTestsAgentToServerApi unit test stubs""" + + def setUp(self) -> None: + self.api = ScheduledTestsAgentToServerApi() + + def tearDown(self) -> None: + pass + + def test_get_endpoint_agent_to_server_detail(self) -> None: + """Test case for get_endpoint_agent_to_server_detail + + Retrieve agent to server endpoint scheduled test + """ + pass + + def test_get_endpoint_agent_toserver_tests_list(self) -> None: + """Test case for get_endpoint_agent_toserver_tests_list + + List agent to server endpoint scheduled tests + """ + pass + + def test_post_endpoint_agent_to_server_test(self) -> None: + """Test case for post_endpoint_agent_to_server_test + + Creates agent to server endpoint scheduled test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_scheduled_tests_http_server_api.py b/endpoint/tests_api/test/test_scheduled_tests_http_server_api.py new file mode 100644 index 00000000..ff605784 --- /dev/null +++ b/endpoint/tests_api/test/test_scheduled_tests_http_server_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest + +from tests_api.api.scheduled_tests_http_server_api import ScheduledTestsHTTPServerApi + + +class TestScheduledTestsHTTPServerApi(unittest.TestCase): + """ScheduledTestsHTTPServerApi unit test stubs""" + + def setUp(self) -> None: + self.api = ScheduledTestsHTTPServerApi() + + def tearDown(self) -> None: + pass + + def test_get_endpoint_httpserver_test_detail(self) -> None: + """Test case for get_endpoint_httpserver_test_detail + + Retrieves HTTP server endpoint scheduled test + """ + pass + + def test_get_endpoint_httpserver_tests_list(self) -> None: + """Test case for get_endpoint_httpserver_tests_list + + List HTTP server endpoint scheduled tests + """ + pass + + def test_post_endpoint_httpserver_test(self) -> None: + """Test case for post_endpoint_httpserver_test + + Create HTTP server endpoint scheduled test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_self_links.py b/endpoint/tests_api/test/test_self_links.py new file mode 100644 index 00000000..3c1e151a --- /dev/null +++ b/endpoint/tests_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_self_links_links.py b/endpoint/tests_api/test/test_self_links_links.py new file mode 100644 index 00000000..62ce610b --- /dev/null +++ b/endpoint/tests_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_specific_agents_selector_type.py b/endpoint/tests_api/test/test_specific_agents_selector_type.py new file mode 100644 index 00000000..b45656f9 --- /dev/null +++ b/endpoint/tests_api/test/test_specific_agents_selector_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.specific_agents_selector_type import SpecificAgentsSelectorType + +class TestSpecificAgentsSelectorType(unittest.TestCase): + """SpecificAgentsSelectorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSpecificAgentsSelectorType(self): + """Test SpecificAgentsSelectorType""" + # inst = SpecificAgentsSelectorType() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_test_interval.py b/endpoint/tests_api/test/test_test_interval.py new file mode 100644 index 00000000..3303c0dc --- /dev/null +++ b/endpoint/tests_api/test/test_test_interval.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.test_interval import TestInterval + +class TestTestInterval(unittest.TestCase): + """TestInterval unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestInterval(self): + """Test TestInterval""" + # inst = TestInterval() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_test_probe_mode.py b/endpoint/tests_api/test/test_test_probe_mode.py new file mode 100644 index 00000000..07bf29f3 --- /dev/null +++ b/endpoint/tests_api/test/test_test_probe_mode.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.test_probe_mode import TestProbeMode + +class TestTestProbeMode(unittest.TestCase): + """TestProbeMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestProbeMode(self): + """Test TestProbeMode""" + # inst = TestProbeMode() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_test_ssl_version_id.py b/endpoint/tests_api/test/test_test_ssl_version_id.py new file mode 100644 index 00000000..685a1da4 --- /dev/null +++ b/endpoint/tests_api/test/test_test_ssl_version_id.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.test_ssl_version_id import TestSslVersionId + +class TestTestSslVersionId(unittest.TestCase): + """TestSslVersionId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestSslVersionId(self): + """Test TestSslVersionId""" + # inst = TestSslVersionId() + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/test/test_unauthorized_error.py b/endpoint/tests_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..66add604 --- /dev/null +++ b/endpoint/tests_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 unittest +import datetime + +from tests_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/endpoint/tests_api/tests_api/__init__.py b/endpoint/tests_api/tests_api/__init__.py new file mode 100644 index 00000000..5f430f1e --- /dev/null +++ b/endpoint/tests_api/tests_api/__init__.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.api.dynamic_tests_agent_to_server_api import DynamicTestsAgentToServerApi +from tests_api.api.list_endpoint_scheduled_tests_api import ListEndpointScheduledTestsApi +from tests_api.api.scheduled_tests_agent_to_server_api import ScheduledTestsAgentToServerApi +from tests_api.api.scheduled_tests_http_server_api import ScheduledTestsHTTPServerApi + +# import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.api_client import ApiClient +from tests_api.configuration import Configuration +from tests_api.exceptions import OpenApiException +from tests_api.exceptions import ApiTypeError +from tests_api.exceptions import ApiValueError +from tests_api.exceptions import ApiKeyError +from tests_api.exceptions import ApiAttributeError +from tests_api.exceptions import ApiException + +# import models into sdk package +from tests_api.models.account_group_id import AccountGroupId +from tests_api.models.agent_labels_selector_type import AgentLabelsSelectorType +from tests_api.models.all_agents_selector_type import AllAgentsSelectorType +from tests_api.models.dynamic_test import DynamicTest +from tests_api.models.dynamic_test_application import DynamicTestApplication +from tests_api.models.dynamic_test_links import DynamicTestLinks +from tests_api.models.dynamic_test_links_self import DynamicTestLinksSelf +from tests_api.models.dynamic_test_links_test_results import DynamicTestLinksTestResults +from tests_api.models.dynamic_test_request import DynamicTestRequest +from tests_api.models.dynamic_tests import DynamicTests +from tests_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig +from tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from tests_api.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest +from tests_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from tests_api.models.endpoint_agent_to_server_test_request import EndpointAgentToServerTestRequest +from tests_api.models.endpoint_agent_to_server_tests import EndpointAgentToServerTests +from tests_api.models.endpoint_agent_to_server_type import EndpointAgentToServerType +from tests_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig +from tests_api.models.endpoint_http_server_base_test import EndpointHttpServerBaseTest +from tests_api.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest +from tests_api.models.endpoint_http_server_test import EndpointHttpServerTest +from tests_api.models.endpoint_http_server_test_request import EndpointHttpServerTestRequest +from tests_api.models.endpoint_http_server_tests import EndpointHttpServerTests +from tests_api.models.endpoint_http_server_type import EndpointHttpServerType +from tests_api.models.endpoint_instant_test import EndpointInstantTest +from tests_api.models.endpoint_scheduled_test_type import EndpointScheduledTestType +from tests_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig +from tests_api.models.endpoint_test import EndpointTest +from tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType +from tests_api.models.endpoint_test_aid import EndpointTestAid +from tests_api.models.endpoint_test_auth_type import EndpointTestAuthType +from tests_api.models.endpoint_test_links import EndpointTestLinks +from tests_api.models.endpoint_test_links_self import EndpointTestLinksSelf +from tests_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from tests_api.models.endpoint_tests import EndpointTests +from tests_api.models.error import Error +from tests_api.models.get_dynamic_test_detail200_response import GetDynamicTestDetail200Response +from tests_api.models.get_dynamic_tests_list200_response import GetDynamicTestsList200Response +from tests_api.models.get_endpoint_agent_toserver_tests_list200_response import GetEndpointAgentToserverTestsList200Response +from tests_api.models.get_endpoint_httpserver_test_detail200_response import GetEndpointHttpserverTestDetail200Response +from tests_api.models.get_endpoint_httpserver_tests_list200_response import GetEndpointHttpserverTestsList200Response +from tests_api.models.get_endpoint_tests_list200_response import GetEndpointTestsList200Response +from tests_api.models.link import Link +from tests_api.models.post_endpoint_agent_to_server_test201_response import PostEndpointAgentToServerTest201Response +from tests_api.models.self_links import SelfLinks +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.specific_agents_selector_type import SpecificAgentsSelectorType +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.unauthorized_error import UnauthorizedError diff --git a/endpoint/tests_api/tests_api/api/__init__.py b/endpoint/tests_api/tests_api/api/__init__.py new file mode 100644 index 00000000..39bfb477 --- /dev/null +++ b/endpoint/tests_api/tests_api/api/__init__.py @@ -0,0 +1,8 @@ +# flake8: noqa + +# import apis into api package +from tests_api.api.dynamic_tests_agent_to_server_api import DynamicTestsAgentToServerApi +from tests_api.api.list_endpoint_scheduled_tests_api import ListEndpointScheduledTestsApi +from tests_api.api.scheduled_tests_agent_to_server_api import ScheduledTestsAgentToServerApi +from tests_api.api.scheduled_tests_http_server_api import ScheduledTestsHTTPServerApi + diff --git a/endpoint/tests_api/tests_api/api/dynamic_tests_agent_to_server_api.py b/endpoint/tests_api/tests_api/api/dynamic_tests_agent_to_server_api.py new file mode 100644 index 00000000..df76aebf --- /dev/null +++ b/endpoint/tests_api/tests_api/api/dynamic_tests_agent_to_server_api.py @@ -0,0 +1,953 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.dynamic_test import DynamicTest +from tests_api.models.dynamic_test_request import DynamicTestRequest +from tests_api.models.get_dynamic_test_detail200_response import GetDynamicTestDetail200Response +from tests_api.models.get_dynamic_tests_list200_response import GetDynamicTestsList200Response + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class DynamicTestsAgentToServerApi: + """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_dynamic_test_detail( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + 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, + ) -> GetDynamicTestDetail200Response: + """Retrieve endpoint dynamic test + + Returns details of an endpoint dynamic test, including test type, name, intervals, targets. + + :param test_id: Unique ID of endpoint test. (required) + :type test_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_dynamic_test_detail_serialize( + test_id=test_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': "GetDynamicTestDetail200Response", + '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_dynamic_test_detail_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + 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[GetDynamicTestDetail200Response]: + """Retrieve endpoint dynamic test + + Returns details of an endpoint dynamic test, including test type, name, intervals, targets. + + :param test_id: Unique ID of endpoint test. (required) + :type test_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_dynamic_test_detail_serialize( + test_id=test_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': "GetDynamicTestDetail200Response", + '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_dynamic_test_detail_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + 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 endpoint dynamic test + + Returns details of an endpoint dynamic test, including test type, name, intervals, targets. + + :param test_id: Unique ID of endpoint test. (required) + :type test_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_dynamic_test_detail_serialize( + test_id=test_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': "GetDynamicTestDetail200Response", + '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_dynamic_test_detail_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/endpoint/tests/dynamic-tests/agent-to-server/{testId}', + 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_dynamic_tests_list( + 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, + ) -> GetDynamicTestsList200Response: + """List endpoint dynamic tests + + Returns a list of all endpoint dynamic tests configured in ThousandEyes. This list does not contain saved events. + + :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_dynamic_tests_list_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': "GetDynamicTestsList200Response", + '401': "UnauthorizedError", + '403': "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_dynamic_tests_list_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[GetDynamicTestsList200Response]: + """List endpoint dynamic tests + + Returns a list of all endpoint dynamic tests configured in ThousandEyes. This list does not contain saved events. + + :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_dynamic_tests_list_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': "GetDynamicTestsList200Response", + '401': "UnauthorizedError", + '403': "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_dynamic_tests_list_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 endpoint dynamic tests + + Returns a list of all endpoint dynamic tests configured in ThousandEyes. This list does not contain saved events. + + :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_dynamic_tests_list_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': "GetDynamicTestsList200Response", + '401': "UnauthorizedError", + '403': "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_dynamic_tests_list_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/endpoint/tests/dynamic-tests/agent-to-server', + 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 post_dynamic_test( + self, + dynamic_test_request: DynamicTestRequest, + 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, + ) -> DynamicTest: + """Create endpoint dynamic test + + Create a new endpoint dynamic test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param dynamic_test_request: (required) + :type dynamic_test_request: DynamicTestRequest + :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._post_dynamic_test_serialize( + dynamic_test_request=dynamic_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DynamicTest", + '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 post_dynamic_test_with_http_info( + self, + dynamic_test_request: DynamicTestRequest, + 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[DynamicTest]: + """Create endpoint dynamic test + + Create a new endpoint dynamic test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param dynamic_test_request: (required) + :type dynamic_test_request: DynamicTestRequest + :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._post_dynamic_test_serialize( + dynamic_test_request=dynamic_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DynamicTest", + '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 post_dynamic_test_without_preload_content( + self, + dynamic_test_request: DynamicTestRequest, + 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: + """Create endpoint dynamic test + + Create a new endpoint dynamic test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param dynamic_test_request: (required) + :type dynamic_test_request: DynamicTestRequest + :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._post_dynamic_test_serialize( + dynamic_test_request=dynamic_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DynamicTest", + '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 _post_dynamic_test_serialize( + self, + dynamic_test_request, + 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 + if dynamic_test_request is not None: + _body_params = dynamic_test_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/endpoint/tests/dynamic-tests/agent-to-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/tests_api/tests_api/api/list_endpoint_scheduled_tests_api.py b/endpoint/tests_api/tests_api/api/list_endpoint_scheduled_tests_api.py new file mode 100644 index 00000000..ce13bb4a --- /dev/null +++ b/endpoint/tests_api/tests_api/api/list_endpoint_scheduled_tests_api.py @@ -0,0 +1,332 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.get_endpoint_tests_list200_response import GetEndpointTestsList200Response + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class ListEndpointScheduledTestsApi: + """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_endpoint_tests_list( + 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, + ) -> GetEndpointTestsList200Response: + """List endpoint scheduled tests + + Returns a list of all endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :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_endpoint_tests_list_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': "GetEndpointTestsList200Response", + '401': "UnauthorizedError", + '403': "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_endpoint_tests_list_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[GetEndpointTestsList200Response]: + """List endpoint scheduled tests + + Returns a list of all endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :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_endpoint_tests_list_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': "GetEndpointTestsList200Response", + '401': "UnauthorizedError", + '403': "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_endpoint_tests_list_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 endpoint scheduled tests + + Returns a list of all endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :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_endpoint_tests_list_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': "GetEndpointTestsList200Response", + '401': "UnauthorizedError", + '403': "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_endpoint_tests_list_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/endpoint/tests/scheduled-tests', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/tests_api/tests_api/api/scheduled_tests_agent_to_server_api.py b/endpoint/tests_api/tests_api/api/scheduled_tests_agent_to_server_api.py new file mode 100644 index 00000000..01217b45 --- /dev/null +++ b/endpoint/tests_api/tests_api/api/scheduled_tests_agent_to_server_api.py @@ -0,0 +1,952 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.endpoint_agent_to_server_test_request import EndpointAgentToServerTestRequest +from tests_api.models.get_endpoint_agent_toserver_tests_list200_response import GetEndpointAgentToserverTestsList200Response +from tests_api.models.post_endpoint_agent_to_server_test201_response import PostEndpointAgentToServerTest201Response + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class ScheduledTestsAgentToServerApi: + """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_endpoint_agent_to_server_detail( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + 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, + ) -> PostEndpointAgentToServerTest201Response: + """Retrieve agent to server endpoint scheduled test + + Retrieves details of an agent to server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_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_endpoint_agent_to_server_detail_serialize( + test_id=test_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': "PostEndpointAgentToServerTest201Response", + '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_endpoint_agent_to_server_detail_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + 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[PostEndpointAgentToServerTest201Response]: + """Retrieve agent to server endpoint scheduled test + + Retrieves details of an agent to server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_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_endpoint_agent_to_server_detail_serialize( + test_id=test_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': "PostEndpointAgentToServerTest201Response", + '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_endpoint_agent_to_server_detail_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + 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 to server endpoint scheduled test + + Retrieves details of an agent to server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_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_endpoint_agent_to_server_detail_serialize( + test_id=test_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': "PostEndpointAgentToServerTest201Response", + '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_endpoint_agent_to_server_detail_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/endpoint/tests/scheduled-tests/agent-to-server/{testId}', + 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_endpoint_agent_toserver_tests_list( + 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, + ) -> GetEndpointAgentToserverTestsList200Response: + """List agent to server endpoint scheduled tests + + Returns a list of all agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :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_endpoint_agent_toserver_tests_list_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': "GetEndpointAgentToserverTestsList200Response", + '401': "UnauthorizedError", + '403': "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_endpoint_agent_toserver_tests_list_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[GetEndpointAgentToserverTestsList200Response]: + """List agent to server endpoint scheduled tests + + Returns a list of all agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :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_endpoint_agent_toserver_tests_list_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': "GetEndpointAgentToserverTestsList200Response", + '401': "UnauthorizedError", + '403': "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_endpoint_agent_toserver_tests_list_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 to server endpoint scheduled tests + + Returns a list of all agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :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_endpoint_agent_toserver_tests_list_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': "GetEndpointAgentToserverTestsList200Response", + '401': "UnauthorizedError", + '403': "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_endpoint_agent_toserver_tests_list_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/endpoint/tests/scheduled-tests/agent-to-server', + 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 post_endpoint_agent_to_server_test( + self, + endpoint_agent_to_server_test_request: EndpointAgentToServerTestRequest, + 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, + ) -> PostEndpointAgentToServerTest201Response: + """Creates agent to server endpoint scheduled test + + Creates a new endpoint test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param endpoint_agent_to_server_test_request: (required) + :type endpoint_agent_to_server_test_request: EndpointAgentToServerTestRequest + :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._post_endpoint_agent_to_server_test_serialize( + endpoint_agent_to_server_test_request=endpoint_agent_to_server_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PostEndpointAgentToServerTest201Response", + '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 post_endpoint_agent_to_server_test_with_http_info( + self, + endpoint_agent_to_server_test_request: EndpointAgentToServerTestRequest, + 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[PostEndpointAgentToServerTest201Response]: + """Creates agent to server endpoint scheduled test + + Creates a new endpoint test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param endpoint_agent_to_server_test_request: (required) + :type endpoint_agent_to_server_test_request: EndpointAgentToServerTestRequest + :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._post_endpoint_agent_to_server_test_serialize( + endpoint_agent_to_server_test_request=endpoint_agent_to_server_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PostEndpointAgentToServerTest201Response", + '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 post_endpoint_agent_to_server_test_without_preload_content( + self, + endpoint_agent_to_server_test_request: EndpointAgentToServerTestRequest, + 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: + """Creates agent to server endpoint scheduled test + + Creates a new endpoint test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param endpoint_agent_to_server_test_request: (required) + :type endpoint_agent_to_server_test_request: EndpointAgentToServerTestRequest + :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._post_endpoint_agent_to_server_test_serialize( + endpoint_agent_to_server_test_request=endpoint_agent_to_server_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PostEndpointAgentToServerTest201Response", + '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 _post_endpoint_agent_to_server_test_serialize( + self, + endpoint_agent_to_server_test_request, + 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 + if endpoint_agent_to_server_test_request is not None: + _body_params = endpoint_agent_to_server_test_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/endpoint/tests/scheduled-tests/agent-to-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/tests_api/tests_api/api/scheduled_tests_http_server_api.py b/endpoint/tests_api/tests_api/api/scheduled_tests_http_server_api.py new file mode 100644 index 00000000..7d58d926 --- /dev/null +++ b/endpoint/tests_api/tests_api/api/scheduled_tests_http_server_api.py @@ -0,0 +1,953 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.endpoint_http_server_test import EndpointHttpServerTest +from tests_api.models.endpoint_http_server_test_request import EndpointHttpServerTestRequest +from tests_api.models.get_endpoint_httpserver_test_detail200_response import GetEndpointHttpserverTestDetail200Response +from tests_api.models.get_endpoint_httpserver_tests_list200_response import GetEndpointHttpserverTestsList200Response + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class ScheduledTestsHTTPServerApi: + """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_endpoint_httpserver_test_detail( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + 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, + ) -> GetEndpointHttpserverTestDetail200Response: + """Retrieves HTTP server endpoint scheduled test + + Retrieves details of an HTTP Server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_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_endpoint_httpserver_test_detail_serialize( + test_id=test_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': "GetEndpointHttpserverTestDetail200Response", + '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_endpoint_httpserver_test_detail_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + 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[GetEndpointHttpserverTestDetail200Response]: + """Retrieves HTTP server endpoint scheduled test + + Retrieves details of an HTTP Server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_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_endpoint_httpserver_test_detail_serialize( + test_id=test_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': "GetEndpointHttpserverTestDetail200Response", + '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_endpoint_httpserver_test_detail_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + 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: + """Retrieves HTTP server endpoint scheduled test + + Retrieves details of an HTTP Server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_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_endpoint_httpserver_test_detail_serialize( + test_id=test_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': "GetEndpointHttpserverTestDetail200Response", + '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_endpoint_httpserver_test_detail_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/endpoint/tests/scheduled-tests/http-server/{testId}', + 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_endpoint_httpserver_tests_list( + 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, + ) -> GetEndpointHttpserverTestsList200Response: + """List HTTP server endpoint scheduled tests + + Returns a list of agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :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_endpoint_httpserver_tests_list_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': "GetEndpointHttpserverTestsList200Response", + '401': "UnauthorizedError", + '403': "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_endpoint_httpserver_tests_list_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[GetEndpointHttpserverTestsList200Response]: + """List HTTP server endpoint scheduled tests + + Returns a list of agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :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_endpoint_httpserver_tests_list_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': "GetEndpointHttpserverTestsList200Response", + '401': "UnauthorizedError", + '403': "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_endpoint_httpserver_tests_list_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 HTTP server endpoint scheduled tests + + Returns a list of agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :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_endpoint_httpserver_tests_list_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': "GetEndpointHttpserverTestsList200Response", + '401': "UnauthorizedError", + '403': "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_endpoint_httpserver_tests_list_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/endpoint/tests/scheduled-tests/http-server', + 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 post_endpoint_httpserver_test( + self, + endpoint_http_server_test_request: EndpointHttpServerTestRequest, + 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, + ) -> EndpointHttpServerTest: + """Create HTTP server endpoint scheduled test + + Creates a new HTTP server endpoint test in ThousandEyes, using properties specified in the POST data. Please note that only users with Account Admin privileges have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param endpoint_http_server_test_request: (required) + :type endpoint_http_server_test_request: EndpointHttpServerTestRequest + :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._post_endpoint_httpserver_test_serialize( + endpoint_http_server_test_request=endpoint_http_server_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointHttpServerTest", + '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 post_endpoint_httpserver_test_with_http_info( + self, + endpoint_http_server_test_request: EndpointHttpServerTestRequest, + 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[EndpointHttpServerTest]: + """Create HTTP server endpoint scheduled test + + Creates a new HTTP server endpoint test in ThousandEyes, using properties specified in the POST data. Please note that only users with Account Admin privileges have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param endpoint_http_server_test_request: (required) + :type endpoint_http_server_test_request: EndpointHttpServerTestRequest + :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._post_endpoint_httpserver_test_serialize( + endpoint_http_server_test_request=endpoint_http_server_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointHttpServerTest", + '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 post_endpoint_httpserver_test_without_preload_content( + self, + endpoint_http_server_test_request: EndpointHttpServerTestRequest, + 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: + """Create HTTP server endpoint scheduled test + + Creates a new HTTP server endpoint test in ThousandEyes, using properties specified in the POST data. Please note that only users with Account Admin privileges have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param endpoint_http_server_test_request: (required) + :type endpoint_http_server_test_request: EndpointHttpServerTestRequest + :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._post_endpoint_httpserver_test_serialize( + endpoint_http_server_test_request=endpoint_http_server_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointHttpServerTest", + '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 _post_endpoint_httpserver_test_serialize( + self, + endpoint_http_server_test_request, + 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 + if endpoint_http_server_test_request is not None: + _body_params = endpoint_http_server_test_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/endpoint/tests/scheduled-tests/http-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/endpoint/tests_api/tests_api/api_client.py b/endpoint/tests_api/tests_api/api_client.py new file mode 100644 index 00000000..fee02b42 --- /dev/null +++ b/endpoint/tests_api/tests_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.configuration import Configuration +from tests_api.api_response import ApiResponse +import tests_api.models +from tests_api import rest +from tests_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(tests_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) diff --git a/endpoint/tests_api/tests_api/api_response.py b/endpoint/tests_api/tests_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/endpoint/tests_api/tests_api/api_response.py @@ -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 + } diff --git a/endpoint/tests_api/tests_api/configuration.py b/endpoint/tests_api/tests_api/configuration.py new file mode 100644 index 00000000..70c281af --- /dev/null +++ b/endpoint/tests_api/tests_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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("tests_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 diff --git a/endpoint/tests_api/tests_api/exceptions.py b/endpoint/tests_api/tests_api/exceptions.py new file mode 100644 index 00000000..e91072bd --- /dev/null +++ b/endpoint/tests_api/tests_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 diff --git a/endpoint/tests_api/tests_api/models/__init__.py b/endpoint/tests_api/tests_api/models/__init__.py new file mode 100644 index 00000000..812057b0 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/__init__.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +# flake8: noqa +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.account_group_id import AccountGroupId +from tests_api.models.agent_labels_selector_type import AgentLabelsSelectorType +from tests_api.models.all_agents_selector_type import AllAgentsSelectorType +from tests_api.models.dynamic_test import DynamicTest +from tests_api.models.dynamic_test_application import DynamicTestApplication +from tests_api.models.dynamic_test_links import DynamicTestLinks +from tests_api.models.dynamic_test_links_self import DynamicTestLinksSelf +from tests_api.models.dynamic_test_links_test_results import DynamicTestLinksTestResults +from tests_api.models.dynamic_test_request import DynamicTestRequest +from tests_api.models.dynamic_tests import DynamicTests +from tests_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig +from tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from tests_api.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest +from tests_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from tests_api.models.endpoint_agent_to_server_test_request import EndpointAgentToServerTestRequest +from tests_api.models.endpoint_agent_to_server_tests import EndpointAgentToServerTests +from tests_api.models.endpoint_agent_to_server_type import EndpointAgentToServerType +from tests_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig +from tests_api.models.endpoint_http_server_base_test import EndpointHttpServerBaseTest +from tests_api.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest +from tests_api.models.endpoint_http_server_test import EndpointHttpServerTest +from tests_api.models.endpoint_http_server_test_request import EndpointHttpServerTestRequest +from tests_api.models.endpoint_http_server_tests import EndpointHttpServerTests +from tests_api.models.endpoint_http_server_type import EndpointHttpServerType +from tests_api.models.endpoint_instant_test import EndpointInstantTest +from tests_api.models.endpoint_scheduled_test_type import EndpointScheduledTestType +from tests_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig +from tests_api.models.endpoint_test import EndpointTest +from tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType +from tests_api.models.endpoint_test_aid import EndpointTestAid +from tests_api.models.endpoint_test_auth_type import EndpointTestAuthType +from tests_api.models.endpoint_test_links import EndpointTestLinks +from tests_api.models.endpoint_test_links_self import EndpointTestLinksSelf +from tests_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from tests_api.models.endpoint_tests import EndpointTests +from tests_api.models.error import Error +from tests_api.models.get_dynamic_test_detail200_response import GetDynamicTestDetail200Response +from tests_api.models.get_dynamic_tests_list200_response import GetDynamicTestsList200Response +from tests_api.models.get_endpoint_agent_toserver_tests_list200_response import GetEndpointAgentToserverTestsList200Response +from tests_api.models.get_endpoint_httpserver_test_detail200_response import GetEndpointHttpserverTestDetail200Response +from tests_api.models.get_endpoint_httpserver_tests_list200_response import GetEndpointHttpserverTestsList200Response +from tests_api.models.get_endpoint_tests_list200_response import GetEndpointTestsList200Response +from tests_api.models.link import Link +from tests_api.models.post_endpoint_agent_to_server_test201_response import PostEndpointAgentToServerTest201Response +from tests_api.models.self_links import SelfLinks +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.specific_agents_selector_type import SpecificAgentsSelectorType +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.unauthorized_error import UnauthorizedError diff --git a/endpoint/tests_api/tests_api/models/account_group_id.py b/endpoint/tests_api/tests_api/models/account_group_id.py new file mode 100644 index 00000000..4b53d15d --- /dev/null +++ b/endpoint/tests_api/tests_api/models/account_group_id.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 + + diff --git a/endpoint/tests_api/tests_api/models/agent_labels_selector_type.py b/endpoint/tests_api/tests_api/models/agent_labels_selector_type.py new file mode 100644 index 00000000..bc2a1f13 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/agent_labels_selector_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 AgentLabelsSelectorType(str, Enum): + """ + AgentLabelsSelectorType + """ + + """ + allowed enum values + """ + AGENT_MINUS_LABELS = 'agent-labels' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AgentLabelsSelectorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/tests_api/tests_api/models/all_agents_selector_type.py b/endpoint/tests_api/tests_api/models/all_agents_selector_type.py new file mode 100644 index 00000000..39b510ac --- /dev/null +++ b/endpoint/tests_api/tests_api/models/all_agents_selector_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 AllAgentsSelectorType(str, Enum): + """ + AllAgentsSelectorType + """ + + """ + allowed enum values + """ + ALL_MINUS_AGENTS = 'all-agents' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AllAgentsSelectorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/tests_api/tests_api/models/dynamic_test.py b/endpoint/tests_api/tests_api/models/dynamic_test.py new file mode 100644 index 00000000..28a17f94 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/dynamic_test.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.dynamic_test_application import DynamicTestApplication +from tests_api.models.dynamic_test_links import DynamicTestLinks +from tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from tests_api.models.endpoint_test_aid import EndpointTestAid +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_probe_mode import TestProbeMode +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DynamicTest(BaseModel): + """ + DynamicTest + """ # noqa: E501 + links: Optional[DynamicTestLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + application: Optional[DynamicTestApplication] = None + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=None, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + protocol: Optional[EndpointTestProtocol] = None + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID; this is used to access test information and results from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "application", "createdDate", "interval", "isEnabled", "hasPathTraceInSession", "hasPing", "hasTraceroute", "modifiedDate", "networkMeasurements", "protocol", "tcpProbeMode", "testId", "aid", "testName"] + + 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 DynamicTest 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_date", + "is_enabled", + "has_path_trace_in_session", + "modified_date", + "network_measurements", + "tcp_probe_mode", + "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() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DynamicTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": DynamicTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "application": obj.get("application"), + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements"), + "protocol": obj.get("protocol"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/dynamic_test_application.py b/endpoint/tests_api/tests_api/models/dynamic_test_application.py new file mode 100644 index 00000000..e90e092e --- /dev/null +++ b/endpoint/tests_api/tests_api/models/dynamic_test_application.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 DynamicTestApplication(str, Enum): + """ + Which supported application to monitor. + """ + + """ + allowed enum values + """ + MICROSOFT_MINUS_TEAMS = 'microsoft-teams' + WEBEX = 'webex' + ZOOM = 'zoom' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DynamicTestApplication from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/tests_api/tests_api/models/dynamic_test_links.py b/endpoint/tests_api/tests_api/models/dynamic_test_links.py new file mode 100644 index 00000000..c9a84979 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/dynamic_test_links.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.dynamic_test_links_self import DynamicTestLinksSelf +from tests_api.models.dynamic_test_links_test_results import DynamicTestLinksTestResults +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DynamicTestLinks(BaseModel): + """ + A list of links that can be accessed to get more information. + """ # noqa: E501 + var_self: Optional[DynamicTestLinksSelf] = Field(default=None, alias="self") + test_results: Optional[DynamicTestLinksTestResults] = 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 DynamicTestLinks 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 DynamicTestLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": DynamicTestLinksSelf.from_dict(obj.get("self")) if obj.get("self") is not None else None, + "testResults": DynamicTestLinksTestResults.from_dict(obj.get("testResults")) if obj.get("testResults") is not None else None + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/dynamic_test_links_self.py b/endpoint/tests_api/tests_api/models/dynamic_test_links_self.py new file mode 100644 index 00000000..3b23247e --- /dev/null +++ b/endpoint/tests_api/tests_api/models/dynamic_test_links_self.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 DynamicTestLinksSelf(BaseModel): + """ + DynamicTestLinksSelf + """ # 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 DynamicTestLinksSelf 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 DynamicTestLinksSelf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "href": obj.get("href"), + "templated": obj.get("templated"), + "type": obj.get("type"), + "deprecation": obj.get("deprecation"), + "name": obj.get("name"), + "profile": obj.get("profile"), + "title": obj.get("title"), + "hreflang": obj.get("hreflang") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/dynamic_test_links_test_results.py b/endpoint/tests_api/tests_api/models/dynamic_test_links_test_results.py new file mode 100644 index 00000000..5188d346 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/dynamic_test_links_test_results.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_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 + +DYNAMICTESTLINKSTESTRESULTS_ONE_OF_SCHEMAS = ["Link", "List[Link]"] + +class DynamicTestLinksTestResults(BaseModel): + """ + DynamicTestLinksTestResults + """ + # 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 = DynamicTestLinksTestResults.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 DynamicTestLinksTestResults 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 DynamicTestLinksTestResults 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 DynamicTestLinksTestResults 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 DynamicTestLinksTestResults 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()) + + diff --git a/endpoint/tests_api/tests_api/models/dynamic_test_request.py b/endpoint/tests_api/tests_api/models/dynamic_test_request.py new file mode 100644 index 00000000..b9627638 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/dynamic_test_request.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 typing_extensions import Annotated +from tests_api.models.dynamic_test_application import DynamicTestApplication +from tests_api.models.dynamic_test_links import DynamicTestLinks +from tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType +from tests_api.models.endpoint_test_aid import EndpointTestAid +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_probe_mode import TestProbeMode +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DynamicTestRequest(BaseModel): + """ + DynamicTestRequest + """ # noqa: E501 + links: Optional[DynamicTestLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + application: Optional[DynamicTestApplication] = None + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=None, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + protocol: Optional[EndpointTestProtocol] = None + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID; this is used to access test information and results from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + agent_selector_type: Optional[EndpointTestAgentSelectorType] = Field(default=None, alias="agentSelectorType") + agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") + endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") + max_machines: Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute this test.", alias="maxMachines") + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "application", "createdDate", "interval", "isEnabled", "hasPathTraceInSession", "hasPing", "hasTraceroute", "modifiedDate", "networkMeasurements", "protocol", "tcpProbeMode", "testId", "aid", "testName", "agentSelectorType", "agents", "endpointAgentLabels", "maxMachines"] + + 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 DynamicTestRequest 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_date", + "is_enabled", + "has_path_trace_in_session", + "modified_date", + "network_measurements", + "tcp_probe_mode", + "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() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DynamicTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": DynamicTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "application": obj.get("application"), + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements"), + "protocol": obj.get("protocol"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName"), + "agentSelectorType": obj.get("agentSelectorType"), + "agents": obj.get("agents"), + "endpointAgentLabels": obj.get("endpointAgentLabels"), + "maxMachines": obj.get("maxMachines") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/dynamic_tests.py b/endpoint/tests_api/tests_api/models/dynamic_tests.py new file mode 100644 index 00000000..bf17a3e2 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/dynamic_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.dynamic_test import DynamicTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DynamicTests(BaseModel): + """ + DynamicTests + """ # noqa: E501 + tests: Optional[List[DynamicTest]] = None + __properties: ClassVar[List[str]] = ["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 DynamicTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DynamicTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [DynamicTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_agent_labels_selector_config.py b/endpoint/tests_api/tests_api/models/endpoint_agent_labels_selector_config.py new file mode 100644 index 00000000..bbf82c18 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_agent_labels_selector_config.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 typing_extensions import Annotated +from tests_api.models.agent_labels_selector_type import AgentLabelsSelectorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentLabelsSelectorConfig(BaseModel): + """ + Agent labels selection object. + """ # noqa: E501 + agent_selector_type: Optional[AgentLabelsSelectorType] = Field(default=None, alias="agentSelectorType") + max_machines: Optional[Annotated[int, Field(le=5000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") + __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines", "endpointAgentLabels"] + + 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 EndpointAgentLabelsSelectorConfig 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 EndpointAgentLabelsSelectorConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "maxMachines": obj.get("maxMachines"), + "endpointAgentLabels": obj.get("endpointAgentLabels") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_agent_selector_config.py b/endpoint/tests_api/tests_api/models/endpoint_agent_selector_config.py new file mode 100644 index 00000000..a316918a --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_agent_selector_config.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig +from tests_api.models.endpoint_all_agents_selector_config import EndpointAllAgentsSelectorConfig +from tests_api.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig +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 + +ENDPOINTAGENTSELECTORCONFIG_ONE_OF_SCHEMAS = ["EndpointAgentLabelsSelectorConfig", "EndpointAllAgentsSelectorConfig", "EndpointSpecificAgentsSelectorConfig"] + +class EndpointAgentSelectorConfig(BaseModel): + """ + Agents selection object based on agentSelectorType. + """ + # data type: EndpointAllAgentsSelectorConfig + oneof_schema_1_validator: Optional[EndpointAllAgentsSelectorConfig] = None + # data type: EndpointAgentLabelsSelectorConfig + oneof_schema_2_validator: Optional[EndpointAgentLabelsSelectorConfig] = None + # data type: EndpointSpecificAgentsSelectorConfig + oneof_schema_3_validator: Optional[EndpointSpecificAgentsSelectorConfig] = None + actual_instance: Optional[Union[EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig]] = None + one_of_schemas: List[str] = Literal["EndpointAgentLabelsSelectorConfig", "EndpointAllAgentsSelectorConfig", "EndpointSpecificAgentsSelectorConfig"] + + model_config = { + "validate_assignment": True + } + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = EndpointAgentSelectorConfig.model_construct() + error_messages = [] + match = 0 + # validate data type: EndpointAllAgentsSelectorConfig + if not isinstance(v, EndpointAllAgentsSelectorConfig): + error_messages.append(f"Error! Input type `{type(v)}` is not `EndpointAllAgentsSelectorConfig`") + else: + match += 1 + # validate data type: EndpointAgentLabelsSelectorConfig + if not isinstance(v, EndpointAgentLabelsSelectorConfig): + error_messages.append(f"Error! Input type `{type(v)}` is not `EndpointAgentLabelsSelectorConfig`") + else: + match += 1 + # validate data type: EndpointSpecificAgentsSelectorConfig + if not isinstance(v, EndpointSpecificAgentsSelectorConfig): + error_messages.append(f"Error! Input type `{type(v)}` is not `EndpointSpecificAgentsSelectorConfig`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in EndpointAgentSelectorConfig with oneOf schemas: EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in EndpointAgentSelectorConfig with oneOf schemas: EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig. 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 EndpointAllAgentsSelectorConfig + try: + instance.actual_instance = EndpointAllAgentsSelectorConfig.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EndpointAgentLabelsSelectorConfig + try: + instance.actual_instance = EndpointAgentLabelsSelectorConfig.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EndpointSpecificAgentsSelectorConfig + try: + instance.actual_instance = EndpointSpecificAgentsSelectorConfig.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 EndpointAgentSelectorConfig with oneOf schemas: EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into EndpointAgentSelectorConfig with oneOf schemas: EndpointAgentLabelsSelectorConfig, EndpointAllAgentsSelectorConfig, EndpointSpecificAgentsSelectorConfig. 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()) + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_instant_test.py b/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_instant_test.py new file mode 100644 index 00000000..17927ea5 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_instant_test.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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, StrictInt, StrictStr +from pydantic import Field +from typing_extensions import Annotated +from tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentToServerInstantTest(BaseModel): + """ + EndpointAgentToServerInstantTest + """ # noqa: E501 + agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") + max_machines: Annotated[int, Field(le=5000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + test_name: StrictStr = Field(description="Name of the test.", alias="testName") + server_name: StrictStr = Field(description="A server address without a protocol or IP address.", alias="serverName") + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName", "serverName"] + + 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 EndpointAgentToServerInstantTest 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 EndpointAgentToServerInstantTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "agents": obj.get("agents"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "endpointAgentLabels": obj.get("endpointAgentLabels"), + "maxMachines": obj.get("maxMachines"), + "port": obj.get("port"), + "testName": obj.get("testName"), + "serverName": obj.get("serverName") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_test.py b/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_test.py new file mode 100644 index 00000000..f5d76555 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_test.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from tests_api.models.endpoint_agent_to_server_type import EndpointAgentToServerType +from tests_api.models.endpoint_test_aid import EndpointTestAid +from tests_api.models.endpoint_test_links import EndpointTestLinks +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from tests_api.models.test_interval import TestInterval +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentToServerTest(BaseModel): + """ + EndpointAgentToServerTest + """ # noqa: E501 + links: Optional[EndpointTestLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + is_saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="isSavedEvent") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + protocol: Optional[EndpointTestProtocol] = None + server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + type: Optional[EndpointAgentToServerType] = None + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "aid", "testName", "type"] + + 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 EndpointAgentToServerTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_date", + "is_enabled", + "is_saved_event", + "modified_date", + "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() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgentToServerTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": EndpointTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "isSavedEvent": obj.get("isSavedEvent"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName"), + "type": obj.get("type") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_test_request.py b/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_test_request.py new file mode 100644 index 00000000..c6f3b940 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_test_request.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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, StrictInt, StrictStr +from pydantic import Field +from typing_extensions import Annotated +from tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType +from tests_api.models.test_interval import TestInterval +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentToServerTestRequest(BaseModel): + """ + EndpointAgentToServerTestRequest + """ # noqa: E501 + agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") + max_machines: Annotated[int, Field(le=5000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + test_name: StrictStr = Field(description="Name of the test.", alias="testName") + server_name: StrictStr = Field(description="A server address without a protocol or IP address.", alias="serverName") + interval: TestInterval + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName", "serverName", "interval"] + + 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 EndpointAgentToServerTestRequest 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 EndpointAgentToServerTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "agents": obj.get("agents"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "endpointAgentLabels": obj.get("endpointAgentLabels"), + "maxMachines": obj.get("maxMachines"), + "port": obj.get("port"), + "testName": obj.get("testName"), + "serverName": obj.get("serverName"), + "interval": obj.get("interval") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_tests.py b/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_tests.py new file mode 100644 index 00000000..3b522e7c --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentToServerTests(BaseModel): + """ + EndpointAgentToServerTests + """ # noqa: E501 + tests: Optional[List[EndpointAgentToServerTest]] = None + __properties: ClassVar[List[str]] = ["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 EndpointAgentToServerTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgentToServerTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [EndpointAgentToServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_type.py b/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_type.py new file mode 100644 index 00000000..085498f9 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_agent_to_server_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 EndpointAgentToServerType(str, Enum): + """ + Type of test being queried. + """ + + """ + allowed enum values + """ + AGENT_MINUS_TO_MINUS_SERVER = 'agent-to-server' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointAgentToServerType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_all_agents_selector_config.py b/endpoint/tests_api/tests_api/models/endpoint_all_agents_selector_config.py new file mode 100644 index 00000000..c0431a55 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_all_agents_selector_config.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 typing_extensions import Annotated +from tests_api.models.all_agents_selector_type import AllAgentsSelectorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAllAgentsSelectorConfig(BaseModel): + """ + Any agent selection object. + """ # noqa: E501 + agent_selector_type: Optional[AllAgentsSelectorType] = Field(default=None, alias="agentSelectorType") + max_machines: Optional[Annotated[int, Field(le=5000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines"] + + 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 EndpointAllAgentsSelectorConfig 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 EndpointAllAgentsSelectorConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "maxMachines": obj.get("maxMachines") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_http_server_base_test.py b/endpoint/tests_api/tests_api/models/endpoint_http_server_base_test.py new file mode 100644 index 00000000..e0e0de76 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_http_server_base_test.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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, StrictInt, StrictStr +from pydantic import Field +from tests_api.models.endpoint_test_auth_type import EndpointTestAuthType +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_ssl_version_id import TestSslVersionId +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointHttpServerBaseTest(BaseModel): + """ + EndpointHttpServerBaseTest + """ # noqa: E501 + auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + http_time_limit: Optional[StrictInt] = Field(default=None, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + protocol: Optional[EndpointTestProtocol] = None + url: Optional[StrictStr] = Field(default=None, description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + verify_certificate: Optional[StrictBool] = Field(default=None, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + __properties: ClassVar[List[str]] = ["authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate"] + + 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 EndpointHttpServerBaseTest 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 EndpointHttpServerBaseTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "authType": obj.get("authType"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "httpTimeLimit": obj.get("httpTimeLimit"), + "protocol": obj.get("protocol"), + "url": obj.get("url"), + "username": obj.get("username"), + "sslVersionId": obj.get("sslVersionId"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "verifyCertificate": obj.get("verifyCertificate") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_http_server_instant_test.py b/endpoint/tests_api/tests_api/models/endpoint_http_server_instant_test.py new file mode 100644 index 00000000..a110fd1e --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_http_server_instant_test.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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, StrictInt, StrictStr +from pydantic import Field +from typing_extensions import Annotated +from tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType +from tests_api.models.endpoint_test_auth_type import EndpointTestAuthType +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_ssl_version_id import TestSslVersionId +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointHttpServerInstantTest(BaseModel): + """ + EndpointHttpServerInstantTest + """ # noqa: E501 + agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") + max_machines: Annotated[int, Field(le=5000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + test_name: StrictStr = Field(description="Name of the test.", alias="testName") + auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + http_time_limit: StrictInt = Field(description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + protocol: Optional[EndpointTestProtocol] = None + url: StrictStr = Field(description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + ssl_version_id: TestSslVersionId = Field(alias="sslVersionId") + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + verify_certificate: StrictBool = Field(description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + target_response_time: StrictInt = Field(description="Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red).", alias="targetResponseTime") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName", "authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "targetResponseTime", "password"] + + 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 EndpointHttpServerInstantTest 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 EndpointHttpServerInstantTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "agents": obj.get("agents"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "endpointAgentLabels": obj.get("endpointAgentLabels"), + "maxMachines": obj.get("maxMachines"), + "port": obj.get("port"), + "testName": obj.get("testName"), + "authType": obj.get("authType"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "httpTimeLimit": obj.get("httpTimeLimit"), + "protocol": obj.get("protocol"), + "url": obj.get("url"), + "username": obj.get("username"), + "sslVersionId": obj.get("sslVersionId"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "verifyCertificate": obj.get("verifyCertificate"), + "targetResponseTime": obj.get("targetResponseTime"), + "password": obj.get("password") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_http_server_test.py b/endpoint/tests_api/tests_api/models/endpoint_http_server_test.py new file mode 100644 index 00000000..2a8e3046 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_http_server_test.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 typing_extensions import Annotated +from tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from tests_api.models.endpoint_http_server_type import EndpointHttpServerType +from tests_api.models.endpoint_test_aid import EndpointTestAid +from tests_api.models.endpoint_test_auth_type import EndpointTestAuthType +from tests_api.models.endpoint_test_links import EndpointTestLinks +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_ssl_version_id import TestSslVersionId +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointHttpServerTest(BaseModel): + """ + EndpointHttpServerTest + """ # noqa: E501 + links: Optional[EndpointTestLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + is_saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="isSavedEvent") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + protocol: Optional[EndpointTestProtocol] = None + server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + type: Optional[EndpointHttpServerType] = None + auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") + http_time_limit: Optional[StrictInt] = Field(default=None, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + url: Optional[StrictStr] = Field(default=None, description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + verify_certificate: Optional[StrictBool] = Field(default=None, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "aid", "testName", "type", "authType", "httpTimeLimit", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "contentRegex", "followRedirects", "httpTargetTime", "httpVersion", "postBody", "sslVersion", "useNtlm", "userAgent"] + + 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 EndpointHttpServerTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_date", + "is_enabled", + "is_saved_event", + "modified_date", + "test_id", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointHttpServerTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": EndpointTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "isSavedEvent": obj.get("isSavedEvent"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName"), + "type": obj.get("type"), + "authType": obj.get("authType"), + "httpTimeLimit": obj.get("httpTimeLimit"), + "url": obj.get("url"), + "username": obj.get("username"), + "sslVersionId": obj.get("sslVersionId"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "verifyCertificate": obj.get("verifyCertificate"), + "contentRegex": obj.get("contentRegex"), + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "postBody": obj.get("postBody"), + "sslVersion": obj.get("sslVersion"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_http_server_test_request.py b/endpoint/tests_api/tests_api/models/endpoint_http_server_test_request.py new file mode 100644 index 00000000..d70bfc46 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_http_server_test_request.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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, StrictInt, StrictStr +from pydantic import Field +from typing_extensions import Annotated +from tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType +from tests_api.models.endpoint_test_auth_type import EndpointTestAuthType +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_ssl_version_id import TestSslVersionId +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointHttpServerTestRequest(BaseModel): + """ + EndpointHttpServerTestRequest + """ # noqa: E501 + agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") + max_machines: Annotated[int, Field(le=5000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + test_name: StrictStr = Field(description="Name of the test.", alias="testName") + auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + http_time_limit: StrictInt = Field(description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + protocol: Optional[EndpointTestProtocol] = None + url: StrictStr = Field(description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + ssl_version_id: TestSslVersionId = Field(alias="sslVersionId") + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + verify_certificate: StrictBool = Field(description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + target_response_time: StrictInt = Field(description="Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red).", alias="targetResponseTime") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + interval: TestInterval + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName", "authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "targetResponseTime", "password", "interval"] + + 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 EndpointHttpServerTestRequest 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 EndpointHttpServerTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "agents": obj.get("agents"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "endpointAgentLabels": obj.get("endpointAgentLabels"), + "maxMachines": obj.get("maxMachines"), + "port": obj.get("port"), + "testName": obj.get("testName"), + "authType": obj.get("authType"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "httpTimeLimit": obj.get("httpTimeLimit"), + "protocol": obj.get("protocol"), + "url": obj.get("url"), + "username": obj.get("username"), + "sslVersionId": obj.get("sslVersionId"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "verifyCertificate": obj.get("verifyCertificate"), + "targetResponseTime": obj.get("targetResponseTime"), + "password": obj.get("password"), + "interval": obj.get("interval") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_http_server_tests.py b/endpoint/tests_api/tests_api/models/endpoint_http_server_tests.py new file mode 100644 index 00000000..52b8b5c1 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_http_server_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.endpoint_http_server_test import EndpointHttpServerTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointHttpServerTests(BaseModel): + """ + EndpointHttpServerTests + """ # noqa: E501 + tests: Optional[List[EndpointHttpServerTest]] = None + __properties: ClassVar[List[str]] = ["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 EndpointHttpServerTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointHttpServerTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [EndpointHttpServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_http_server_type.py b/endpoint/tests_api/tests_api/models/endpoint_http_server_type.py new file mode 100644 index 00000000..aabcbd20 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_http_server_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 EndpointHttpServerType(str, Enum): + """ + Type of test being queried. + """ + + """ + allowed enum values + """ + HTTP_MINUS_SERVER = 'http-server' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointHttpServerType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_instant_test.py b/endpoint/tests_api/tests_api/models/endpoint_instant_test.py new file mode 100644 index 00000000..72a606cd --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_instant_test.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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, StrictInt, StrictStr +from pydantic import Field +from typing_extensions import Annotated +from tests_api.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointInstantTest(BaseModel): + """ + EndpointInstantTest + """ # noqa: E501 + agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") + max_machines: Annotated[int, Field(le=5000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + test_name: StrictStr = Field(description="Name of the test.", alias="testName") + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName"] + + 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 EndpointInstantTest 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 EndpointInstantTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "agents": obj.get("agents"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "endpointAgentLabels": obj.get("endpointAgentLabels"), + "maxMachines": obj.get("maxMachines"), + "port": obj.get("port"), + "testName": obj.get("testName") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_scheduled_test_type.py b/endpoint/tests_api/tests_api/models/endpoint_scheduled_test_type.py new file mode 100644 index 00000000..3156bba0 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_scheduled_test_type.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 EndpointScheduledTestType(str, Enum): + """ + Type of test being queried. + """ + + """ + allowed enum values + """ + AGENT_MINUS_TO_MINUS_SERVER = 'agent-to-server' + HTTP_MINUS_SERVER = 'http-server' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointScheduledTestType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_specific_agents_selector_config.py b/endpoint/tests_api/tests_api/models/endpoint_specific_agents_selector_config.py new file mode 100644 index 00000000..5f8dfcc0 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_specific_agents_selector_config.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 typing_extensions import Annotated +from tests_api.models.specific_agents_selector_type import SpecificAgentsSelectorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointSpecificAgentsSelectorConfig(BaseModel): + """ + Specific agents selection object. + """ # noqa: E501 + agent_selector_type: Optional[SpecificAgentsSelectorType] = Field(default=None, alias="agentSelectorType") + max_machines: Optional[Annotated[int, Field(le=5000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") + __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines", "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 EndpointSpecificAgentsSelectorConfig 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 EndpointSpecificAgentsSelectorConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentSelectorType": obj.get("agentSelectorType"), + "maxMachines": obj.get("maxMachines"), + "agents": obj.get("agents") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_test.py b/endpoint/tests_api/tests_api/models/endpoint_test.py new file mode 100644 index 00000000..0bd1e7c1 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_test.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from tests_api.models.endpoint_scheduled_test_type import EndpointScheduledTestType +from tests_api.models.endpoint_test_aid import EndpointTestAid +from tests_api.models.endpoint_test_links import EndpointTestLinks +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from tests_api.models.test_interval import TestInterval +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointTest(BaseModel): + """ + EndpointTest + """ # noqa: E501 + links: Optional[EndpointTestLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + is_saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="isSavedEvent") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + protocol: Optional[EndpointTestProtocol] = None + server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + type: Optional[EndpointScheduledTestType] = None + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "aid", "testName", "type"] + + 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 EndpointTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_date", + "is_enabled", + "is_saved_event", + "modified_date", + "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() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": EndpointTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "isSavedEvent": obj.get("isSavedEvent"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName"), + "type": obj.get("type") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_test_agent_selector_type.py b/endpoint/tests_api/tests_api/models/endpoint_test_agent_selector_type.py new file mode 100644 index 00000000..f8ef7f20 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_test_agent_selector_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 EndpointTestAgentSelectorType(str, Enum): + """ + Retrieve either all available agents, a specific list of agents, or a list of agent labels. + """ + + """ + allowed enum values + """ + ALL_MINUS_AGENTS = 'all-agents' + SPECIFIC_MINUS_AGENTS = 'specific-agents' + AGENT_MINUS_LABELS = 'agent-labels' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointTestAgentSelectorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_test_aid.py b/endpoint/tests_api/tests_api/models/endpoint_test_aid.py new file mode 100644 index 00000000..bd0dc3cc --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_test_aid.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 EndpointTestAid(BaseModel): + """ + EndpointTestAid + """ # 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 EndpointTestAid 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 EndpointTestAid 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 + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_test_auth_type.py b/endpoint/tests_api/tests_api/models/endpoint_test_auth_type.py new file mode 100644 index 00000000..4705b820 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_test_auth_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 EndpointTestAuthType(str, Enum): + """ + HTTP authentication type. + """ + + """ + allowed enum values + """ + NONE = 'none' + BASIC = 'basic' + NTLM = 'ntlm' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointTestAuthType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_test_links.py b/endpoint/tests_api/tests_api/models/endpoint_test_links.py new file mode 100644 index 00000000..13ae0bc1 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_test_links.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.endpoint_test_links_self import EndpointTestLinksSelf +from tests_api.models.endpoint_test_links_test_results import EndpointTestLinksTestResults +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointTestLinks(BaseModel): + """ + A list of links that can be accessed to get more information. + """ # noqa: E501 + var_self: Optional[EndpointTestLinksSelf] = Field(default=None, alias="self") + test_results: Optional[EndpointTestLinksTestResults] = 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 EndpointTestLinks 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 EndpointTestLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": EndpointTestLinksSelf.from_dict(obj.get("self")) if obj.get("self") is not None else None, + "testResults": EndpointTestLinksTestResults.from_dict(obj.get("testResults")) if obj.get("testResults") is not None else None + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_test_links_self.py b/endpoint/tests_api/tests_api/models/endpoint_test_links_self.py new file mode 100644 index 00000000..88b2d6b0 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_test_links_self.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 EndpointTestLinksSelf(BaseModel): + """ + EndpointTestLinksSelf + """ # 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 EndpointTestLinksSelf 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 EndpointTestLinksSelf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "href": obj.get("href"), + "templated": obj.get("templated"), + "type": obj.get("type"), + "deprecation": obj.get("deprecation"), + "name": obj.get("name"), + "profile": obj.get("profile"), + "title": obj.get("title"), + "hreflang": obj.get("hreflang") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_test_links_test_results.py b/endpoint/tests_api/tests_api/models/endpoint_test_links_test_results.py new file mode 100644 index 00000000..07a35457 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_test_links_test_results.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_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 + +ENDPOINTTESTLINKSTESTRESULTS_ONE_OF_SCHEMAS = ["Link", "List[Link]"] + +class EndpointTestLinksTestResults(BaseModel): + """ + EndpointTestLinksTestResults + """ + # 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 = EndpointTestLinksTestResults.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 EndpointTestLinksTestResults 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 EndpointTestLinksTestResults 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 EndpointTestLinksTestResults 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 EndpointTestLinksTestResults 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()) + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_test_protocol.py b/endpoint/tests_api/tests_api/models/endpoint_test_protocol.py new file mode 100644 index 00000000..a2b70f0d --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_test_protocol.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 EndpointTestProtocol(str, Enum): + """ + Protocol used to perform the test. + """ + + """ + allowed enum values + """ + ICMP = 'icmp' + ICMP_MINUS_WITH_MINUS_TCP_MINUS_CONNECT = 'icmp-with-tcp-connect' + TCP = 'tcp' + PREFER_MINUS_TCP = 'prefer-tcp' + AST_MINUS_AUTODETECT = 'ast-autodetect' + AUTODETECT = 'autodetect' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointTestProtocol from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/tests_api/tests_api/models/endpoint_tests.py b/endpoint/tests_api/tests_api/models/endpoint_tests.py new file mode 100644 index 00000000..4aff38f0 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/endpoint_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.endpoint_test import EndpointTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointTests(BaseModel): + """ + EndpointTests + """ # noqa: E501 + tests: Optional[List[EndpointTest]] = None + __properties: ClassVar[List[str]] = ["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 EndpointTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [EndpointTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/error.py b/endpoint/tests_api/tests_api/models/error.py new file mode 100644 index 00000000..4b4f2707 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 + + diff --git a/endpoint/tests_api/tests_api/models/get_dynamic_test_detail200_response.py b/endpoint/tests_api/tests_api/models/get_dynamic_test_detail200_response.py new file mode 100644 index 00000000..91052b8d --- /dev/null +++ b/endpoint/tests_api/tests_api/models/get_dynamic_test_detail200_response.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.dynamic_test_application import DynamicTestApplication +from tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from tests_api.models.endpoint_test_aid import EndpointTestAid +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_probe_mode import TestProbeMode +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetDynamicTestDetail200Response(BaseModel): + """ + GetDynamicTestDetail200Response + """ # noqa: E501 + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + application: Optional[DynamicTestApplication] = None + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=None, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + protocol: Optional[EndpointTestProtocol] = None + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID; this is used to access test information and results from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "application", "createdDate", "interval", "isEnabled", "hasPathTraceInSession", "hasPing", "hasTraceroute", "modifiedDate", "networkMeasurements", "protocol", "tcpProbeMode", "testId", "aid", "testName"] + + 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 GetDynamicTestDetail200Response 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_date", + "is_enabled", + "has_path_trace_in_session", + "modified_date", + "network_measurements", + "tcp_probe_mode", + "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() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetDynamicTestDetail200Response 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, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "application": obj.get("application"), + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements"), + "protocol": obj.get("protocol"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/get_dynamic_tests_list200_response.py b/endpoint/tests_api/tests_api/models/get_dynamic_tests_list200_response.py new file mode 100644 index 00000000..459b1018 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/get_dynamic_tests_list200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.dynamic_test import DynamicTest +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetDynamicTestsList200Response(BaseModel): + """ + GetDynamicTestsList200Response + """ # noqa: E501 + tests: Optional[List[DynamicTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetDynamicTestsList200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetDynamicTestsList200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [DynamicTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/get_endpoint_agent_toserver_tests_list200_response.py b/endpoint/tests_api/tests_api/models/get_endpoint_agent_toserver_tests_list200_response.py new file mode 100644 index 00000000..0d6462d5 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/get_endpoint_agent_toserver_tests_list200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointAgentToserverTestsList200Response(BaseModel): + """ + GetEndpointAgentToserverTestsList200Response + """ # noqa: E501 + tests: Optional[List[EndpointAgentToServerTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetEndpointAgentToserverTestsList200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetEndpointAgentToserverTestsList200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [EndpointAgentToServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/get_endpoint_httpserver_test_detail200_response.py b/endpoint/tests_api/tests_api/models/get_endpoint_httpserver_test_detail200_response.py new file mode 100644 index 00000000..7a2d2427 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/get_endpoint_httpserver_test_detail200_response.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 typing_extensions import Annotated +from tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from tests_api.models.endpoint_http_server_type import EndpointHttpServerType +from tests_api.models.endpoint_test_aid import EndpointTestAid +from tests_api.models.endpoint_test_auth_type import EndpointTestAuthType +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_ssl_version_id import TestSslVersionId +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointHttpserverTestDetail200Response(BaseModel): + """ + GetEndpointHttpserverTestDetail200Response + """ # noqa: E501 + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + is_saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="isSavedEvent") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + protocol: Optional[EndpointTestProtocol] = None + server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + type: Optional[EndpointHttpServerType] = None + auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") + http_time_limit: Optional[StrictInt] = Field(default=None, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + url: Optional[StrictStr] = Field(default=None, description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + verify_certificate: Optional[StrictBool] = Field(default=None, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "aid", "testName", "type", "authType", "httpTimeLimit", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "contentRegex", "followRedirects", "httpTargetTime", "httpVersion", "postBody", "sslVersion", "useNtlm", "userAgent"] + + 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 GetEndpointHttpserverTestDetail200Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_date", + "is_enabled", + "is_saved_event", + "modified_date", + "test_id", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetEndpointHttpserverTestDetail200Response 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, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "isSavedEvent": obj.get("isSavedEvent"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName"), + "type": obj.get("type"), + "authType": obj.get("authType"), + "httpTimeLimit": obj.get("httpTimeLimit"), + "url": obj.get("url"), + "username": obj.get("username"), + "sslVersionId": obj.get("sslVersionId"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "verifyCertificate": obj.get("verifyCertificate"), + "contentRegex": obj.get("contentRegex"), + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "postBody": obj.get("postBody"), + "sslVersion": obj.get("sslVersion"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/get_endpoint_httpserver_tests_list200_response.py b/endpoint/tests_api/tests_api/models/get_endpoint_httpserver_tests_list200_response.py new file mode 100644 index 00000000..23464138 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/get_endpoint_httpserver_tests_list200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.endpoint_http_server_test import EndpointHttpServerTest +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointHttpserverTestsList200Response(BaseModel): + """ + GetEndpointHttpserverTestsList200Response + """ # noqa: E501 + tests: Optional[List[EndpointHttpServerTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetEndpointHttpserverTestsList200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetEndpointHttpserverTestsList200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [EndpointHttpServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/get_endpoint_tests_list200_response.py b/endpoint/tests_api/tests_api/models/get_endpoint_tests_list200_response.py new file mode 100644 index 00000000..f4b1ff54 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/get_endpoint_tests_list200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.endpoint_test import EndpointTest +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetEndpointTestsList200Response(BaseModel): + """ + GetEndpointTestsList200Response + """ # noqa: E501 + tests: Optional[List[EndpointTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetEndpointTestsList200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetEndpointTestsList200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [EndpointTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/link.py b/endpoint/tests_api/tests_api/models/link.py new file mode 100644 index 00000000..fedbc72a --- /dev/null +++ b/endpoint/tests_api/tests_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 + + diff --git a/endpoint/tests_api/tests_api/models/post_endpoint_agent_to_server_test201_response.py b/endpoint/tests_api/tests_api/models/post_endpoint_agent_to_server_test201_response.py new file mode 100644 index 00000000..7664360d --- /dev/null +++ b/endpoint/tests_api/tests_api/models/post_endpoint_agent_to_server_test201_response.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_api.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig +from tests_api.models.endpoint_agent_to_server_type import EndpointAgentToServerType +from tests_api.models.endpoint_test_aid import EndpointTestAid +from tests_api.models.endpoint_test_protocol import EndpointTestProtocol +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_interval import TestInterval +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PostEndpointAgentToServerTest201Response(BaseModel): + """ + PostEndpointAgentToServerTest201Response + """ # noqa: E501 + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + interval: Optional[TestInterval] = None + is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") + is_saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="isSavedEvent") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + protocol: Optional[EndpointTestProtocol] = None + server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") + aid: Optional[EndpointTestAid] = None + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") + type: Optional[EndpointAgentToServerType] = None + __properties: ClassVar[List[str]] = ["_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "aid", "testName", "type"] + + 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 PostEndpointAgentToServerTest201Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_date", + "is_enabled", + "is_saved_event", + "modified_date", + "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() + # override the default output from pydantic by calling `to_dict()` of agent_selector_config + if self.agent_selector_config: + _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of aid + if self.aid: + _dict['aid'] = self.aid.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PostEndpointAgentToServerTest201Response 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, + "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj.get("agentSelectorConfig")) if obj.get("agentSelectorConfig") is not None else None, + "createdDate": obj.get("createdDate"), + "interval": obj.get("interval"), + "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, + "isSavedEvent": obj.get("isSavedEvent"), + "hasPathTraceInSession": obj.get("hasPathTraceInSession"), + "modifiedDate": obj.get("modifiedDate"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "testId": obj.get("testId"), + "aid": EndpointTestAid.from_dict(obj.get("aid")) if obj.get("aid") is not None else None, + "testName": obj.get("testName"), + "type": obj.get("type") + }) + return _obj + + diff --git a/endpoint/tests_api/tests_api/models/self_links.py b/endpoint/tests_api/tests_api/models/self_links.py new file mode 100644 index 00000000..af155f4c --- /dev/null +++ b/endpoint/tests_api/tests_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_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 + + diff --git a/endpoint/tests_api/tests_api/models/self_links_links.py b/endpoint/tests_api/tests_api/models/self_links_links.py new file mode 100644 index 00000000..0ae381d5 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_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 + + diff --git a/endpoint/tests_api/tests_api/models/specific_agents_selector_type.py b/endpoint/tests_api/tests_api/models/specific_agents_selector_type.py new file mode 100644 index 00000000..2b37c1e1 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/specific_agents_selector_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 SpecificAgentsSelectorType(str, Enum): + """ + SpecificAgentsSelectorType + """ + + """ + allowed enum values + """ + SPECIFIC_MINUS_AGENTS = 'specific-agents' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SpecificAgentsSelectorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/tests_api/tests_api/models/test_interval.py b/endpoint/tests_api/tests_api/models/test_interval.py new file mode 100644 index 00000000..a23ae9fa --- /dev/null +++ b/endpoint/tests_api/tests_api/models/test_interval.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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)) + + diff --git a/endpoint/tests_api/tests_api/models/test_probe_mode.py b/endpoint/tests_api/tests_api/models/test_probe_mode.py new file mode 100644 index 00000000..5bc9074a --- /dev/null +++ b/endpoint/tests_api/tests_api/models/test_probe_mode.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 TestProbeMode(str, Enum): + """ + Probe mode used by network test, only valid when the protocol is set to TCP. + """ + + """ + allowed enum values + """ + AUTO = 'auto' + SACK = 'sack' + SYN = 'syn' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestProbeMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/tests_api/tests_api/models/test_ssl_version_id.py b/endpoint/tests_api/tests_api/models/test_ssl_version_id.py new file mode 100644 index 00000000..5fa8ebcb --- /dev/null +++ b/endpoint/tests_api/tests_api/models/test_ssl_version_id.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 TestSslVersionId(str, Enum): + """ + SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. + """ + + """ + allowed enum values + """ + ENUM_0 = '0' + ENUM_3 = '3' + ENUM_4 = '4' + ENUM_5 = '5' + ENUM_6 = '6' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestSslVersionId from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/endpoint/tests_api/tests_api/models/unauthorized_error.py b/endpoint/tests_api/tests_api/models/unauthorized_error.py new file mode 100644 index 00000000..d50f1e34 --- /dev/null +++ b/endpoint/tests_api/tests_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 + + diff --git a/endpoint/tests_api/tests_api/py.typed b/endpoint/tests_api/tests_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/endpoint/tests_api/tests_api/rest.py b/endpoint/tests_api/tests_api/rest.py new file mode 100644 index 00000000..ac78c2ff --- /dev/null +++ b/endpoint/tests_api/tests_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + ## Overview Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + 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 tests_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) diff --git a/endpoint/tests_api/tox.ini b/endpoint/tests_api/tox.ini new file mode 100644 index 00000000..543af93d --- /dev/null +++ b/endpoint/tests_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=tests_api diff --git a/instant_tests_api/.github/workflows/python.yml b/instant_tests_api/.github/workflows/python.yml new file mode 100644 index 00000000..c5de856c --- /dev/null +++ b/instant_tests_api/.github/workflows/python.yml @@ -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: instant_tests_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 diff --git a/instant_tests_api/.gitignore b/instant_tests_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/instant_tests_api/.gitignore @@ -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 diff --git a/instant_tests_api/.gitlab-ci.yml b/instant_tests_api/.gitlab-ci.yml new file mode 100644 index 00000000..735f324a --- /dev/null +++ b/instant_tests_api/.gitlab-ci.yml @@ -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=instant_tests_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 diff --git a/instant_tests_api/.openapi-generator-ignore b/instant_tests_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/instant_tests_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/instant_tests_api/.openapi-generator/FILES b/instant_tests_api/.openapi-generator/FILES new file mode 100644 index 00000000..ca92d8ef --- /dev/null +++ b/instant_tests_api/.openapi-generator/FILES @@ -0,0 +1,239 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/Agent.md +docs/AgentBase.md +docs/AgentToAgentApi.md +docs/AgentToAgentInstantTest.md +docs/AgentToAgentInstantTestRequest.md +docs/AgentToAgentTestProtocol.md +docs/AgentToServerApi.md +docs/AgentToServerInstantTest.md +docs/AgentToServerInstantTestRequest.md +docs/CloudEnterpriseAgentType.md +docs/DNSSecurityApi.md +docs/DNSServerApi.md +docs/DNSTraceApi.md +docs/DnsQueryClass.md +docs/DnsSecInstantTest.md +docs/DnsSecInstantTestRequest.md +docs/DnsServerInstantTest.md +docs/DnsServerInstantTestRequest.md +docs/DnsServersRequest.md +docs/DnsTraceInstantTest.md +docs/DnsTraceInstantTestRequest.md +docs/Error.md +docs/Expand.md +docs/FTPServerApi.md +docs/FtpServerInstantTest.md +docs/FtpServerRequestType.md +docs/HTTPPageLoadApi.md +docs/HTTPServerApi.md +docs/HttpServerInstantTest.md +docs/HttpServerInstantTestRequest.md +docs/InstantTest.md +docs/InstantTestRequest.md +docs/InstantTestRequestAgentsInner.md +docs/Link.md +docs/MapItem.md +docs/PageLoadInstantTest.md +docs/PageLoadInstantTestRequest.md +docs/RunApi.md +docs/SIPServerApi.md +docs/ServerInstantTestRequest.md +docs/SipServerInstantTest.md +docs/SipServerInstantTestRequest.md +docs/SipTestProtocol.md +docs/TestAuthType.md +docs/TestCustomHeaders.md +docs/TestCustomHeadersAll.md +docs/TestCustomHeadersRoot.md +docs/TestDirection.md +docs/TestDnsServer.md +docs/TestDnsTransportProtocol.md +docs/TestDscpId.md +docs/TestIpv6Policy.md +docs/TestLabelsInner.md +docs/TestPageLoadingStrategy.md +docs/TestPathTraceMode.md +docs/TestProbeMode.md +docs/TestProtocol.md +docs/TestSharedAccountsInner.md +docs/TestSipCredentials.md +docs/TestSslVersionId.md +docs/TestType.md +docs/UnauthorizedError.md +docs/UnexpandedInstantTest.md +docs/UnexpandedInstantTestLinks.md +docs/UnexpandedInstantTestLinksSelf.md +docs/UnexpandedInstantTestLinksTestResults.md +docs/VoiceApi.md +docs/VoiceInstantTest.md +docs/VoiceInstantTestRequest.md +docs/WebTransactionApi.md +docs/WebTransactionInstantTest.md +docs/WebTransactionInstantTestRequest.md +git_push.sh +instant_tests_api/__init__.py +instant_tests_api/api/__init__.py +instant_tests_api/api/agent_to_agent_api.py +instant_tests_api/api/agent_to_server_api.py +instant_tests_api/api/dns_security_api.py +instant_tests_api/api/dns_server_api.py +instant_tests_api/api/dns_trace_api.py +instant_tests_api/api/ftp_server_api.py +instant_tests_api/api/http_page_load_api.py +instant_tests_api/api/http_server_api.py +instant_tests_api/api/run_api.py +instant_tests_api/api/sip_server_api.py +instant_tests_api/api/voice_api.py +instant_tests_api/api/web_transaction_api.py +instant_tests_api/api_client.py +instant_tests_api/api_response.py +instant_tests_api/configuration.py +instant_tests_api/exceptions.py +instant_tests_api/models/__init__.py +instant_tests_api/models/agent.py +instant_tests_api/models/agent_base.py +instant_tests_api/models/agent_to_agent_instant_test.py +instant_tests_api/models/agent_to_agent_instant_test_request.py +instant_tests_api/models/agent_to_agent_test_protocol.py +instant_tests_api/models/agent_to_server_instant_test.py +instant_tests_api/models/agent_to_server_instant_test_request.py +instant_tests_api/models/cloud_enterprise_agent_type.py +instant_tests_api/models/dns_query_class.py +instant_tests_api/models/dns_sec_instant_test.py +instant_tests_api/models/dns_sec_instant_test_request.py +instant_tests_api/models/dns_server_instant_test.py +instant_tests_api/models/dns_server_instant_test_request.py +instant_tests_api/models/dns_servers_request.py +instant_tests_api/models/dns_trace_instant_test.py +instant_tests_api/models/dns_trace_instant_test_request.py +instant_tests_api/models/error.py +instant_tests_api/models/expand.py +instant_tests_api/models/ftp_server_instant_test.py +instant_tests_api/models/ftp_server_request_type.py +instant_tests_api/models/http_server_instant_test.py +instant_tests_api/models/http_server_instant_test_request.py +instant_tests_api/models/instant_test.py +instant_tests_api/models/instant_test_request.py +instant_tests_api/models/instant_test_request_agents_inner.py +instant_tests_api/models/link.py +instant_tests_api/models/map_item.py +instant_tests_api/models/page_load_instant_test.py +instant_tests_api/models/page_load_instant_test_request.py +instant_tests_api/models/server_instant_test_request.py +instant_tests_api/models/sip_server_instant_test.py +instant_tests_api/models/sip_server_instant_test_request.py +instant_tests_api/models/sip_test_protocol.py +instant_tests_api/models/test_auth_type.py +instant_tests_api/models/test_custom_headers.py +instant_tests_api/models/test_custom_headers_all.py +instant_tests_api/models/test_custom_headers_root.py +instant_tests_api/models/test_direction.py +instant_tests_api/models/test_dns_server.py +instant_tests_api/models/test_dns_transport_protocol.py +instant_tests_api/models/test_dscp_id.py +instant_tests_api/models/test_ipv6_policy.py +instant_tests_api/models/test_labels_inner.py +instant_tests_api/models/test_page_loading_strategy.py +instant_tests_api/models/test_path_trace_mode.py +instant_tests_api/models/test_probe_mode.py +instant_tests_api/models/test_protocol.py +instant_tests_api/models/test_shared_accounts_inner.py +instant_tests_api/models/test_sip_credentials.py +instant_tests_api/models/test_ssl_version_id.py +instant_tests_api/models/test_type.py +instant_tests_api/models/unauthorized_error.py +instant_tests_api/models/unexpanded_instant_test.py +instant_tests_api/models/unexpanded_instant_test_links.py +instant_tests_api/models/unexpanded_instant_test_links_self.py +instant_tests_api/models/unexpanded_instant_test_links_test_results.py +instant_tests_api/models/voice_instant_test.py +instant_tests_api/models/voice_instant_test_request.py +instant_tests_api/models/web_transaction_instant_test.py +instant_tests_api/models/web_transaction_instant_test_request.py +instant_tests_api/py.typed +instant_tests_api/rest.py +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_agent.py +test/test_agent_base.py +test/test_agent_to_agent_api.py +test/test_agent_to_agent_instant_test.py +test/test_agent_to_agent_instant_test_request.py +test/test_agent_to_agent_test_protocol.py +test/test_agent_to_server_api.py +test/test_agent_to_server_instant_test.py +test/test_agent_to_server_instant_test_request.py +test/test_cloud_enterprise_agent_type.py +test/test_dns_query_class.py +test/test_dns_sec_instant_test.py +test/test_dns_sec_instant_test_request.py +test/test_dns_security_api.py +test/test_dns_server_api.py +test/test_dns_server_instant_test.py +test/test_dns_server_instant_test_request.py +test/test_dns_servers_request.py +test/test_dns_trace_api.py +test/test_dns_trace_instant_test.py +test/test_dns_trace_instant_test_request.py +test/test_error.py +test/test_expand.py +test/test_ftp_server_api.py +test/test_ftp_server_instant_test.py +test/test_ftp_server_request_type.py +test/test_http_page_load_api.py +test/test_http_server_api.py +test/test_http_server_instant_test.py +test/test_http_server_instant_test_request.py +test/test_instant_test.py +test/test_instant_test_request.py +test/test_instant_test_request_agents_inner.py +test/test_link.py +test/test_map_item.py +test/test_page_load_instant_test.py +test/test_page_load_instant_test_request.py +test/test_run_api.py +test/test_server_instant_test_request.py +test/test_sip_server_api.py +test/test_sip_server_instant_test.py +test/test_sip_server_instant_test_request.py +test/test_sip_test_protocol.py +test/test_test_auth_type.py +test/test_test_custom_headers.py +test/test_test_custom_headers_all.py +test/test_test_custom_headers_root.py +test/test_test_direction.py +test/test_test_dns_server.py +test/test_test_dns_transport_protocol.py +test/test_test_dscp_id.py +test/test_test_ipv6_policy.py +test/test_test_labels_inner.py +test/test_test_page_loading_strategy.py +test/test_test_path_trace_mode.py +test/test_test_probe_mode.py +test/test_test_protocol.py +test/test_test_shared_accounts_inner.py +test/test_test_sip_credentials.py +test/test_test_ssl_version_id.py +test/test_test_type.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_voice_api.py +test/test_voice_instant_test.py +test/test_voice_instant_test_request.py +test/test_web_transaction_api.py +test/test_web_transaction_instant_test.py +test/test_web_transaction_instant_test_request.py +tox.ini diff --git a/instant_tests_api/.openapi-generator/VERSION b/instant_tests_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/instant_tests_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/instant_tests_api/.travis.yml b/instant_tests_api/.travis.yml new file mode 100644 index 00000000..41362426 --- /dev/null +++ b/instant_tests_api/.travis.yml @@ -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=instant_tests_api diff --git a/instant_tests_api/README.md b/instant_tests_api/README.md new file mode 100644 index 00000000..1197eff8 --- /dev/null +++ b/instant_tests_api/README.md @@ -0,0 +1,198 @@ +# instant-tests-api + +### Overview +The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: + * `API Access` + * `View tests` + +The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + +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 instant_tests_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 instant_tests_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 instant_tests_api +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.AgentToAgentApi(api_client) + agent_to_agent_instant_test_request = instant_tests_api.AgentToAgentInstantTestRequest() # AgentToAgentInstantTestRequest | + 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 = [instant_tests_api.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create agent-to-agent instant test + api_response = api_instance.post_instant_test_agent_to_agent(agent_to_agent_instant_test_request, aid=aid, expand=expand) + print("The response of AgentToAgentApi->post_instant_test_agent_to_agent:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling AgentToAgentApi->post_instant_test_agent_to_agent: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AgentToAgentApi* | [**post_instant_test_agent_to_agent**](docs/AgentToAgentApi.md#post_instant_test_agent_to_agent) | **POST** /v7/tests/agent-to-agent/instant | Create agent-to-agent instant test +*AgentToServerApi* | [**post_instant_agent_to_server**](docs/AgentToServerApi.md#post_instant_agent_to_server) | **POST** /v7/tests/agent-to-server/instant | Create agent-to-server instant test +*DNSSecurityApi* | [**post_instant_dns_sec**](docs/DNSSecurityApi.md#post_instant_dns_sec) | **POST** /v7/tests/dnssec/instant | Create DNS security instant test +*DNSServerApi* | [**post_instant_dns_server**](docs/DNSServerApi.md#post_instant_dns_server) | **POST** /v7/tests/dns-server/instant | Create DNS server instant test +*DNSTraceApi* | [**post_instant_dns_trace**](docs/DNSTraceApi.md#post_instant_dns_trace) | **POST** /v7/tests/dns-trace/instant | Create DNS trace instant test +*FTPServerApi* | [**post_instant_ftp_server**](docs/FTPServerApi.md#post_instant_ftp_server) | **POST** /v7/tests/ftp-server/instant | Create FTP server instant test +*HTTPPageLoadApi* | [**post_instant_http_page_load**](docs/HTTPPageLoadApi.md#post_instant_http_page_load) | **POST** /v7/tests/page-load/instant | Create HTTP page load instant test +*HTTPServerApi* | [**post_instant_http_server**](docs/HTTPServerApi.md#post_instant_http_server) | **POST** /v7/tests/http-server/instant | Create HTTP server instant test +*RunApi* | [**post_instant_run**](docs/RunApi.md#post_instant_run) | **POST** /v7/tests/{testId}/run | Run instant test +*SIPServerApi* | [**post_instant_sip_server**](docs/SIPServerApi.md#post_instant_sip_server) | **POST** /v7/tests/sip-server/instant | Create SIP server instant test +*VoiceApi* | [**post_instant_voice**](docs/VoiceApi.md#post_instant_voice) | **POST** /v7/tests/voice/instant | Create voice instant test +*WebTransactionApi* | [**post_instant_web_transactions**](docs/WebTransactionApi.md#post_instant_web_transactions) | **POST** /v7/tests/web-transactions/instant | Create web transactions instant test + + +## Documentation For Models + + - [Agent](docs/Agent.md) + - [AgentBase](docs/AgentBase.md) + - [AgentToAgentInstantTest](docs/AgentToAgentInstantTest.md) + - [AgentToAgentInstantTestRequest](docs/AgentToAgentInstantTestRequest.md) + - [AgentToAgentTestProtocol](docs/AgentToAgentTestProtocol.md) + - [AgentToServerInstantTest](docs/AgentToServerInstantTest.md) + - [AgentToServerInstantTestRequest](docs/AgentToServerInstantTestRequest.md) + - [CloudEnterpriseAgentType](docs/CloudEnterpriseAgentType.md) + - [DnsQueryClass](docs/DnsQueryClass.md) + - [DnsSecInstantTest](docs/DnsSecInstantTest.md) + - [DnsSecInstantTestRequest](docs/DnsSecInstantTestRequest.md) + - [DnsServerInstantTest](docs/DnsServerInstantTest.md) + - [DnsServerInstantTestRequest](docs/DnsServerInstantTestRequest.md) + - [DnsServersRequest](docs/DnsServersRequest.md) + - [DnsTraceInstantTest](docs/DnsTraceInstantTest.md) + - [DnsTraceInstantTestRequest](docs/DnsTraceInstantTestRequest.md) + - [Error](docs/Error.md) + - [Expand](docs/Expand.md) + - [FtpServerInstantTest](docs/FtpServerInstantTest.md) + - [FtpServerRequestType](docs/FtpServerRequestType.md) + - [HttpServerInstantTest](docs/HttpServerInstantTest.md) + - [HttpServerInstantTestRequest](docs/HttpServerInstantTestRequest.md) + - [InstantTest](docs/InstantTest.md) + - [InstantTestRequest](docs/InstantTestRequest.md) + - [InstantTestRequestAgentsInner](docs/InstantTestRequestAgentsInner.md) + - [Link](docs/Link.md) + - [MapItem](docs/MapItem.md) + - [PageLoadInstantTest](docs/PageLoadInstantTest.md) + - [PageLoadInstantTestRequest](docs/PageLoadInstantTestRequest.md) + - [ServerInstantTestRequest](docs/ServerInstantTestRequest.md) + - [SipServerInstantTest](docs/SipServerInstantTest.md) + - [SipServerInstantTestRequest](docs/SipServerInstantTestRequest.md) + - [SipTestProtocol](docs/SipTestProtocol.md) + - [TestAuthType](docs/TestAuthType.md) + - [TestCustomHeaders](docs/TestCustomHeaders.md) + - [TestCustomHeadersAll](docs/TestCustomHeadersAll.md) + - [TestCustomHeadersRoot](docs/TestCustomHeadersRoot.md) + - [TestDirection](docs/TestDirection.md) + - [TestDnsServer](docs/TestDnsServer.md) + - [TestDnsTransportProtocol](docs/TestDnsTransportProtocol.md) + - [TestDscpId](docs/TestDscpId.md) + - [TestIpv6Policy](docs/TestIpv6Policy.md) + - [TestLabelsInner](docs/TestLabelsInner.md) + - [TestPageLoadingStrategy](docs/TestPageLoadingStrategy.md) + - [TestPathTraceMode](docs/TestPathTraceMode.md) + - [TestProbeMode](docs/TestProbeMode.md) + - [TestProtocol](docs/TestProtocol.md) + - [TestSharedAccountsInner](docs/TestSharedAccountsInner.md) + - [TestSipCredentials](docs/TestSipCredentials.md) + - [TestSslVersionId](docs/TestSslVersionId.md) + - [TestType](docs/TestType.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + - [UnexpandedInstantTest](docs/UnexpandedInstantTest.md) + - [UnexpandedInstantTestLinks](docs/UnexpandedInstantTestLinks.md) + - [UnexpandedInstantTestLinksSelf](docs/UnexpandedInstantTestLinksSelf.md) + - [UnexpandedInstantTestLinksTestResults](docs/UnexpandedInstantTestLinksTestResults.md) + - [VoiceInstantTest](docs/VoiceInstantTest.md) + - [VoiceInstantTestRequest](docs/VoiceInstantTestRequest.md) + - [WebTransactionInstantTest](docs/WebTransactionInstantTest.md) + - [WebTransactionInstantTestRequest](docs/WebTransactionInstantTestRequest.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/instant_tests_api/docs/Agent.md b/instant_tests_api/docs/Agent.md new file mode 100644 index 00000000..fb043370 --- /dev/null +++ b/instant_tests_api/docs/Agent.md @@ -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 agent’s 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's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] + +## Example + +```python +from instant_tests_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) + + diff --git a/instant_tests_api/docs/AgentBase.md b/instant_tests_api/docs/AgentBase.md new file mode 100644 index 00000000..147a42cf --- /dev/null +++ b/instant_tests_api/docs/AgentBase.md @@ -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 agent’s public IP. | [optional] [readonly] + +## Example + +```python +from instant_tests_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) + + diff --git a/instant_tests_api/docs/AgentToAgentApi.md b/instant_tests_api/docs/AgentToAgentApi.md new file mode 100644 index 00000000..e99852b0 --- /dev/null +++ b/instant_tests_api/docs/AgentToAgentApi.md @@ -0,0 +1,100 @@ +# instant_tests_api.AgentToAgentApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_instant_test_agent_to_agent**](AgentToAgentApi.md#post_instant_test_agent_to_agent) | **POST** /v7/tests/agent-to-agent/instant | Create agent-to-agent instant test + + +# **post_instant_test_agent_to_agent** +> AgentToAgentInstantTest post_instant_test_agent_to_agent(agent_to_agent_instant_test_request, aid=aid, expand=expand) + +Create agent-to-agent instant test + +Creates and runs a new agent-to-agent instant test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_api.models.agent_to_agent_instant_test import AgentToAgentInstantTest +from instant_tests_api.models.agent_to_agent_instant_test_request import AgentToAgentInstantTestRequest +from instant_tests_api.models.expand import Expand +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.AgentToAgentApi(api_client) + agent_to_agent_instant_test_request = instant_tests_api.AgentToAgentInstantTestRequest() # AgentToAgentInstantTestRequest | + 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 = [instant_tests_api.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create agent-to-agent instant test + api_response = api_instance.post_instant_test_agent_to_agent(agent_to_agent_instant_test_request, aid=aid, expand=expand) + print("The response of AgentToAgentApi->post_instant_test_agent_to_agent:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToAgentApi->post_instant_test_agent_to_agent: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_to_agent_instant_test_request** | [**AgentToAgentInstantTestRequest**](AgentToAgentInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**AgentToAgentInstantTest**](AgentToAgentInstantTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/instant_tests_api/docs/AgentToAgentInstantTest.md b/instant_tests_api/docs/AgentToAgentInstantTest.md new file mode 100644 index 00000000..4ce50c47 --- /dev/null +++ b/instant_tests_api/docs/AgentToAgentInstantTest.md @@ -0,0 +1,54 @@ +# AgentToAgentInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**mss** | **int** | Maximum segment size, in bytes. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**protocol** | [**AgentToAgentTestProtocol**](AgentToAgentTestProtocol.md) | | [optional] +**target_agent_id** | **str** | `agentId` of the target agent for the test. | +**throughput_measurements** | **bool** | Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent. | [optional] [default to False] +**throughput_duration** | **int** | The throughput duration. | [optional] [default to 10000] +**throughput_rate** | **int** | The throughput rate, only applicable for UDP protocol. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] + +## Example + +```python +from instant_tests_api.models.agent_to_agent_instant_test import AgentToAgentInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToAgentInstantTest from a JSON string +agent_to_agent_instant_test_instance = AgentToAgentInstantTest.from_json(json) +# print the JSON string representation of the object +print AgentToAgentInstantTest.to_json() + +# convert the object into a dict +agent_to_agent_instant_test_dict = agent_to_agent_instant_test_instance.to_dict() +# create an instance of AgentToAgentInstantTest from a dict +agent_to_agent_instant_test_form_dict = agent_to_agent_instant_test.from_dict(agent_to_agent_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/AgentToAgentInstantTestRequest.md b/instant_tests_api/docs/AgentToAgentInstantTestRequest.md new file mode 100644 index 00000000..025fbf18 --- /dev/null +++ b/instant_tests_api/docs/AgentToAgentInstantTestRequest.md @@ -0,0 +1,54 @@ +# AgentToAgentInstantTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] +**shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**agents** | [**List[InstantTestRequestAgentsInner]**](InstantTestRequestAgentsInner.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**mss** | **int** | Maximum segment size, in bytes. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**protocol** | [**AgentToAgentTestProtocol**](AgentToAgentTestProtocol.md) | | [optional] +**target_agent_id** | **str** | `agentId` of the target agent for the test. | +**throughput_measurements** | **bool** | Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent. | [optional] [default to False] +**throughput_duration** | **int** | The throughput duration. | [optional] [default to 10000] +**throughput_rate** | **int** | The throughput rate, only applicable for UDP protocol. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] + +## Example + +```python +from instant_tests_api.models.agent_to_agent_instant_test_request import AgentToAgentInstantTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToAgentInstantTestRequest from a JSON string +agent_to_agent_instant_test_request_instance = AgentToAgentInstantTestRequest.from_json(json) +# print the JSON string representation of the object +print AgentToAgentInstantTestRequest.to_json() + +# convert the object into a dict +agent_to_agent_instant_test_request_dict = agent_to_agent_instant_test_request_instance.to_dict() +# create an instance of AgentToAgentInstantTestRequest from a dict +agent_to_agent_instant_test_request_form_dict = agent_to_agent_instant_test_request.from_dict(agent_to_agent_instant_test_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) + + diff --git a/instant_tests_api/docs/AgentToAgentTestProtocol.md b/instant_tests_api/docs/AgentToAgentTestProtocol.md new file mode 100644 index 00000000..ee2d3a70 --- /dev/null +++ b/instant_tests_api/docs/AgentToAgentTestProtocol.md @@ -0,0 +1,10 @@ +# AgentToAgentTestProtocol + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/AgentToServerApi.md b/instant_tests_api/docs/AgentToServerApi.md new file mode 100644 index 00000000..f254224f --- /dev/null +++ b/instant_tests_api/docs/AgentToServerApi.md @@ -0,0 +1,100 @@ +# instant_tests_api.AgentToServerApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_instant_agent_to_server**](AgentToServerApi.md#post_instant_agent_to_server) | **POST** /v7/tests/agent-to-server/instant | Create agent-to-server instant test + + +# **post_instant_agent_to_server** +> AgentToServerInstantTest post_instant_agent_to_server(agent_to_server_instant_test_request, aid=aid, expand=expand) + +Create agent-to-server instant test + +Creates and runs a new agent-to-server instant test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_api.models.agent_to_server_instant_test import AgentToServerInstantTest +from instant_tests_api.models.agent_to_server_instant_test_request import AgentToServerInstantTestRequest +from instant_tests_api.models.expand import Expand +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.AgentToServerApi(api_client) + agent_to_server_instant_test_request = instant_tests_api.AgentToServerInstantTestRequest() # AgentToServerInstantTestRequest | + 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 = [instant_tests_api.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create agent-to-server instant test + api_response = api_instance.post_instant_agent_to_server(agent_to_server_instant_test_request, aid=aid, expand=expand) + print("The response of AgentToServerApi->post_instant_agent_to_server:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerApi->post_instant_agent_to_server: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_to_server_instant_test_request** | [**AgentToServerInstantTestRequest**](AgentToServerInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**AgentToServerInstantTest**](AgentToServerInstantTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/instant_tests_api/docs/AgentToServerInstantTest.md b/instant_tests_api/docs/AgentToServerInstantTest.md new file mode 100644 index 00000000..822d9050 --- /dev/null +++ b/instant_tests_api/docs/AgentToServerInstantTest.md @@ -0,0 +1,56 @@ +# AgentToServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**continuous_mode** | **bool** | To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. | [optional] +**fixed_packet_rate** | **int** | If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1` | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**server** | **str** | Target name or IP address. | +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**ping_payload_size** | **int** | Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests. | [optional] +**network_measurements** | **bool** | View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements. | [optional] [default to False] + +## Example + +```python +from instant_tests_api.models.agent_to_server_instant_test import AgentToServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToServerInstantTest from a JSON string +agent_to_server_instant_test_instance = AgentToServerInstantTest.from_json(json) +# print the JSON string representation of the object +print AgentToServerInstantTest.to_json() + +# convert the object into a dict +agent_to_server_instant_test_dict = agent_to_server_instant_test_instance.to_dict() +# create an instance of AgentToServerInstantTest from a dict +agent_to_server_instant_test_form_dict = agent_to_server_instant_test.from_dict(agent_to_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/AgentToServerInstantTestRequest.md b/instant_tests_api/docs/AgentToServerInstantTestRequest.md new file mode 100644 index 00000000..1c80dc66 --- /dev/null +++ b/instant_tests_api/docs/AgentToServerInstantTestRequest.md @@ -0,0 +1,56 @@ +# AgentToServerInstantTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] +**shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**agents** | [**List[InstantTestRequestAgentsInner]**](InstantTestRequestAgentsInner.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**continuous_mode** | **bool** | To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. | [optional] +**fixed_packet_rate** | **int** | If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1` | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**server** | **str** | Target name or IP address. | +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**ping_payload_size** | **int** | Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests. | [optional] +**network_measurements** | **bool** | View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements. | [optional] [default to False] + +## Example + +```python +from instant_tests_api.models.agent_to_server_instant_test_request import AgentToServerInstantTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToServerInstantTestRequest from a JSON string +agent_to_server_instant_test_request_instance = AgentToServerInstantTestRequest.from_json(json) +# print the JSON string representation of the object +print AgentToServerInstantTestRequest.to_json() + +# convert the object into a dict +agent_to_server_instant_test_request_dict = agent_to_server_instant_test_request_instance.to_dict() +# create an instance of AgentToServerInstantTestRequest from a dict +agent_to_server_instant_test_request_form_dict = agent_to_server_instant_test_request.from_dict(agent_to_server_instant_test_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) + + diff --git a/instant_tests_api/docs/CloudEnterpriseAgentType.md b/instant_tests_api/docs/CloudEnterpriseAgentType.md new file mode 100644 index 00000000..951c803e --- /dev/null +++ b/instant_tests_api/docs/CloudEnterpriseAgentType.md @@ -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) + + diff --git a/instant_tests_api/docs/DNSSecurityApi.md b/instant_tests_api/docs/DNSSecurityApi.md new file mode 100644 index 00000000..a0d9b7cc --- /dev/null +++ b/instant_tests_api/docs/DNSSecurityApi.md @@ -0,0 +1,100 @@ +# instant_tests_api.DNSSecurityApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_instant_dns_sec**](DNSSecurityApi.md#post_instant_dns_sec) | **POST** /v7/tests/dnssec/instant | Create DNS security instant test + + +# **post_instant_dns_sec** +> DnsSecInstantTest post_instant_dns_sec(dns_sec_instant_test_request, aid=aid, expand=expand) + +Create DNS security instant test + +Creates and runs a new DNS security instant test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_api.models.dns_sec_instant_test import DnsSecInstantTest +from instant_tests_api.models.dns_sec_instant_test_request import DnsSecInstantTestRequest +from instant_tests_api.models.expand import Expand +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.DNSSecurityApi(api_client) + dns_sec_instant_test_request = instant_tests_api.DnsSecInstantTestRequest() # DnsSecInstantTestRequest | + 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 = [instant_tests_api.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create DNS security instant test + api_response = api_instance.post_instant_dns_sec(dns_sec_instant_test_request, aid=aid, expand=expand) + print("The response of DNSSecurityApi->post_instant_dns_sec:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSSecurityApi->post_instant_dns_sec: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dns_sec_instant_test_request** | [**DnsSecInstantTestRequest**](DnsSecInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**DnsSecInstantTest**](DnsSecInstantTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/instant_tests_api/docs/DNSServerApi.md b/instant_tests_api/docs/DNSServerApi.md new file mode 100644 index 00000000..adcc3bd9 --- /dev/null +++ b/instant_tests_api/docs/DNSServerApi.md @@ -0,0 +1,100 @@ +# instant_tests_api.DNSServerApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_instant_dns_server**](DNSServerApi.md#post_instant_dns_server) | **POST** /v7/tests/dns-server/instant | Create DNS server instant test + + +# **post_instant_dns_server** +> DnsServerInstantTest post_instant_dns_server(dns_server_instant_test_request, aid=aid, expand=expand) + +Create DNS server instant test + +Creates and runs a new DNS server instant test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_api.models.dns_server_instant_test import DnsServerInstantTest +from instant_tests_api.models.dns_server_instant_test_request import DnsServerInstantTestRequest +from instant_tests_api.models.expand import Expand +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.DNSServerApi(api_client) + dns_server_instant_test_request = instant_tests_api.DnsServerInstantTestRequest() # DnsServerInstantTestRequest | + 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 = [instant_tests_api.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create DNS server instant test + api_response = api_instance.post_instant_dns_server(dns_server_instant_test_request, aid=aid, expand=expand) + print("The response of DNSServerApi->post_instant_dns_server:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerApi->post_instant_dns_server: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dns_server_instant_test_request** | [**DnsServerInstantTestRequest**](DnsServerInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**DnsServerInstantTest**](DnsServerInstantTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/instant_tests_api/docs/DNSTraceApi.md b/instant_tests_api/docs/DNSTraceApi.md new file mode 100644 index 00000000..604e2b7a --- /dev/null +++ b/instant_tests_api/docs/DNSTraceApi.md @@ -0,0 +1,100 @@ +# instant_tests_api.DNSTraceApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_instant_dns_trace**](DNSTraceApi.md#post_instant_dns_trace) | **POST** /v7/tests/dns-trace/instant | Create DNS trace instant test + + +# **post_instant_dns_trace** +> DnsTraceInstantTest post_instant_dns_trace(dns_trace_instant_test_request, aid=aid, expand=expand) + +Create DNS trace instant test + +Creates and runs a new DNS trace instant test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_api.models.dns_trace_instant_test import DnsTraceInstantTest +from instant_tests_api.models.dns_trace_instant_test_request import DnsTraceInstantTestRequest +from instant_tests_api.models.expand import Expand +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.DNSTraceApi(api_client) + dns_trace_instant_test_request = instant_tests_api.DnsTraceInstantTestRequest() # DnsTraceInstantTestRequest | + 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 = [instant_tests_api.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create DNS trace instant test + api_response = api_instance.post_instant_dns_trace(dns_trace_instant_test_request, aid=aid, expand=expand) + print("The response of DNSTraceApi->post_instant_dns_trace:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSTraceApi->post_instant_dns_trace: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dns_trace_instant_test_request** | [**DnsTraceInstantTestRequest**](DnsTraceInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**DnsTraceInstantTest**](DnsTraceInstantTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/instant_tests_api/docs/DnsQueryClass.md b/instant_tests_api/docs/DnsQueryClass.md new file mode 100644 index 00000000..b4de0b88 --- /dev/null +++ b/instant_tests_api/docs/DnsQueryClass.md @@ -0,0 +1,11 @@ +# DnsQueryClass + +Domain class used by this test. 'in' stands for Internet, while 'ch' stands for Chaos. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/DnsSecInstantTest.md b/instant_tests_api/docs/DnsSecInstantTest.md new file mode 100644 index 00000000..5eb5f625 --- /dev/null +++ b/instant_tests_api/docs/DnsSecInstantTest.md @@ -0,0 +1,43 @@ +# DnsSecInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.dns_sec_instant_test import DnsSecInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsSecInstantTest from a JSON string +dns_sec_instant_test_instance = DnsSecInstantTest.from_json(json) +# print the JSON string representation of the object +print DnsSecInstantTest.to_json() + +# convert the object into a dict +dns_sec_instant_test_dict = dns_sec_instant_test_instance.to_dict() +# create an instance of DnsSecInstantTest from a dict +dns_sec_instant_test_form_dict = dns_sec_instant_test.from_dict(dns_sec_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/DnsSecInstantTestRequest.md b/instant_tests_api/docs/DnsSecInstantTestRequest.md new file mode 100644 index 00000000..d4830e5b --- /dev/null +++ b/instant_tests_api/docs/DnsSecInstantTestRequest.md @@ -0,0 +1,43 @@ +# DnsSecInstantTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] +**shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**agents** | [**List[InstantTestRequestAgentsInner]**](InstantTestRequestAgentsInner.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.dns_sec_instant_test_request import DnsSecInstantTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsSecInstantTestRequest from a JSON string +dns_sec_instant_test_request_instance = DnsSecInstantTestRequest.from_json(json) +# print the JSON string representation of the object +print DnsSecInstantTestRequest.to_json() + +# convert the object into a dict +dns_sec_instant_test_request_dict = dns_sec_instant_test_request_instance.to_dict() +# create an instance of DnsSecInstantTestRequest from a dict +dns_sec_instant_test_request_form_dict = dns_sec_instant_test_request.from_dict(dns_sec_instant_test_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) + + diff --git a/instant_tests_api/docs/DnsServerInstantTest.md b/instant_tests_api/docs/DnsServerInstantTest.md new file mode 100644 index 00000000..46dd76f8 --- /dev/null +++ b/instant_tests_api/docs/DnsServerInstantTest.md @@ -0,0 +1,55 @@ +# DnsServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**dns_servers** | [**List[TestDnsServer]**](TestDnsServer.md) | | +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**recursive_queries** | **bool** | Set true to run query with RD (recursion desired) flag enabled. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.dns_server_instant_test import DnsServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsServerInstantTest from a JSON string +dns_server_instant_test_instance = DnsServerInstantTest.from_json(json) +# print the JSON string representation of the object +print DnsServerInstantTest.to_json() + +# convert the object into a dict +dns_server_instant_test_dict = dns_server_instant_test_instance.to_dict() +# create an instance of DnsServerInstantTest from a dict +dns_server_instant_test_form_dict = dns_server_instant_test.from_dict(dns_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/DnsServerInstantTestRequest.md b/instant_tests_api/docs/DnsServerInstantTestRequest.md new file mode 100644 index 00000000..52689368 --- /dev/null +++ b/instant_tests_api/docs/DnsServerInstantTestRequest.md @@ -0,0 +1,55 @@ +# DnsServerInstantTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] +**shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**agents** | [**List[InstantTestRequestAgentsInner]**](InstantTestRequestAgentsInner.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**dns_servers** | **List[str]** | A list of DNS server FQDN. | +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**recursive_queries** | **bool** | Set true to run query with RD (recursion desired) flag enabled. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.dns_server_instant_test_request import DnsServerInstantTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsServerInstantTestRequest from a JSON string +dns_server_instant_test_request_instance = DnsServerInstantTestRequest.from_json(json) +# print the JSON string representation of the object +print DnsServerInstantTestRequest.to_json() + +# convert the object into a dict +dns_server_instant_test_request_dict = dns_server_instant_test_request_instance.to_dict() +# create an instance of DnsServerInstantTestRequest from a dict +dns_server_instant_test_request_form_dict = dns_server_instant_test_request.from_dict(dns_server_instant_test_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) + + diff --git a/instant_tests_api/docs/DnsServersRequest.md b/instant_tests_api/docs/DnsServersRequest.md new file mode 100644 index 00000000..5f498d38 --- /dev/null +++ b/instant_tests_api/docs/DnsServersRequest.md @@ -0,0 +1,28 @@ +# DnsServersRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dns_servers** | **List[str]** | A list of DNS server FQDN. | [optional] + +## Example + +```python +from instant_tests_api.models.dns_servers_request import DnsServersRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsServersRequest from a JSON string +dns_servers_request_instance = DnsServersRequest.from_json(json) +# print the JSON string representation of the object +print DnsServersRequest.to_json() + +# convert the object into a dict +dns_servers_request_dict = dns_servers_request_instance.to_dict() +# create an instance of DnsServersRequest from a dict +dns_servers_request_form_dict = dns_servers_request.from_dict(dns_servers_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) + + diff --git a/instant_tests_api/docs/DnsTraceInstantTest.md b/instant_tests_api/docs/DnsTraceInstantTest.md new file mode 100644 index 00000000..89449ce3 --- /dev/null +++ b/instant_tests_api/docs/DnsTraceInstantTest.md @@ -0,0 +1,44 @@ +# DnsTraceInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.dns_trace_instant_test import DnsTraceInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsTraceInstantTest from a JSON string +dns_trace_instant_test_instance = DnsTraceInstantTest.from_json(json) +# print the JSON string representation of the object +print DnsTraceInstantTest.to_json() + +# convert the object into a dict +dns_trace_instant_test_dict = dns_trace_instant_test_instance.to_dict() +# create an instance of DnsTraceInstantTest from a dict +dns_trace_instant_test_form_dict = dns_trace_instant_test.from_dict(dns_trace_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/DnsTraceInstantTestRequest.md b/instant_tests_api/docs/DnsTraceInstantTestRequest.md new file mode 100644 index 00000000..da5d7353 --- /dev/null +++ b/instant_tests_api/docs/DnsTraceInstantTestRequest.md @@ -0,0 +1,44 @@ +# DnsTraceInstantTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] +**shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**agents** | [**List[InstantTestRequestAgentsInner]**](InstantTestRequestAgentsInner.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.dns_trace_instant_test_request import DnsTraceInstantTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsTraceInstantTestRequest from a JSON string +dns_trace_instant_test_request_instance = DnsTraceInstantTestRequest.from_json(json) +# print the JSON string representation of the object +print DnsTraceInstantTestRequest.to_json() + +# convert the object into a dict +dns_trace_instant_test_request_dict = dns_trace_instant_test_request_instance.to_dict() +# create an instance of DnsTraceInstantTestRequest from a dict +dns_trace_instant_test_request_form_dict = dns_trace_instant_test_request.from_dict(dns_trace_instant_test_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) + + diff --git a/instant_tests_api/docs/Error.md b/instant_tests_api/docs/Error.md new file mode 100644 index 00000000..275b872e --- /dev/null +++ b/instant_tests_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from instant_tests_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/Expand.md b/instant_tests_api/docs/Expand.md new file mode 100644 index 00000000..5d5b5ca2 --- /dev/null +++ b/instant_tests_api/docs/Expand.md @@ -0,0 +1,10 @@ +# Expand + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/FTPServerApi.md b/instant_tests_api/docs/FTPServerApi.md new file mode 100644 index 00000000..abdf5896 --- /dev/null +++ b/instant_tests_api/docs/FTPServerApi.md @@ -0,0 +1,100 @@ +# instant_tests_api.FTPServerApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_instant_ftp_server**](FTPServerApi.md#post_instant_ftp_server) | **POST** /v7/tests/ftp-server/instant | Create FTP server instant test + + +# **post_instant_ftp_server** +> FtpServerInstantTest post_instant_ftp_server(server_instant_test_request, aid=aid, expand=expand) + +Create FTP server instant test + +Creates and runs a new FTP server instant test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_api.models.expand import Expand +from instant_tests_api.models.ftp_server_instant_test import FtpServerInstantTest +from instant_tests_api.models.server_instant_test_request import ServerInstantTestRequest +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.FTPServerApi(api_client) + server_instant_test_request = instant_tests_api.ServerInstantTestRequest() # ServerInstantTestRequest | + 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 = [instant_tests_api.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create FTP server instant test + api_response = api_instance.post_instant_ftp_server(server_instant_test_request, aid=aid, expand=expand) + print("The response of FTPServerApi->post_instant_ftp_server:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FTPServerApi->post_instant_ftp_server: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **server_instant_test_request** | [**ServerInstantTestRequest**](ServerInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**FtpServerInstantTest**](FtpServerInstantTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/instant_tests_api/docs/FtpServerInstantTest.md b/instant_tests_api/docs/FtpServerInstantTest.md new file mode 100644 index 00000000..4716a36f --- /dev/null +++ b/instant_tests_api/docs/FtpServerInstantTest.md @@ -0,0 +1,59 @@ +# FtpServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**download_limit** | **int** | Specify maximum number of bytes to download from the target object. | [optional] +**ftp_target_time** | **int** | Target time for operation completion; specified in milliseconds. | [optional] +**ftp_time_limit** | **int** | Set the time limit for the test in seconds. | [optional] [default to 10] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**request_type** | [**FtpServerRequestType**](FtpServerRequestType.md) | | +**url** | **str** | Target for the test. | +**use_active_ftp** | **bool** | Explicitly set the flag to use active FTP. | [optional] [default to False] +**use_explicit_ftps** | **bool** | Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.ftp_server_instant_test import FtpServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of FtpServerInstantTest from a JSON string +ftp_server_instant_test_instance = FtpServerInstantTest.from_json(json) +# print the JSON string representation of the object +print FtpServerInstantTest.to_json() + +# convert the object into a dict +ftp_server_instant_test_dict = ftp_server_instant_test_instance.to_dict() +# create an instance of FtpServerInstantTest from a dict +ftp_server_instant_test_form_dict = ftp_server_instant_test.from_dict(ftp_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/FtpServerRequestType.md b/instant_tests_api/docs/FtpServerRequestType.md new file mode 100644 index 00000000..1180b3a5 --- /dev/null +++ b/instant_tests_api/docs/FtpServerRequestType.md @@ -0,0 +1,11 @@ +# FtpServerRequestType + +Set the type of activity for the test. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/HTTPPageLoadApi.md b/instant_tests_api/docs/HTTPPageLoadApi.md new file mode 100644 index 00000000..ce1dd5b3 --- /dev/null +++ b/instant_tests_api/docs/HTTPPageLoadApi.md @@ -0,0 +1,100 @@ +# instant_tests_api.HTTPPageLoadApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_instant_http_page_load**](HTTPPageLoadApi.md#post_instant_http_page_load) | **POST** /v7/tests/page-load/instant | Create HTTP page load instant test + + +# **post_instant_http_page_load** +> PageLoadInstantTest post_instant_http_page_load(page_load_instant_test_request, aid=aid, expand=expand) + +Create HTTP page load instant test + +Creates and runs a new HTTP page load instant test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_api.models.expand import Expand +from instant_tests_api.models.page_load_instant_test import PageLoadInstantTest +from instant_tests_api.models.page_load_instant_test_request import PageLoadInstantTestRequest +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.HTTPPageLoadApi(api_client) + page_load_instant_test_request = instant_tests_api.PageLoadInstantTestRequest() # PageLoadInstantTestRequest | + 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 = [instant_tests_api.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create HTTP page load instant test + api_response = api_instance.post_instant_http_page_load(page_load_instant_test_request, aid=aid, expand=expand) + print("The response of HTTPPageLoadApi->post_instant_http_page_load:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPPageLoadApi->post_instant_http_page_load: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_load_instant_test_request** | [**PageLoadInstantTestRequest**](PageLoadInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**PageLoadInstantTest**](PageLoadInstantTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/instant_tests_api/docs/HTTPServerApi.md b/instant_tests_api/docs/HTTPServerApi.md new file mode 100644 index 00000000..aa82a6bd --- /dev/null +++ b/instant_tests_api/docs/HTTPServerApi.md @@ -0,0 +1,100 @@ +# instant_tests_api.HTTPServerApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_instant_http_server**](HTTPServerApi.md#post_instant_http_server) | **POST** /v7/tests/http-server/instant | Create HTTP server instant test + + +# **post_instant_http_server** +> HttpServerInstantTest post_instant_http_server(http_server_instant_test_request, aid=aid, expand=expand) + +Create HTTP server instant test + +Creates and runs a new HTTP server instant test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_api.models.expand import Expand +from instant_tests_api.models.http_server_instant_test import HttpServerInstantTest +from instant_tests_api.models.http_server_instant_test_request import HttpServerInstantTestRequest +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.HTTPServerApi(api_client) + http_server_instant_test_request = instant_tests_api.HttpServerInstantTestRequest() # HttpServerInstantTestRequest | + 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 = [instant_tests_api.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create HTTP server instant test + api_response = api_instance.post_instant_http_server(http_server_instant_test_request, aid=aid, expand=expand) + print("The response of HTTPServerApi->post_instant_http_server:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerApi->post_instant_http_server: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **http_server_instant_test_request** | [**HttpServerInstantTestRequest**](HttpServerInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**HttpServerInstantTest**](HttpServerInstantTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/instant_tests_api/docs/HttpServerInstantTest.md b/instant_tests_api/docs/HttpServerInstantTest.md new file mode 100644 index 00000000..3ee41462 --- /dev/null +++ b/instant_tests_api/docs/HttpServerInstantTest.md @@ -0,0 +1,72 @@ +# HttpServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**headers** | **List[str]** | HTTP request headers used. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] + +## Example + +```python +from instant_tests_api.models.http_server_instant_test import HttpServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpServerInstantTest from a JSON string +http_server_instant_test_instance = HttpServerInstantTest.from_json(json) +# print the JSON string representation of the object +print HttpServerInstantTest.to_json() + +# convert the object into a dict +http_server_instant_test_dict = http_server_instant_test_instance.to_dict() +# create an instance of HttpServerInstantTest from a dict +http_server_instant_test_form_dict = http_server_instant_test.from_dict(http_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/HttpServerInstantTestRequest.md b/instant_tests_api/docs/HttpServerInstantTestRequest.md new file mode 100644 index 00000000..616281d1 --- /dev/null +++ b/instant_tests_api/docs/HttpServerInstantTestRequest.md @@ -0,0 +1,72 @@ +# HttpServerInstantTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] +**shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**agents** | [**List[InstantTestRequestAgentsInner]**](InstantTestRequestAgentsInner.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**headers** | **List[str]** | HTTP request headers used. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] + +## Example + +```python +from instant_tests_api.models.http_server_instant_test_request import HttpServerInstantTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpServerInstantTestRequest from a JSON string +http_server_instant_test_request_instance = HttpServerInstantTestRequest.from_json(json) +# print the JSON string representation of the object +print HttpServerInstantTestRequest.to_json() + +# convert the object into a dict +http_server_instant_test_request_dict = http_server_instant_test_request_instance.to_dict() +# create an instance of HttpServerInstantTestRequest from a dict +http_server_instant_test_request_form_dict = http_server_instant_test_request.from_dict(http_server_instant_test_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) + + diff --git a/instant_tests_api/docs/InstantTest.md b/instant_tests_api/docs/InstantTest.md new file mode 100644 index 00000000..4a5544d8 --- /dev/null +++ b/instant_tests_api/docs/InstantTest.md @@ -0,0 +1,40 @@ +# InstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | [**TestType**](TestType.md) | | [optional] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] + +## Example + +```python +from instant_tests_api.models.instant_test import InstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of InstantTest from a JSON string +instant_test_instance = InstantTest.from_json(json) +# print the JSON string representation of the object +print InstantTest.to_json() + +# convert the object into a dict +instant_test_dict = instant_test_instance.to_dict() +# create an instance of InstantTest from a dict +instant_test_form_dict = instant_test.from_dict(instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/InstantTestRequest.md b/instant_tests_api/docs/InstantTestRequest.md new file mode 100644 index 00000000..a294d629 --- /dev/null +++ b/instant_tests_api/docs/InstantTestRequest.md @@ -0,0 +1,30 @@ +# InstantTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] +**shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**agents** | [**List[InstantTestRequestAgentsInner]**](InstantTestRequestAgentsInner.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | [optional] + +## Example + +```python +from instant_tests_api.models.instant_test_request import InstantTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of InstantTestRequest from a JSON string +instant_test_request_instance = InstantTestRequest.from_json(json) +# print the JSON string representation of the object +print InstantTestRequest.to_json() + +# convert the object into a dict +instant_test_request_dict = instant_test_request_instance.to_dict() +# create an instance of InstantTestRequest from a dict +instant_test_request_form_dict = instant_test_request.from_dict(instant_test_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) + + diff --git a/instant_tests_api/docs/InstantTestRequestAgentsInner.md b/instant_tests_api/docs/InstantTestRequestAgentsInner.md new file mode 100644 index 00000000..2bf2609f --- /dev/null +++ b/instant_tests_api/docs/InstantTestRequestAgentsInner.md @@ -0,0 +1,29 @@ +# InstantTestRequestAgentsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Identifier for the agent (get `agentId` from `/agents` endpoint). | [optional] +**source_ip_address** | **str** | IP address from the agent's `ipAddresses` field (get `ipAddresses` from `/agents` endpoint). Used for interface selection. | [optional] + +## Example + +```python +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of InstantTestRequestAgentsInner from a JSON string +instant_test_request_agents_inner_instance = InstantTestRequestAgentsInner.from_json(json) +# print the JSON string representation of the object +print InstantTestRequestAgentsInner.to_json() + +# convert the object into a dict +instant_test_request_agents_inner_dict = instant_test_request_agents_inner_instance.to_dict() +# create an instance of InstantTestRequestAgentsInner from a dict +instant_test_request_agents_inner_form_dict = instant_test_request_agents_inner.from_dict(instant_test_request_agents_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/Link.md b/instant_tests_api/docs/Link.md new file mode 100644 index 00000000..f51d6f48 --- /dev/null +++ b/instant_tests_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from instant_tests_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/MapItem.md b/instant_tests_api/docs/MapItem.md new file mode 100644 index 00000000..f93c6bf3 --- /dev/null +++ b/instant_tests_api/docs/MapItem.md @@ -0,0 +1,29 @@ +# MapItem + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **str** | | [optional] +**value** | **str** | | [optional] + +## Example + +```python +from instant_tests_api.models.map_item import MapItem + +# TODO update the JSON string below +json = "{}" +# create an instance of MapItem from a JSON string +map_item_instance = MapItem.from_json(json) +# print the JSON string representation of the object +print MapItem.to_json() + +# convert the object into a dict +map_item_dict = map_item_instance.to_dict() +# create an instance of MapItem from a dict +map_item_form_dict = map_item.from_dict(map_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/PageLoadInstantTest.md b/instant_tests_api/docs/PageLoadInstantTest.md new file mode 100644 index 00000000..4c4327c0 --- /dev/null +++ b/instant_tests_api/docs/PageLoadInstantTest.md @@ -0,0 +1,74 @@ +# PageLoadInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Verify content using a regular expression. This field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**page_load_target_time** | **int** | Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`. | [optional] +**page_load_time_limit** | **int** | Page load time limit. Must be larger than the `httpTimeLimit`. | [optional] [default to 10] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] + +## Example + +```python +from instant_tests_api.models.page_load_instant_test import PageLoadInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of PageLoadInstantTest from a JSON string +page_load_instant_test_instance = PageLoadInstantTest.from_json(json) +# print the JSON string representation of the object +print PageLoadInstantTest.to_json() + +# convert the object into a dict +page_load_instant_test_dict = page_load_instant_test_instance.to_dict() +# create an instance of PageLoadInstantTest from a dict +page_load_instant_test_form_dict = page_load_instant_test.from_dict(page_load_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/PageLoadInstantTestRequest.md b/instant_tests_api/docs/PageLoadInstantTestRequest.md new file mode 100644 index 00000000..35425b47 --- /dev/null +++ b/instant_tests_api/docs/PageLoadInstantTestRequest.md @@ -0,0 +1,74 @@ +# PageLoadInstantTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] +**shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**agents** | [**List[InstantTestRequestAgentsInner]**](InstantTestRequestAgentsInner.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Verify content using a regular expression. This field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**page_load_target_time** | **int** | Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`. | [optional] +**page_load_time_limit** | **int** | Page load time limit. Must be larger than the `httpTimeLimit`. | [optional] [default to 10] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] + +## Example + +```python +from instant_tests_api.models.page_load_instant_test_request import PageLoadInstantTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PageLoadInstantTestRequest from a JSON string +page_load_instant_test_request_instance = PageLoadInstantTestRequest.from_json(json) +# print the JSON string representation of the object +print PageLoadInstantTestRequest.to_json() + +# convert the object into a dict +page_load_instant_test_request_dict = page_load_instant_test_request_instance.to_dict() +# create an instance of PageLoadInstantTestRequest from a dict +page_load_instant_test_request_form_dict = page_load_instant_test_request.from_dict(page_load_instant_test_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) + + diff --git a/instant_tests_api/docs/RunApi.md b/instant_tests_api/docs/RunApi.md new file mode 100644 index 00000000..a72807e5 --- /dev/null +++ b/instant_tests_api/docs/RunApi.md @@ -0,0 +1,92 @@ +# instant_tests_api.RunApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_instant_run**](RunApi.md#post_instant_run) | **POST** /v7/tests/{testId}/run | Run instant test + + +# **post_instant_run** +> post_instant_run(test_id, aid=aid) + +Run instant test + +Run an existing instant test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.RunApi(api_client) + test_id = '105' # str | Identifier for the instant test you wish to rerun. + 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: + # Run instant test + api_instance.post_instant_run(test_id, aid=aid) + except Exception as e: + print("Exception when calling RunApi->post_instant_run: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Identifier for the instant test you wish to rerun. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | +|-------------|-------------|------------------| +**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) + diff --git a/instant_tests_api/docs/SIPServerApi.md b/instant_tests_api/docs/SIPServerApi.md new file mode 100644 index 00000000..7334ec2f --- /dev/null +++ b/instant_tests_api/docs/SIPServerApi.md @@ -0,0 +1,100 @@ +# instant_tests_api.SIPServerApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_instant_sip_server**](SIPServerApi.md#post_instant_sip_server) | **POST** /v7/tests/sip-server/instant | Create SIP server instant test + + +# **post_instant_sip_server** +> SipServerInstantTest post_instant_sip_server(sip_server_instant_test_request, aid=aid, expand=expand) + +Create SIP server instant test + +Creates and runs a new SIP server instant test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_api.models.expand import Expand +from instant_tests_api.models.sip_server_instant_test import SipServerInstantTest +from instant_tests_api.models.sip_server_instant_test_request import SipServerInstantTestRequest +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.SIPServerApi(api_client) + sip_server_instant_test_request = instant_tests_api.SipServerInstantTestRequest() # SipServerInstantTestRequest | + 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 = [instant_tests_api.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create SIP server instant test + api_response = api_instance.post_instant_sip_server(sip_server_instant_test_request, aid=aid, expand=expand) + print("The response of SIPServerApi->post_instant_sip_server:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SIPServerApi->post_instant_sip_server: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sip_server_instant_test_request** | [**SipServerInstantTestRequest**](SipServerInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**SipServerInstantTest**](SipServerInstantTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/instant_tests_api/docs/ServerInstantTestRequest.md b/instant_tests_api/docs/ServerInstantTestRequest.md new file mode 100644 index 00000000..dc576c01 --- /dev/null +++ b/instant_tests_api/docs/ServerInstantTestRequest.md @@ -0,0 +1,59 @@ +# ServerInstantTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] +**shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**agents** | [**List[InstantTestRequestAgentsInner]**](InstantTestRequestAgentsInner.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**download_limit** | **int** | Specify maximum number of bytes to download from the target object. | [optional] +**ftp_target_time** | **int** | Target time for operation completion; specified in milliseconds. | [optional] +**ftp_time_limit** | **int** | Set the time limit for the test in seconds. | [optional] [default to 10] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**request_type** | [**FtpServerRequestType**](FtpServerRequestType.md) | | +**url** | **str** | Target for the test. | +**use_active_ftp** | **bool** | Explicitly set the flag to use active FTP. | [optional] [default to False] +**use_explicit_ftps** | **bool** | Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.server_instant_test_request import ServerInstantTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of ServerInstantTestRequest from a JSON string +server_instant_test_request_instance = ServerInstantTestRequest.from_json(json) +# print the JSON string representation of the object +print ServerInstantTestRequest.to_json() + +# convert the object into a dict +server_instant_test_request_dict = server_instant_test_request_instance.to_dict() +# create an instance of ServerInstantTestRequest from a dict +server_instant_test_request_form_dict = server_instant_test_request.from_dict(server_instant_test_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) + + diff --git a/instant_tests_api/docs/SipServerInstantTest.md b/instant_tests_api/docs/SipServerInstantTest.md new file mode 100644 index 00000000..e181e0cf --- /dev/null +++ b/instant_tests_api/docs/SipServerInstantTest.md @@ -0,0 +1,57 @@ +# SipServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_user** | **str** | Username for authentication with SIP server. | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**options_regex** | **str** | Options regex, this field does not require escaping. | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [default to 49153] +**protocol** | [**SipTestProtocol**](SipTestProtocol.md) | | [optional] +**register_enabled** | **bool** | Set to true to perform SIP registration on the test target with the SIP REGISTER command. | [optional] [default to False] +**sip_registrar** | **str** | SIP server to be tested, specified by domain name or IP address. | [optional] +**sip_target_time** | **int** | Target time for test completion in milliseconds. | [optional] +**sip_time_limit** | **int** | Time limit in milliseconds. | [optional] [default to 5] +**target_sip_credentials** | [**TestSipCredentials**](TestSipCredentials.md) | | +**user** | **str** | Username for SIP registration, should be unique within a ThousandEyes account group. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.sip_server_instant_test import SipServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of SipServerInstantTest from a JSON string +sip_server_instant_test_instance = SipServerInstantTest.from_json(json) +# print the JSON string representation of the object +print SipServerInstantTest.to_json() + +# convert the object into a dict +sip_server_instant_test_dict = sip_server_instant_test_instance.to_dict() +# create an instance of SipServerInstantTest from a dict +sip_server_instant_test_form_dict = sip_server_instant_test.from_dict(sip_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/SipServerInstantTestRequest.md b/instant_tests_api/docs/SipServerInstantTestRequest.md new file mode 100644 index 00000000..e7926701 --- /dev/null +++ b/instant_tests_api/docs/SipServerInstantTestRequest.md @@ -0,0 +1,57 @@ +# SipServerInstantTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] +**shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**agents** | [**List[InstantTestRequestAgentsInner]**](InstantTestRequestAgentsInner.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | +**auth_user** | **str** | Username for authentication with SIP server. | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**options_regex** | **str** | Options regex, this field does not require escaping. | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [default to 49153] +**protocol** | [**SipTestProtocol**](SipTestProtocol.md) | | [optional] +**register_enabled** | **bool** | Set to true to perform SIP registration on the test target with the SIP REGISTER command. | [optional] [default to False] +**sip_registrar** | **str** | SIP server to be tested, specified by domain name or IP address. | [optional] +**sip_target_time** | **int** | Target time for test completion in milliseconds. | [optional] +**sip_time_limit** | **int** | Time limit in milliseconds. | [optional] [default to 5] +**target_sip_credentials** | [**TestSipCredentials**](TestSipCredentials.md) | | +**user** | **str** | Username for SIP registration, should be unique within a ThousandEyes account group. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.sip_server_instant_test_request import SipServerInstantTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of SipServerInstantTestRequest from a JSON string +sip_server_instant_test_request_instance = SipServerInstantTestRequest.from_json(json) +# print the JSON string representation of the object +print SipServerInstantTestRequest.to_json() + +# convert the object into a dict +sip_server_instant_test_request_dict = sip_server_instant_test_request_instance.to_dict() +# create an instance of SipServerInstantTestRequest from a dict +sip_server_instant_test_request_form_dict = sip_server_instant_test_request.from_dict(sip_server_instant_test_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) + + diff --git a/instant_tests_api/docs/SipTestProtocol.md b/instant_tests_api/docs/SipTestProtocol.md new file mode 100644 index 00000000..624902b4 --- /dev/null +++ b/instant_tests_api/docs/SipTestProtocol.md @@ -0,0 +1,11 @@ +# SipTestProtocol + +Transport layer for SIP communication. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestAuthType.md b/instant_tests_api/docs/TestAuthType.md new file mode 100644 index 00000000..cea7b651 --- /dev/null +++ b/instant_tests_api/docs/TestAuthType.md @@ -0,0 +1,11 @@ +# TestAuthType + +HTTP authentication type. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestCustomHeaders.md b/instant_tests_api/docs/TestCustomHeaders.md new file mode 100644 index 00000000..04f1970a --- /dev/null +++ b/instant_tests_api/docs/TestCustomHeaders.md @@ -0,0 +1,30 @@ +# TestCustomHeaders + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**root** | [**TestCustomHeadersRoot**](TestCustomHeadersRoot.md) | | [optional] +**domains** | [**Dict[str, MapItem]**](MapItem.md) | Use these HTTP headers for the specified domains. | [optional] +**all** | [**TestCustomHeadersAll**](TestCustomHeadersAll.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.test_custom_headers import TestCustomHeaders + +# TODO update the JSON string below +json = "{}" +# create an instance of TestCustomHeaders from a JSON string +test_custom_headers_instance = TestCustomHeaders.from_json(json) +# print the JSON string representation of the object +print TestCustomHeaders.to_json() + +# convert the object into a dict +test_custom_headers_dict = test_custom_headers_instance.to_dict() +# create an instance of TestCustomHeaders from a dict +test_custom_headers_form_dict = test_custom_headers.from_dict(test_custom_headers_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestCustomHeadersAll.md b/instant_tests_api/docs/TestCustomHeadersAll.md new file mode 100644 index 00000000..4822d970 --- /dev/null +++ b/instant_tests_api/docs/TestCustomHeadersAll.md @@ -0,0 +1,29 @@ +# TestCustomHeadersAll + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **str** | | [optional] +**value** | **str** | | [optional] + +## Example + +```python +from instant_tests_api.models.test_custom_headers_all import TestCustomHeadersAll + +# TODO update the JSON string below +json = "{}" +# create an instance of TestCustomHeadersAll from a JSON string +test_custom_headers_all_instance = TestCustomHeadersAll.from_json(json) +# print the JSON string representation of the object +print TestCustomHeadersAll.to_json() + +# convert the object into a dict +test_custom_headers_all_dict = test_custom_headers_all_instance.to_dict() +# create an instance of TestCustomHeadersAll from a dict +test_custom_headers_all_form_dict = test_custom_headers_all.from_dict(test_custom_headers_all_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestCustomHeadersRoot.md b/instant_tests_api/docs/TestCustomHeadersRoot.md new file mode 100644 index 00000000..d420fa2e --- /dev/null +++ b/instant_tests_api/docs/TestCustomHeadersRoot.md @@ -0,0 +1,29 @@ +# TestCustomHeadersRoot + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **str** | | [optional] +**value** | **str** | | [optional] + +## Example + +```python +from instant_tests_api.models.test_custom_headers_root import TestCustomHeadersRoot + +# TODO update the JSON string below +json = "{}" +# create an instance of TestCustomHeadersRoot from a JSON string +test_custom_headers_root_instance = TestCustomHeadersRoot.from_json(json) +# print the JSON string representation of the object +print TestCustomHeadersRoot.to_json() + +# convert the object into a dict +test_custom_headers_root_dict = test_custom_headers_root_instance.to_dict() +# create an instance of TestCustomHeadersRoot from a dict +test_custom_headers_root_form_dict = test_custom_headers_root.from_dict(test_custom_headers_root_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestDirection.md b/instant_tests_api/docs/TestDirection.md new file mode 100644 index 00000000..59dab3fb --- /dev/null +++ b/instant_tests_api/docs/TestDirection.md @@ -0,0 +1,11 @@ +# TestDirection + +Direction of the test, which affects how results are shown. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestDnsServer.md b/instant_tests_api/docs/TestDnsServer.md new file mode 100644 index 00000000..b2d9e687 --- /dev/null +++ b/instant_tests_api/docs/TestDnsServer.md @@ -0,0 +1,29 @@ +# TestDnsServer + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**server_id** | **str** | Unique identifier of the DNS server. | [optional] +**server_name** | **str** | Fully qualified domain name (FQDN) of DNS server. | [optional] + +## Example + +```python +from instant_tests_api.models.test_dns_server import TestDnsServer + +# TODO update the JSON string below +json = "{}" +# create an instance of TestDnsServer from a JSON string +test_dns_server_instance = TestDnsServer.from_json(json) +# print the JSON string representation of the object +print TestDnsServer.to_json() + +# convert the object into a dict +test_dns_server_dict = test_dns_server_instance.to_dict() +# create an instance of TestDnsServer from a dict +test_dns_server_form_dict = test_dns_server.from_dict(test_dns_server_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestDnsTransportProtocol.md b/instant_tests_api/docs/TestDnsTransportProtocol.md new file mode 100644 index 00000000..1bcfdbf3 --- /dev/null +++ b/instant_tests_api/docs/TestDnsTransportProtocol.md @@ -0,0 +1,11 @@ +# TestDnsTransportProtocol + +Transport protocol used for DNS requests. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestDscpId.md b/instant_tests_api/docs/TestDscpId.md new file mode 100644 index 00000000..aa714a34 --- /dev/null +++ b/instant_tests_api/docs/TestDscpId.md @@ -0,0 +1,11 @@ +# TestDscpId + +DSCP ID [to see list for acceptable values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests) + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestIpv6Policy.md b/instant_tests_api/docs/TestIpv6Policy.md new file mode 100644 index 00000000..81e61009 --- /dev/null +++ b/instant_tests_api/docs/TestIpv6Policy.md @@ -0,0 +1,11 @@ +# TestIpv6Policy + +IP version policy. Overrides the IPv6 policy configured at the agent level. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestLabelsInner.md b/instant_tests_api/docs/TestLabelsInner.md new file mode 100644 index 00000000..63f90f1f --- /dev/null +++ b/instant_tests_api/docs/TestLabelsInner.md @@ -0,0 +1,30 @@ +# TestLabelsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label_id** | **str** | Label ID. | [optional] +**name** | **str** | Name of the label. | [optional] +**is_built_in** | **bool** | Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User). | [optional] + +## Example + +```python +from instant_tests_api.models.test_labels_inner import TestLabelsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of TestLabelsInner from a JSON string +test_labels_inner_instance = TestLabelsInner.from_json(json) +# print the JSON string representation of the object +print TestLabelsInner.to_json() + +# convert the object into a dict +test_labels_inner_dict = test_labels_inner_instance.to_dict() +# create an instance of TestLabelsInner from a dict +test_labels_inner_form_dict = test_labels_inner.from_dict(test_labels_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestPageLoadingStrategy.md b/instant_tests_api/docs/TestPageLoadingStrategy.md new file mode 100644 index 00000000..d4f92f00 --- /dev/null +++ b/instant_tests_api/docs/TestPageLoadingStrategy.md @@ -0,0 +1,11 @@ +# TestPageLoadingStrategy + +* `normal`: The test waits until the entire page is fully loaded, including the downloading and parsing of HTML content as well as all associated resources, before advancing to the next action in the transaction test script. * `eager`: The test waits for the DOMContentLoaded event, indicating that HTML content is downloaded and parsed, and the document reaches the \"interactive\" readiness state, before proceeding to the next action in the test script. * `none`: The test only waits for the download of HTML content. Once the HTML is downloaded, the test continues to the next action in the transaction test script without waiting for additional resources. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestPathTraceMode.md b/instant_tests_api/docs/TestPathTraceMode.md new file mode 100644 index 00000000..f93da70d --- /dev/null +++ b/instant_tests_api/docs/TestPathTraceMode.md @@ -0,0 +1,11 @@ +# TestPathTraceMode + +Select `inSession` to perform the path trace within a TCP session. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestProbeMode.md b/instant_tests_api/docs/TestProbeMode.md new file mode 100644 index 00000000..2e0ad614 --- /dev/null +++ b/instant_tests_api/docs/TestProbeMode.md @@ -0,0 +1,11 @@ +# TestProbeMode + +Probe mode used by network test, only valid when the protocol is set to TCP. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestProtocol.md b/instant_tests_api/docs/TestProtocol.md new file mode 100644 index 00000000..32cac130 --- /dev/null +++ b/instant_tests_api/docs/TestProtocol.md @@ -0,0 +1,11 @@ +# TestProtocol + +Protocol used by dependent network tests (end-to-end, path trace, PMTUD). + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestSharedAccountsInner.md b/instant_tests_api/docs/TestSharedAccountsInner.md new file mode 100644 index 00000000..66e01187 --- /dev/null +++ b/instant_tests_api/docs/TestSharedAccountsInner.md @@ -0,0 +1,29 @@ +# TestSharedAccountsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | Account group ID. | [optional] +**name** | **str** | Account group name. | [optional] + +## Example + +```python +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of TestSharedAccountsInner from a JSON string +test_shared_accounts_inner_instance = TestSharedAccountsInner.from_json(json) +# print the JSON string representation of the object +print TestSharedAccountsInner.to_json() + +# convert the object into a dict +test_shared_accounts_inner_dict = test_shared_accounts_inner_instance.to_dict() +# create an instance of TestSharedAccountsInner from a dict +test_shared_accounts_inner_form_dict = test_shared_accounts_inner.from_dict(test_shared_accounts_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestSipCredentials.md b/instant_tests_api/docs/TestSipCredentials.md new file mode 100644 index 00000000..7c668103 --- /dev/null +++ b/instant_tests_api/docs/TestSipCredentials.md @@ -0,0 +1,33 @@ +# TestSipCredentials + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_user** | **str** | Username for authentication with SIP server. | [optional] +**password** | **str** | Password for authentication with SIP server. | [optional] +**port** | **int** | Port number for the chosen protocol. | +**protocol** | [**SipTestProtocol**](SipTestProtocol.md) | | [optional] +**sip_registrar** | **str** | SIP server to be tested, specified by domain name or IP address. | [optional] +**user** | **str** | Username for SIP registration, should be unique within a ThousandEyes account group. | [optional] + +## Example + +```python +from instant_tests_api.models.test_sip_credentials import TestSipCredentials + +# TODO update the JSON string below +json = "{}" +# create an instance of TestSipCredentials from a JSON string +test_sip_credentials_instance = TestSipCredentials.from_json(json) +# print the JSON string representation of the object +print TestSipCredentials.to_json() + +# convert the object into a dict +test_sip_credentials_dict = test_sip_credentials_instance.to_dict() +# create an instance of TestSipCredentials from a dict +test_sip_credentials_form_dict = test_sip_credentials.from_dict(test_sip_credentials_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestSslVersionId.md b/instant_tests_api/docs/TestSslVersionId.md new file mode 100644 index 00000000..fb9ac0f8 --- /dev/null +++ b/instant_tests_api/docs/TestSslVersionId.md @@ -0,0 +1,11 @@ +# TestSslVersionId + +SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/TestType.md b/instant_tests_api/docs/TestType.md new file mode 100644 index 00000000..ae5d924e --- /dev/null +++ b/instant_tests_api/docs/TestType.md @@ -0,0 +1,11 @@ +# TestType + +This is a read only value, as test type is implicit in the test creation url. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/UnauthorizedError.md b/instant_tests_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..cf19fdd4 --- /dev/null +++ b/instant_tests_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from instant_tests_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/UnexpandedInstantTest.md b/instant_tests_api/docs/UnexpandedInstantTest.md new file mode 100644 index 00000000..93e4aa0c --- /dev/null +++ b/instant_tests_api/docs/UnexpandedInstantTest.md @@ -0,0 +1,38 @@ +# UnexpandedInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | [**TestType**](TestType.md) | | [optional] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.unexpanded_instant_test import UnexpandedInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTest from a JSON string +unexpanded_instant_test_instance = UnexpandedInstantTest.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTest.to_json() + +# convert the object into a dict +unexpanded_instant_test_dict = unexpanded_instant_test_instance.to_dict() +# create an instance of UnexpandedInstantTest from a dict +unexpanded_instant_test_form_dict = unexpanded_instant_test.from_dict(unexpanded_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/UnexpandedInstantTestLinks.md b/instant_tests_api/docs/UnexpandedInstantTestLinks.md new file mode 100644 index 00000000..f43f21a9 --- /dev/null +++ b/instant_tests_api/docs/UnexpandedInstantTestLinks.md @@ -0,0 +1,30 @@ +# UnexpandedInstantTestLinks + +A list of links that can be accessed to get more information + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**UnexpandedInstantTestLinksSelf**](UnexpandedInstantTestLinksSelf.md) | | [optional] +**test_results** | [**UnexpandedInstantTestLinksTestResults**](UnexpandedInstantTestLinksTestResults.md) | | [optional] + +## Example + +```python +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinks from a JSON string +unexpanded_instant_test_links_instance = UnexpandedInstantTestLinks.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinks.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_dict = unexpanded_instant_test_links_instance.to_dict() +# create an instance of UnexpandedInstantTestLinks from a dict +unexpanded_instant_test_links_form_dict = unexpanded_instant_test_links.from_dict(unexpanded_instant_test_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/UnexpandedInstantTestLinksSelf.md b/instant_tests_api/docs/UnexpandedInstantTestLinksSelf.md new file mode 100644 index 00000000..c398736b --- /dev/null +++ b/instant_tests_api/docs/UnexpandedInstantTestLinksSelf.md @@ -0,0 +1,35 @@ +# UnexpandedInstantTestLinksSelf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from instant_tests_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinksSelf from a JSON string +unexpanded_instant_test_links_self_instance = UnexpandedInstantTestLinksSelf.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinksSelf.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_self_dict = unexpanded_instant_test_links_self_instance.to_dict() +# create an instance of UnexpandedInstantTestLinksSelf from a dict +unexpanded_instant_test_links_self_form_dict = unexpanded_instant_test_links_self.from_dict(unexpanded_instant_test_links_self_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/UnexpandedInstantTestLinksTestResults.md b/instant_tests_api/docs/UnexpandedInstantTestLinksTestResults.md new file mode 100644 index 00000000..7239f776 --- /dev/null +++ b/instant_tests_api/docs/UnexpandedInstantTestLinksTestResults.md @@ -0,0 +1,35 @@ +# UnexpandedInstantTestLinksTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from instant_tests_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinksTestResults from a JSON string +unexpanded_instant_test_links_test_results_instance = UnexpandedInstantTestLinksTestResults.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinksTestResults.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_test_results_dict = unexpanded_instant_test_links_test_results_instance.to_dict() +# create an instance of UnexpandedInstantTestLinksTestResults from a dict +unexpanded_instant_test_links_test_results_form_dict = unexpanded_instant_test_links_test_results.from_dict(unexpanded_instant_test_links_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/VoiceApi.md b/instant_tests_api/docs/VoiceApi.md new file mode 100644 index 00000000..fe2f9140 --- /dev/null +++ b/instant_tests_api/docs/VoiceApi.md @@ -0,0 +1,100 @@ +# instant_tests_api.VoiceApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_instant_voice**](VoiceApi.md#post_instant_voice) | **POST** /v7/tests/voice/instant | Create voice instant test + + +# **post_instant_voice** +> VoiceInstantTest post_instant_voice(voice_instant_test_request, aid=aid, expand=expand) + +Create voice instant test + +Creates and runs a voice instant test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_api.models.expand import Expand +from instant_tests_api.models.voice_instant_test import VoiceInstantTest +from instant_tests_api.models.voice_instant_test_request import VoiceInstantTestRequest +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.VoiceApi(api_client) + voice_instant_test_request = instant_tests_api.VoiceInstantTestRequest() # VoiceInstantTestRequest | + 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 = [instant_tests_api.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create voice instant test + api_response = api_instance.post_instant_voice(voice_instant_test_request, aid=aid, expand=expand) + print("The response of VoiceApi->post_instant_voice:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceApi->post_instant_voice: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **voice_instant_test_request** | [**VoiceInstantTestRequest**](VoiceInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**VoiceInstantTest**](VoiceInstantTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/instant_tests_api/docs/VoiceInstantTest.md b/instant_tests_api/docs/VoiceInstantTest.md new file mode 100644 index 00000000..b9958bee --- /dev/null +++ b/instant_tests_api/docs/VoiceInstantTest.md @@ -0,0 +1,50 @@ +# VoiceInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**codec** | **str** | Codec label | [optional] [readonly] +**codec_id** | **str** | Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab) | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**duration** | **int** | Duration of the test in seconds. | [optional] [default to 5] +**jitter_buffer** | **int** | De-jitter buffer size in seconds. | [optional] [default to 40] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**port** | **int** | Port number for the chosen protocol. | [optional] +**target_agent_id** | **str** | Agent ID of the target agent for the test. | + +## Example + +```python +from instant_tests_api.models.voice_instant_test import VoiceInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of VoiceInstantTest from a JSON string +voice_instant_test_instance = VoiceInstantTest.from_json(json) +# print the JSON string representation of the object +print VoiceInstantTest.to_json() + +# convert the object into a dict +voice_instant_test_dict = voice_instant_test_instance.to_dict() +# create an instance of VoiceInstantTest from a dict +voice_instant_test_form_dict = voice_instant_test.from_dict(voice_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/VoiceInstantTestRequest.md b/instant_tests_api/docs/VoiceInstantTestRequest.md new file mode 100644 index 00000000..527a54df --- /dev/null +++ b/instant_tests_api/docs/VoiceInstantTestRequest.md @@ -0,0 +1,50 @@ +# VoiceInstantTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] +**shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**agents** | [**List[InstantTestRequestAgentsInner]**](InstantTestRequestAgentsInner.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | +**codec** | **str** | Codec label | [optional] [readonly] +**codec_id** | **str** | Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab) | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**duration** | **int** | Duration of the test in seconds. | [optional] [default to 5] +**jitter_buffer** | **int** | De-jitter buffer size in seconds. | [optional] [default to 40] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**port** | **int** | Port number for the chosen protocol. | [optional] +**target_agent_id** | **str** | Agent ID of the target agent for the test. | + +## Example + +```python +from instant_tests_api.models.voice_instant_test_request import VoiceInstantTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of VoiceInstantTestRequest from a JSON string +voice_instant_test_request_instance = VoiceInstantTestRequest.from_json(json) +# print the JSON string representation of the object +print VoiceInstantTestRequest.to_json() + +# convert the object into a dict +voice_instant_test_request_dict = voice_instant_test_request_instance.to_dict() +# create an instance of VoiceInstantTestRequest from a dict +voice_instant_test_request_form_dict = voice_instant_test_request.from_dict(voice_instant_test_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) + + diff --git a/instant_tests_api/docs/WebTransactionApi.md b/instant_tests_api/docs/WebTransactionApi.md new file mode 100644 index 00000000..129372ce --- /dev/null +++ b/instant_tests_api/docs/WebTransactionApi.md @@ -0,0 +1,100 @@ +# instant_tests_api.WebTransactionApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_instant_web_transactions**](WebTransactionApi.md#post_instant_web_transactions) | **POST** /v7/tests/web-transactions/instant | Create web transactions instant test + + +# **post_instant_web_transactions** +> WebTransactionInstantTest post_instant_web_transactions(web_transaction_instant_test_request, aid=aid, expand=expand) + +Create web transactions instant test + +Creates and runs a new Web transactions instant test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import instant_tests_api +from instant_tests_api.models.expand import Expand +from instant_tests_api.models.web_transaction_instant_test import WebTransactionInstantTest +from instant_tests_api.models.web_transaction_instant_test_request import WebTransactionInstantTestRequest +from instant_tests_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 = instant_tests_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 = instant_tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with instant_tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = instant_tests_api.WebTransactionApi(api_client) + web_transaction_instant_test_request = instant_tests_api.WebTransactionInstantTestRequest() # WebTransactionInstantTestRequest | + 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 = [instant_tests_api.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create web transactions instant test + api_response = api_instance.post_instant_web_transactions(web_transaction_instant_test_request, aid=aid, expand=expand) + print("The response of WebTransactionApi->post_instant_web_transactions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionApi->post_instant_web_transactions: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **web_transaction_instant_test_request** | [**WebTransactionInstantTestRequest**](WebTransactionInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**WebTransactionInstantTest**](WebTransactionInstantTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/instant_tests_api/docs/WebTransactionInstantTest.md b/instant_tests_api/docs/WebTransactionInstantTest.md new file mode 100644 index 00000000..06ab1af7 --- /dev/null +++ b/instant_tests_api/docs/WebTransactionInstantTest.md @@ -0,0 +1,77 @@ +# WebTransactionInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Verify content using a regular expression. This field does not require escaping. | [optional] +**credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**target_time** | **int** | Target time for completion, defaults to 50% of time limit specified in seconds. | [optional] +**time_limit** | **int** | Time limit for transaction in seconds. | [optional] [default to 30] +**transaction_script** | **str** | JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ). | +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] + +## Example + +```python +from instant_tests_api.models.web_transaction_instant_test import WebTransactionInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionInstantTest from a JSON string +web_transaction_instant_test_instance = WebTransactionInstantTest.from_json(json) +# print the JSON string representation of the object +print WebTransactionInstantTest.to_json() + +# convert the object into a dict +web_transaction_instant_test_dict = web_transaction_instant_test_instance.to_dict() +# create an instance of WebTransactionInstantTest from a dict +web_transaction_instant_test_form_dict = web_transaction_instant_test.from_dict(web_transaction_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/instant_tests_api/docs/WebTransactionInstantTestRequest.md b/instant_tests_api/docs/WebTransactionInstantTestRequest.md new file mode 100644 index 00000000..0c59b5b4 --- /dev/null +++ b/instant_tests_api/docs/WebTransactionInstantTestRequest.md @@ -0,0 +1,77 @@ +# WebTransactionInstantTestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] +**shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**agents** | [**List[InstantTestRequestAgentsInner]**](InstantTestRequestAgentsInner.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Verify content using a regular expression. This field does not require escaping. | [optional] +**credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**target_time** | **int** | Target time for completion, defaults to 50% of time limit specified in seconds. | [optional] +**time_limit** | **int** | Time limit for transaction in seconds. | [optional] [default to 30] +**transaction_script** | **str** | JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ). | +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] + +## Example + +```python +from instant_tests_api.models.web_transaction_instant_test_request import WebTransactionInstantTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionInstantTestRequest from a JSON string +web_transaction_instant_test_request_instance = WebTransactionInstantTestRequest.from_json(json) +# print the JSON string representation of the object +print WebTransactionInstantTestRequest.to_json() + +# convert the object into a dict +web_transaction_instant_test_request_dict = web_transaction_instant_test_request_instance.to_dict() +# create an instance of WebTransactionInstantTestRequest from a dict +web_transaction_instant_test_request_form_dict = web_transaction_instant_test_request.from_dict(web_transaction_instant_test_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) + + diff --git a/instant_tests_api/git_push.sh b/instant_tests_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/instant_tests_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/instant_tests_api/instant_tests_api/__init__.py b/instant_tests_api/instant_tests_api/__init__.py new file mode 100644 index 00000000..628a754a --- /dev/null +++ b/instant_tests_api/instant_tests_api/__init__.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.api.agent_to_agent_api import AgentToAgentApi +from instant_tests_api.api.agent_to_server_api import AgentToServerApi +from instant_tests_api.api.dns_security_api import DNSSecurityApi +from instant_tests_api.api.dns_server_api import DNSServerApi +from instant_tests_api.api.dns_trace_api import DNSTraceApi +from instant_tests_api.api.ftp_server_api import FTPServerApi +from instant_tests_api.api.http_page_load_api import HTTPPageLoadApi +from instant_tests_api.api.http_server_api import HTTPServerApi +from instant_tests_api.api.run_api import RunApi +from instant_tests_api.api.sip_server_api import SIPServerApi +from instant_tests_api.api.voice_api import VoiceApi +from instant_tests_api.api.web_transaction_api import WebTransactionApi + +# import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.api_client import ApiClient +from instant_tests_api.configuration import Configuration +from instant_tests_api.exceptions import OpenApiException +from instant_tests_api.exceptions import ApiTypeError +from instant_tests_api.exceptions import ApiValueError +from instant_tests_api.exceptions import ApiKeyError +from instant_tests_api.exceptions import ApiAttributeError +from instant_tests_api.exceptions import ApiException + +# import models into sdk package +from instant_tests_api.models.agent import Agent +from instant_tests_api.models.agent_base import AgentBase +from instant_tests_api.models.agent_to_agent_instant_test import AgentToAgentInstantTest +from instant_tests_api.models.agent_to_agent_instant_test_request import AgentToAgentInstantTestRequest +from instant_tests_api.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from instant_tests_api.models.agent_to_server_instant_test import AgentToServerInstantTest +from instant_tests_api.models.agent_to_server_instant_test_request import AgentToServerInstantTestRequest +from instant_tests_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from instant_tests_api.models.dns_query_class import DnsQueryClass +from instant_tests_api.models.dns_sec_instant_test import DnsSecInstantTest +from instant_tests_api.models.dns_sec_instant_test_request import DnsSecInstantTestRequest +from instant_tests_api.models.dns_server_instant_test import DnsServerInstantTest +from instant_tests_api.models.dns_server_instant_test_request import DnsServerInstantTestRequest +from instant_tests_api.models.dns_servers_request import DnsServersRequest +from instant_tests_api.models.dns_trace_instant_test import DnsTraceInstantTest +from instant_tests_api.models.dns_trace_instant_test_request import DnsTraceInstantTestRequest +from instant_tests_api.models.error import Error +from instant_tests_api.models.expand import Expand +from instant_tests_api.models.ftp_server_instant_test import FtpServerInstantTest +from instant_tests_api.models.ftp_server_request_type import FtpServerRequestType +from instant_tests_api.models.http_server_instant_test import HttpServerInstantTest +from instant_tests_api.models.http_server_instant_test_request import HttpServerInstantTestRequest +from instant_tests_api.models.instant_test import InstantTest +from instant_tests_api.models.instant_test_request import InstantTestRequest +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +from instant_tests_api.models.link import Link +from instant_tests_api.models.map_item import MapItem +from instant_tests_api.models.page_load_instant_test import PageLoadInstantTest +from instant_tests_api.models.page_load_instant_test_request import PageLoadInstantTestRequest +from instant_tests_api.models.server_instant_test_request import ServerInstantTestRequest +from instant_tests_api.models.sip_server_instant_test import SipServerInstantTest +from instant_tests_api.models.sip_server_instant_test_request import SipServerInstantTestRequest +from instant_tests_api.models.sip_test_protocol import SipTestProtocol +from instant_tests_api.models.test_auth_type import TestAuthType +from instant_tests_api.models.test_custom_headers import TestCustomHeaders +from instant_tests_api.models.test_custom_headers_all import TestCustomHeadersAll +from instant_tests_api.models.test_custom_headers_root import TestCustomHeadersRoot +from instant_tests_api.models.test_direction import TestDirection +from instant_tests_api.models.test_dns_server import TestDnsServer +from instant_tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from instant_tests_api.models.test_dscp_id import TestDscpId +from instant_tests_api.models.test_ipv6_policy import TestIpv6Policy +from instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.test_sip_credentials import TestSipCredentials +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId +from instant_tests_api.models.test_type import TestType +from instant_tests_api.models.unauthorized_error import UnauthorizedError +from instant_tests_api.models.unexpanded_instant_test import UnexpandedInstantTest +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +from instant_tests_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf +from instant_tests_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults +from instant_tests_api.models.voice_instant_test import VoiceInstantTest +from instant_tests_api.models.voice_instant_test_request import VoiceInstantTestRequest +from instant_tests_api.models.web_transaction_instant_test import WebTransactionInstantTest +from instant_tests_api.models.web_transaction_instant_test_request import WebTransactionInstantTestRequest diff --git a/instant_tests_api/instant_tests_api/api/__init__.py b/instant_tests_api/instant_tests_api/api/__init__.py new file mode 100644 index 00000000..8ebd7d65 --- /dev/null +++ b/instant_tests_api/instant_tests_api/api/__init__.py @@ -0,0 +1,16 @@ +# flake8: noqa + +# import apis into api package +from instant_tests_api.api.agent_to_agent_api import AgentToAgentApi +from instant_tests_api.api.agent_to_server_api import AgentToServerApi +from instant_tests_api.api.dns_security_api import DNSSecurityApi +from instant_tests_api.api.dns_server_api import DNSServerApi +from instant_tests_api.api.dns_trace_api import DNSTraceApi +from instant_tests_api.api.ftp_server_api import FTPServerApi +from instant_tests_api.api.http_page_load_api import HTTPPageLoadApi +from instant_tests_api.api.http_server_api import HTTPServerApi +from instant_tests_api.api.run_api import RunApi +from instant_tests_api.api.sip_server_api import SIPServerApi +from instant_tests_api.api.voice_api import VoiceApi +from instant_tests_api.api.web_transaction_api import WebTransactionApi + diff --git a/instant_tests_api/instant_tests_api/api/agent_to_agent_api.py b/instant_tests_api/instant_tests_api/api/agent_to_agent_api.py new file mode 100644 index 00000000..6a0bd0c6 --- /dev/null +++ b/instant_tests_api/instant_tests_api/api/agent_to_agent_api.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.agent_to_agent_instant_test import AgentToAgentInstantTest +from instant_tests_api.models.agent_to_agent_instant_test_request import AgentToAgentInstantTestRequest +from instant_tests_api.models.expand import Expand + +from instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class AgentToAgentApi: + """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 post_instant_test_agent_to_agent( + self, + agent_to_agent_instant_test_request: AgentToAgentInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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, + ) -> AgentToAgentInstantTest: + """Create agent-to-agent instant test + + Creates and runs a new agent-to-agent instant test. + + :param agent_to_agent_instant_test_request: (required) + :type agent_to_agent_instant_test_request: AgentToAgentInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_test_agent_to_agent_serialize( + agent_to_agent_instant_test_request=agent_to_agent_instant_test_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]] = { + '201': "AgentToAgentInstantTest", + '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 post_instant_test_agent_to_agent_with_http_info( + self, + agent_to_agent_instant_test_request: AgentToAgentInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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[AgentToAgentInstantTest]: + """Create agent-to-agent instant test + + Creates and runs a new agent-to-agent instant test. + + :param agent_to_agent_instant_test_request: (required) + :type agent_to_agent_instant_test_request: AgentToAgentInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_test_agent_to_agent_serialize( + agent_to_agent_instant_test_request=agent_to_agent_instant_test_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]] = { + '201': "AgentToAgentInstantTest", + '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 post_instant_test_agent_to_agent_without_preload_content( + self, + agent_to_agent_instant_test_request: AgentToAgentInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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: + """Create agent-to-agent instant test + + Creates and runs a new agent-to-agent instant test. + + :param agent_to_agent_instant_test_request: (required) + :type agent_to_agent_instant_test_request: AgentToAgentInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_test_agent_to_agent_serialize( + agent_to_agent_instant_test_request=agent_to_agent_instant_test_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]] = { + '201': "AgentToAgentInstantTest", + '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 _post_instant_test_agent_to_agent_serialize( + self, + agent_to_agent_instant_test_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 + # 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 agent_to_agent_instant_test_request is not None: + _body_params = agent_to_agent_instant_test_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/tests/agent-to-agent/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/instant_tests_api/instant_tests_api/api/agent_to_server_api.py b/instant_tests_api/instant_tests_api/api/agent_to_server_api.py new file mode 100644 index 00000000..5a98cf7a --- /dev/null +++ b/instant_tests_api/instant_tests_api/api/agent_to_server_api.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.agent_to_server_instant_test import AgentToServerInstantTest +from instant_tests_api.models.agent_to_server_instant_test_request import AgentToServerInstantTestRequest +from instant_tests_api.models.expand import Expand + +from instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class AgentToServerApi: + """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 post_instant_agent_to_server( + self, + agent_to_server_instant_test_request: AgentToServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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, + ) -> AgentToServerInstantTest: + """Create agent-to-server instant test + + Creates and runs a new agent-to-server instant test. + + :param agent_to_server_instant_test_request: (required) + :type agent_to_server_instant_test_request: AgentToServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_agent_to_server_serialize( + agent_to_server_instant_test_request=agent_to_server_instant_test_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]] = { + '201': "AgentToServerInstantTest", + '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 post_instant_agent_to_server_with_http_info( + self, + agent_to_server_instant_test_request: AgentToServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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[AgentToServerInstantTest]: + """Create agent-to-server instant test + + Creates and runs a new agent-to-server instant test. + + :param agent_to_server_instant_test_request: (required) + :type agent_to_server_instant_test_request: AgentToServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_agent_to_server_serialize( + agent_to_server_instant_test_request=agent_to_server_instant_test_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]] = { + '201': "AgentToServerInstantTest", + '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 post_instant_agent_to_server_without_preload_content( + self, + agent_to_server_instant_test_request: AgentToServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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: + """Create agent-to-server instant test + + Creates and runs a new agent-to-server instant test. + + :param agent_to_server_instant_test_request: (required) + :type agent_to_server_instant_test_request: AgentToServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_agent_to_server_serialize( + agent_to_server_instant_test_request=agent_to_server_instant_test_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]] = { + '201': "AgentToServerInstantTest", + '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 _post_instant_agent_to_server_serialize( + self, + agent_to_server_instant_test_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 + # 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 agent_to_server_instant_test_request is not None: + _body_params = agent_to_server_instant_test_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/tests/agent-to-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/instant_tests_api/instant_tests_api/api/dns_security_api.py b/instant_tests_api/instant_tests_api/api/dns_security_api.py new file mode 100644 index 00000000..d19522be --- /dev/null +++ b/instant_tests_api/instant_tests_api/api/dns_security_api.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.dns_sec_instant_test import DnsSecInstantTest +from instant_tests_api.models.dns_sec_instant_test_request import DnsSecInstantTestRequest +from instant_tests_api.models.expand import Expand + +from instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class DNSSecurityApi: + """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 post_instant_dns_sec( + self, + dns_sec_instant_test_request: DnsSecInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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, + ) -> DnsSecInstantTest: + """Create DNS security instant test + + Creates and runs a new DNS security instant test. + + :param dns_sec_instant_test_request: (required) + :type dns_sec_instant_test_request: DnsSecInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_dns_sec_serialize( + dns_sec_instant_test_request=dns_sec_instant_test_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]] = { + '201': "DnsSecInstantTest", + '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 post_instant_dns_sec_with_http_info( + self, + dns_sec_instant_test_request: DnsSecInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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[DnsSecInstantTest]: + """Create DNS security instant test + + Creates and runs a new DNS security instant test. + + :param dns_sec_instant_test_request: (required) + :type dns_sec_instant_test_request: DnsSecInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_dns_sec_serialize( + dns_sec_instant_test_request=dns_sec_instant_test_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]] = { + '201': "DnsSecInstantTest", + '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 post_instant_dns_sec_without_preload_content( + self, + dns_sec_instant_test_request: DnsSecInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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: + """Create DNS security instant test + + Creates and runs a new DNS security instant test. + + :param dns_sec_instant_test_request: (required) + :type dns_sec_instant_test_request: DnsSecInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_dns_sec_serialize( + dns_sec_instant_test_request=dns_sec_instant_test_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]] = { + '201': "DnsSecInstantTest", + '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 _post_instant_dns_sec_serialize( + self, + dns_sec_instant_test_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 + # 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 dns_sec_instant_test_request is not None: + _body_params = dns_sec_instant_test_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/tests/dnssec/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/instant_tests_api/instant_tests_api/api/dns_server_api.py b/instant_tests_api/instant_tests_api/api/dns_server_api.py new file mode 100644 index 00000000..4ebde311 --- /dev/null +++ b/instant_tests_api/instant_tests_api/api/dns_server_api.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.dns_server_instant_test import DnsServerInstantTest +from instant_tests_api.models.dns_server_instant_test_request import DnsServerInstantTestRequest +from instant_tests_api.models.expand import Expand + +from instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class DNSServerApi: + """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 post_instant_dns_server( + self, + dns_server_instant_test_request: DnsServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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, + ) -> DnsServerInstantTest: + """Create DNS server instant test + + Creates and runs a new DNS server instant test. + + :param dns_server_instant_test_request: (required) + :type dns_server_instant_test_request: DnsServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_dns_server_serialize( + dns_server_instant_test_request=dns_server_instant_test_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]] = { + '201': "DnsServerInstantTest", + '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 post_instant_dns_server_with_http_info( + self, + dns_server_instant_test_request: DnsServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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[DnsServerInstantTest]: + """Create DNS server instant test + + Creates and runs a new DNS server instant test. + + :param dns_server_instant_test_request: (required) + :type dns_server_instant_test_request: DnsServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_dns_server_serialize( + dns_server_instant_test_request=dns_server_instant_test_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]] = { + '201': "DnsServerInstantTest", + '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 post_instant_dns_server_without_preload_content( + self, + dns_server_instant_test_request: DnsServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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: + """Create DNS server instant test + + Creates and runs a new DNS server instant test. + + :param dns_server_instant_test_request: (required) + :type dns_server_instant_test_request: DnsServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_dns_server_serialize( + dns_server_instant_test_request=dns_server_instant_test_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]] = { + '201': "DnsServerInstantTest", + '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 _post_instant_dns_server_serialize( + self, + dns_server_instant_test_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 + # 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 dns_server_instant_test_request is not None: + _body_params = dns_server_instant_test_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/tests/dns-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/instant_tests_api/instant_tests_api/api/dns_trace_api.py b/instant_tests_api/instant_tests_api/api/dns_trace_api.py new file mode 100644 index 00000000..bfe06f68 --- /dev/null +++ b/instant_tests_api/instant_tests_api/api/dns_trace_api.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.dns_trace_instant_test import DnsTraceInstantTest +from instant_tests_api.models.dns_trace_instant_test_request import DnsTraceInstantTestRequest +from instant_tests_api.models.expand import Expand + +from instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class DNSTraceApi: + """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 post_instant_dns_trace( + self, + dns_trace_instant_test_request: DnsTraceInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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, + ) -> DnsTraceInstantTest: + """Create DNS trace instant test + + Creates and runs a new DNS trace instant test. + + :param dns_trace_instant_test_request: (required) + :type dns_trace_instant_test_request: DnsTraceInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_dns_trace_serialize( + dns_trace_instant_test_request=dns_trace_instant_test_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]] = { + '201': "DnsTraceInstantTest", + '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 post_instant_dns_trace_with_http_info( + self, + dns_trace_instant_test_request: DnsTraceInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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[DnsTraceInstantTest]: + """Create DNS trace instant test + + Creates and runs a new DNS trace instant test. + + :param dns_trace_instant_test_request: (required) + :type dns_trace_instant_test_request: DnsTraceInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_dns_trace_serialize( + dns_trace_instant_test_request=dns_trace_instant_test_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]] = { + '201': "DnsTraceInstantTest", + '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 post_instant_dns_trace_without_preload_content( + self, + dns_trace_instant_test_request: DnsTraceInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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: + """Create DNS trace instant test + + Creates and runs a new DNS trace instant test. + + :param dns_trace_instant_test_request: (required) + :type dns_trace_instant_test_request: DnsTraceInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_dns_trace_serialize( + dns_trace_instant_test_request=dns_trace_instant_test_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]] = { + '201': "DnsTraceInstantTest", + '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 _post_instant_dns_trace_serialize( + self, + dns_trace_instant_test_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 + # 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 dns_trace_instant_test_request is not None: + _body_params = dns_trace_instant_test_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/tests/dns-trace/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/instant_tests_api/instant_tests_api/api/ftp_server_api.py b/instant_tests_api/instant_tests_api/api/ftp_server_api.py new file mode 100644 index 00000000..f07eae29 --- /dev/null +++ b/instant_tests_api/instant_tests_api/api/ftp_server_api.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.expand import Expand +from instant_tests_api.models.ftp_server_instant_test import FtpServerInstantTest +from instant_tests_api.models.server_instant_test_request import ServerInstantTestRequest + +from instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class FTPServerApi: + """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 post_instant_ftp_server( + self, + server_instant_test_request: ServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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, + ) -> FtpServerInstantTest: + """Create FTP server instant test + + Creates and runs a new FTP server instant test. + + :param server_instant_test_request: (required) + :type server_instant_test_request: ServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_ftp_server_serialize( + server_instant_test_request=server_instant_test_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]] = { + '201': "FtpServerInstantTest", + '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 post_instant_ftp_server_with_http_info( + self, + server_instant_test_request: ServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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[FtpServerInstantTest]: + """Create FTP server instant test + + Creates and runs a new FTP server instant test. + + :param server_instant_test_request: (required) + :type server_instant_test_request: ServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_ftp_server_serialize( + server_instant_test_request=server_instant_test_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]] = { + '201': "FtpServerInstantTest", + '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 post_instant_ftp_server_without_preload_content( + self, + server_instant_test_request: ServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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: + """Create FTP server instant test + + Creates and runs a new FTP server instant test. + + :param server_instant_test_request: (required) + :type server_instant_test_request: ServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_ftp_server_serialize( + server_instant_test_request=server_instant_test_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]] = { + '201': "FtpServerInstantTest", + '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 _post_instant_ftp_server_serialize( + self, + server_instant_test_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 + # 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 server_instant_test_request is not None: + _body_params = server_instant_test_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/tests/ftp-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/instant_tests_api/instant_tests_api/api/http_page_load_api.py b/instant_tests_api/instant_tests_api/api/http_page_load_api.py new file mode 100644 index 00000000..8641088f --- /dev/null +++ b/instant_tests_api/instant_tests_api/api/http_page_load_api.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.expand import Expand +from instant_tests_api.models.page_load_instant_test import PageLoadInstantTest +from instant_tests_api.models.page_load_instant_test_request import PageLoadInstantTestRequest + +from instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class HTTPPageLoadApi: + """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 post_instant_http_page_load( + self, + page_load_instant_test_request: PageLoadInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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, + ) -> PageLoadInstantTest: + """Create HTTP page load instant test + + Creates and runs a new HTTP page load instant test. + + :param page_load_instant_test_request: (required) + :type page_load_instant_test_request: PageLoadInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_http_page_load_serialize( + page_load_instant_test_request=page_load_instant_test_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]] = { + '201': "PageLoadInstantTest", + '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 post_instant_http_page_load_with_http_info( + self, + page_load_instant_test_request: PageLoadInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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[PageLoadInstantTest]: + """Create HTTP page load instant test + + Creates and runs a new HTTP page load instant test. + + :param page_load_instant_test_request: (required) + :type page_load_instant_test_request: PageLoadInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_http_page_load_serialize( + page_load_instant_test_request=page_load_instant_test_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]] = { + '201': "PageLoadInstantTest", + '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 post_instant_http_page_load_without_preload_content( + self, + page_load_instant_test_request: PageLoadInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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: + """Create HTTP page load instant test + + Creates and runs a new HTTP page load instant test. + + :param page_load_instant_test_request: (required) + :type page_load_instant_test_request: PageLoadInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_http_page_load_serialize( + page_load_instant_test_request=page_load_instant_test_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]] = { + '201': "PageLoadInstantTest", + '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 _post_instant_http_page_load_serialize( + self, + page_load_instant_test_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 + # 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 page_load_instant_test_request is not None: + _body_params = page_load_instant_test_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/tests/page-load/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/instant_tests_api/instant_tests_api/api/http_server_api.py b/instant_tests_api/instant_tests_api/api/http_server_api.py new file mode 100644 index 00000000..0a1a386b --- /dev/null +++ b/instant_tests_api/instant_tests_api/api/http_server_api.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.expand import Expand +from instant_tests_api.models.http_server_instant_test import HttpServerInstantTest +from instant_tests_api.models.http_server_instant_test_request import HttpServerInstantTestRequest + +from instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class HTTPServerApi: + """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 post_instant_http_server( + self, + http_server_instant_test_request: HttpServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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, + ) -> HttpServerInstantTest: + """Create HTTP server instant test + + Creates and runs a new HTTP server instant test. + + :param http_server_instant_test_request: (required) + :type http_server_instant_test_request: HttpServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_http_server_serialize( + http_server_instant_test_request=http_server_instant_test_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]] = { + '201': "HttpServerInstantTest", + '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 post_instant_http_server_with_http_info( + self, + http_server_instant_test_request: HttpServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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[HttpServerInstantTest]: + """Create HTTP server instant test + + Creates and runs a new HTTP server instant test. + + :param http_server_instant_test_request: (required) + :type http_server_instant_test_request: HttpServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_http_server_serialize( + http_server_instant_test_request=http_server_instant_test_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]] = { + '201': "HttpServerInstantTest", + '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 post_instant_http_server_without_preload_content( + self, + http_server_instant_test_request: HttpServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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: + """Create HTTP server instant test + + Creates and runs a new HTTP server instant test. + + :param http_server_instant_test_request: (required) + :type http_server_instant_test_request: HttpServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_http_server_serialize( + http_server_instant_test_request=http_server_instant_test_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]] = { + '201': "HttpServerInstantTest", + '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 _post_instant_http_server_serialize( + self, + http_server_instant_test_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 + # 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 http_server_instant_test_request is not None: + _body_params = http_server_instant_test_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/tests/http-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/instant_tests_api/instant_tests_api/api/run_api.py b/instant_tests_api/instant_tests_api/api/run_api.py new file mode 100644 index 00000000..9c76a525 --- /dev/null +++ b/instant_tests_api/instant_tests_api/api/run_api.py @@ -0,0 +1,325 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class RunApi: + """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 post_instant_run( + self, + test_id: Annotated[StrictStr, Field(description="Identifier for the instant test you wish to rerun.")], + 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, + ) -> None: + """Run instant test + + Run an existing instant test. + + :param test_id: Identifier for the instant test you wish to rerun. (required) + :type test_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._post_instant_run_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 post_instant_run_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Identifier for the instant test you wish to rerun.")], + 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[None]: + """Run instant test + + Run an existing instant test. + + :param test_id: Identifier for the instant test you wish to rerun. (required) + :type test_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._post_instant_run_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 post_instant_run_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Identifier for the instant test you wish to rerun.")], + 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: + """Run instant test + + Run an existing instant test. + + :param test_id: Identifier for the instant test you wish to rerun. (required) + :type test_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._post_instant_run_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _post_instant_run_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v7/tests/{testId}/run', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/instant_tests_api/instant_tests_api/api/sip_server_api.py b/instant_tests_api/instant_tests_api/api/sip_server_api.py new file mode 100644 index 00000000..f49b7888 --- /dev/null +++ b/instant_tests_api/instant_tests_api/api/sip_server_api.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.expand import Expand +from instant_tests_api.models.sip_server_instant_test import SipServerInstantTest +from instant_tests_api.models.sip_server_instant_test_request import SipServerInstantTestRequest + +from instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class SIPServerApi: + """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 post_instant_sip_server( + self, + sip_server_instant_test_request: SipServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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, + ) -> SipServerInstantTest: + """Create SIP server instant test + + Creates and runs a new SIP server instant test. + + :param sip_server_instant_test_request: (required) + :type sip_server_instant_test_request: SipServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_sip_server_serialize( + sip_server_instant_test_request=sip_server_instant_test_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]] = { + '201': "SipServerInstantTest", + '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 post_instant_sip_server_with_http_info( + self, + sip_server_instant_test_request: SipServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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[SipServerInstantTest]: + """Create SIP server instant test + + Creates and runs a new SIP server instant test. + + :param sip_server_instant_test_request: (required) + :type sip_server_instant_test_request: SipServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_sip_server_serialize( + sip_server_instant_test_request=sip_server_instant_test_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]] = { + '201': "SipServerInstantTest", + '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 post_instant_sip_server_without_preload_content( + self, + sip_server_instant_test_request: SipServerInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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: + """Create SIP server instant test + + Creates and runs a new SIP server instant test. + + :param sip_server_instant_test_request: (required) + :type sip_server_instant_test_request: SipServerInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_sip_server_serialize( + sip_server_instant_test_request=sip_server_instant_test_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]] = { + '201': "SipServerInstantTest", + '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 _post_instant_sip_server_serialize( + self, + sip_server_instant_test_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 + # 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 sip_server_instant_test_request is not None: + _body_params = sip_server_instant_test_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/tests/sip-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/instant_tests_api/instant_tests_api/api/voice_api.py b/instant_tests_api/instant_tests_api/api/voice_api.py new file mode 100644 index 00000000..b4060d86 --- /dev/null +++ b/instant_tests_api/instant_tests_api/api/voice_api.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.expand import Expand +from instant_tests_api.models.voice_instant_test import VoiceInstantTest +from instant_tests_api.models.voice_instant_test_request import VoiceInstantTestRequest + +from instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class VoiceApi: + """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 post_instant_voice( + self, + voice_instant_test_request: VoiceInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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, + ) -> VoiceInstantTest: + """Create voice instant test + + Creates and runs a voice instant test. + + :param voice_instant_test_request: (required) + :type voice_instant_test_request: VoiceInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_voice_serialize( + voice_instant_test_request=voice_instant_test_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]] = { + '201': "VoiceInstantTest", + '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 post_instant_voice_with_http_info( + self, + voice_instant_test_request: VoiceInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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[VoiceInstantTest]: + """Create voice instant test + + Creates and runs a voice instant test. + + :param voice_instant_test_request: (required) + :type voice_instant_test_request: VoiceInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_voice_serialize( + voice_instant_test_request=voice_instant_test_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]] = { + '201': "VoiceInstantTest", + '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 post_instant_voice_without_preload_content( + self, + voice_instant_test_request: VoiceInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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: + """Create voice instant test + + Creates and runs a voice instant test. + + :param voice_instant_test_request: (required) + :type voice_instant_test_request: VoiceInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_voice_serialize( + voice_instant_test_request=voice_instant_test_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]] = { + '201': "VoiceInstantTest", + '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 _post_instant_voice_serialize( + self, + voice_instant_test_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 + # 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 voice_instant_test_request is not None: + _body_params = voice_instant_test_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/tests/voice/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/instant_tests_api/instant_tests_api/api/web_transaction_api.py b/instant_tests_api/instant_tests_api/api/web_transaction_api.py new file mode 100644 index 00000000..db409ce4 --- /dev/null +++ b/instant_tests_api/instant_tests_api/api/web_transaction_api.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.expand import Expand +from instant_tests_api.models.web_transaction_instant_test import WebTransactionInstantTest +from instant_tests_api.models.web_transaction_instant_test_request import WebTransactionInstantTestRequest + +from instant_tests_api.api_client import ApiClient +from instant_tests_api.api_response import ApiResponse +from instant_tests_api.rest import RESTResponseType + + +class WebTransactionApi: + """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 post_instant_web_transactions( + self, + web_transaction_instant_test_request: WebTransactionInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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, + ) -> WebTransactionInstantTest: + """Create web transactions instant test + + Creates and runs a new Web transactions instant test. + + :param web_transaction_instant_test_request: (required) + :type web_transaction_instant_test_request: WebTransactionInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_web_transactions_serialize( + web_transaction_instant_test_request=web_transaction_instant_test_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]] = { + '201': "WebTransactionInstantTest", + '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 post_instant_web_transactions_with_http_info( + self, + web_transaction_instant_test_request: WebTransactionInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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[WebTransactionInstantTest]: + """Create web transactions instant test + + Creates and runs a new Web transactions instant test. + + :param web_transaction_instant_test_request: (required) + :type web_transaction_instant_test_request: WebTransactionInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_web_transactions_serialize( + web_transaction_instant_test_request=web_transaction_instant_test_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]] = { + '201': "WebTransactionInstantTest", + '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 post_instant_web_transactions_without_preload_content( + self, + web_transaction_instant_test_request: WebTransactionInstantTestRequest, + 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[Expand]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = 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: + """Create web transactions instant test + + Creates and runs a new Web transactions instant test. + + :param web_transaction_instant_test_request: (required) + :type web_transaction_instant_test_request: WebTransactionInstantTestRequest + :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) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[Expand] + :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._post_instant_web_transactions_serialize( + web_transaction_instant_test_request=web_transaction_instant_test_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]] = { + '201': "WebTransactionInstantTest", + '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 _post_instant_web_transactions_serialize( + self, + web_transaction_instant_test_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 + # 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 web_transaction_instant_test_request is not None: + _body_params = web_transaction_instant_test_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/tests/web-transactions/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/instant_tests_api/instant_tests_api/api_client.py b/instant_tests_api/instant_tests_api/api_client.py new file mode 100644 index 00000000..4a8d09e9 --- /dev/null +++ b/instant_tests_api/instant_tests_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.configuration import Configuration +from instant_tests_api.api_response import ApiResponse +import instant_tests_api.models +from instant_tests_api import rest +from instant_tests_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(instant_tests_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) diff --git a/instant_tests_api/instant_tests_api/api_response.py b/instant_tests_api/instant_tests_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/instant_tests_api/instant_tests_api/api_response.py @@ -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 + } diff --git a/instant_tests_api/instant_tests_api/configuration.py b/instant_tests_api/instant_tests_api/configuration.py new file mode 100644 index 00000000..6465abed --- /dev/null +++ b/instant_tests_api/instant_tests_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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("instant_tests_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 diff --git a/instant_tests_api/instant_tests_api/exceptions.py b/instant_tests_api/instant_tests_api/exceptions.py new file mode 100644 index 00000000..b49918fa --- /dev/null +++ b/instant_tests_api/instant_tests_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 diff --git a/instant_tests_api/instant_tests_api/models/__init__.py b/instant_tests_api/instant_tests_api/models/__init__.py new file mode 100644 index 00000000..72b21e0c --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/__init__.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +# flake8: noqa +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.agent import Agent +from instant_tests_api.models.agent_base import AgentBase +from instant_tests_api.models.agent_to_agent_instant_test import AgentToAgentInstantTest +from instant_tests_api.models.agent_to_agent_instant_test_request import AgentToAgentInstantTestRequest +from instant_tests_api.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from instant_tests_api.models.agent_to_server_instant_test import AgentToServerInstantTest +from instant_tests_api.models.agent_to_server_instant_test_request import AgentToServerInstantTestRequest +from instant_tests_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from instant_tests_api.models.dns_query_class import DnsQueryClass +from instant_tests_api.models.dns_sec_instant_test import DnsSecInstantTest +from instant_tests_api.models.dns_sec_instant_test_request import DnsSecInstantTestRequest +from instant_tests_api.models.dns_server_instant_test import DnsServerInstantTest +from instant_tests_api.models.dns_server_instant_test_request import DnsServerInstantTestRequest +from instant_tests_api.models.dns_servers_request import DnsServersRequest +from instant_tests_api.models.dns_trace_instant_test import DnsTraceInstantTest +from instant_tests_api.models.dns_trace_instant_test_request import DnsTraceInstantTestRequest +from instant_tests_api.models.error import Error +from instant_tests_api.models.expand import Expand +from instant_tests_api.models.ftp_server_instant_test import FtpServerInstantTest +from instant_tests_api.models.ftp_server_request_type import FtpServerRequestType +from instant_tests_api.models.http_server_instant_test import HttpServerInstantTest +from instant_tests_api.models.http_server_instant_test_request import HttpServerInstantTestRequest +from instant_tests_api.models.instant_test import InstantTest +from instant_tests_api.models.instant_test_request import InstantTestRequest +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +from instant_tests_api.models.link import Link +from instant_tests_api.models.map_item import MapItem +from instant_tests_api.models.page_load_instant_test import PageLoadInstantTest +from instant_tests_api.models.page_load_instant_test_request import PageLoadInstantTestRequest +from instant_tests_api.models.server_instant_test_request import ServerInstantTestRequest +from instant_tests_api.models.sip_server_instant_test import SipServerInstantTest +from instant_tests_api.models.sip_server_instant_test_request import SipServerInstantTestRequest +from instant_tests_api.models.sip_test_protocol import SipTestProtocol +from instant_tests_api.models.test_auth_type import TestAuthType +from instant_tests_api.models.test_custom_headers import TestCustomHeaders +from instant_tests_api.models.test_custom_headers_all import TestCustomHeadersAll +from instant_tests_api.models.test_custom_headers_root import TestCustomHeadersRoot +from instant_tests_api.models.test_direction import TestDirection +from instant_tests_api.models.test_dns_server import TestDnsServer +from instant_tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from instant_tests_api.models.test_dscp_id import TestDscpId +from instant_tests_api.models.test_ipv6_policy import TestIpv6Policy +from instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.test_sip_credentials import TestSipCredentials +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId +from instant_tests_api.models.test_type import TestType +from instant_tests_api.models.unauthorized_error import UnauthorizedError +from instant_tests_api.models.unexpanded_instant_test import UnexpandedInstantTest +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +from instant_tests_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf +from instant_tests_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults +from instant_tests_api.models.voice_instant_test import VoiceInstantTest +from instant_tests_api.models.voice_instant_test_request import VoiceInstantTestRequest +from instant_tests_api.models.web_transaction_instant_test import WebTransactionInstantTest +from instant_tests_api.models.web_transaction_instant_test_request import WebTransactionInstantTestRequest diff --git a/instant_tests_api/instant_tests_api/models/agent.py b/instant_tests_api/instant_tests_api/models/agent.py new file mode 100644 index 00000000..df721d19 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/agent.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_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 agent’s 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 + + diff --git a/instant_tests_api/instant_tests_api/models/agent_base.py b/instant_tests_api/instant_tests_api/models/agent_base.py new file mode 100644 index 00000000..0dc01f42 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/agent_base.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 agent’s 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 + + diff --git a/instant_tests_api/instant_tests_api/models/agent_to_agent_instant_test.py b/instant_tests_api/instant_tests_api/models/agent_to_agent_instant_test.py new file mode 100644 index 00000000..bac133dd --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/agent_to_agent_instant_test.py @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.agent import Agent +from instant_tests_api.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from instant_tests_api.models.test_direction import TestDirection +from instant_tests_api.models.test_dscp_id import TestDscpId +from instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AgentToAgentInstantTest(BaseModel): + """ + AgentToAgentInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + direction: Optional[TestDirection] = None + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + mss: Optional[Annotated[int, Field(le=1400, strict=True, ge=20)]] = Field(default=None, description="Maximum segment size, in bytes.") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + protocol: Optional[AgentToAgentTestProtocol] = None + target_agent_id: StrictStr = Field(description="`agentId` of the target agent for the test.", alias="targetAgentId") + throughput_measurements: Optional[StrictBool] = Field(default=False, description="Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent.", alias="throughputMeasurements") + throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration") + throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate"] + + 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 AgentToAgentInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 AgentToAgentInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "direction": obj.get("direction"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "mss": obj.get("mss"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "targetAgentId": obj.get("targetAgentId"), + "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False, + "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000, + "throughputRate": obj.get("throughputRate"), + "fixedPacketRate": obj.get("fixedPacketRate") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/agent_to_agent_instant_test_request.py b/instant_tests_api/instant_tests_api/models/agent_to_agent_instant_test_request.py new file mode 100644 index 00000000..581c355e --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/agent_to_agent_instant_test_request.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +from instant_tests_api.models.test_direction import TestDirection +from instant_tests_api.models.test_dscp_id import TestDscpId +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AgentToAgentInstantTestRequest(BaseModel): + """ + AgentToAgentInstantTestRequest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + agents: List[InstantTestRequestAgentsInner] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + direction: Optional[TestDirection] = None + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + mss: Optional[Annotated[int, Field(le=1400, strict=True, ge=20)]] = Field(default=None, description="Maximum segment size, in bytes.") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + protocol: Optional[AgentToAgentTestProtocol] = None + target_agent_id: StrictStr = Field(description="`agentId` of the target agent for the test.", alias="targetAgentId") + throughput_measurements: Optional[StrictBool] = Field(default=False, description="Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent.", alias="throughputMeasurements") + throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration") + throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate"] + + 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 AgentToAgentInstantTestRequest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 AgentToAgentInstantTestRequest 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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [InstantTestRequestAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "direction": obj.get("direction"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "mss": obj.get("mss"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "targetAgentId": obj.get("targetAgentId"), + "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False, + "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000, + "throughputRate": obj.get("throughputRate"), + "fixedPacketRate": obj.get("fixedPacketRate") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/agent_to_agent_test_protocol.py b/instant_tests_api/instant_tests_api/models/agent_to_agent_test_protocol.py new file mode 100644 index 00000000..3a7f1133 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/agent_to_agent_test_protocol.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 AgentToAgentTestProtocol(str, Enum): + """ + AgentToAgentTestProtocol + """ + + """ + allowed enum values + """ + TCP = 'tcp' + UDP = 'udp' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AgentToAgentTestProtocol from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/agent_to_server_instant_test.py b/instant_tests_api/instant_tests_api/models/agent_to_server_instant_test.py new file mode 100644 index 00000000..6495a9b2 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/agent_to_server_instant_test.py @@ -0,0 +1,202 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.agent import Agent +from instant_tests_api.models.test_dscp_id import TestDscpId +from instant_tests_api.models.test_ipv6_policy import TestIpv6Policy +from instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AgentToServerInstantTest(BaseModel): + """ + AgentToServerInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + continuous_mode: Optional[StrictBool] = Field(default=None, description="To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. ", alias="continuousMode") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1`", alias="fixedPacketRate") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + server: StrictStr = Field(description="Target name or IP address.") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize") + network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements"] + + 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 AgentToServerInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 AgentToServerInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "continuousMode": obj.get("continuousMode"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "ipv6Policy": obj.get("ipv6Policy"), + "pingPayloadSize": obj.get("pingPayloadSize"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/agent_to_server_instant_test_request.py b/instant_tests_api/instant_tests_api/models/agent_to_server_instant_test_request.py new file mode 100644 index 00000000..f2b58b64 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/agent_to_server_instant_test_request.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +from instant_tests_api.models.test_dscp_id import TestDscpId +from instant_tests_api.models.test_ipv6_policy import TestIpv6Policy +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AgentToServerInstantTestRequest(BaseModel): + """ + AgentToServerInstantTestRequest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + agents: List[InstantTestRequestAgentsInner] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + continuous_mode: Optional[StrictBool] = Field(default=None, description="To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. ", alias="continuousMode") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1`", alias="fixedPacketRate") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + server: StrictStr = Field(description="Target name or IP address.") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize") + network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements"] + + 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 AgentToServerInstantTestRequest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 AgentToServerInstantTestRequest 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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [InstantTestRequestAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "continuousMode": obj.get("continuousMode"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "ipv6Policy": obj.get("ipv6Policy"), + "pingPayloadSize": obj.get("pingPayloadSize"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/cloud_enterprise_agent_type.py b/instant_tests_api/instant_tests_api/models/cloud_enterprise_agent_type.py new file mode 100644 index 00000000..457946fa --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/cloud_enterprise_agent_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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)) + + diff --git a/instant_tests_api/instant_tests_api/models/dns_query_class.py b/instant_tests_api/instant_tests_api/models/dns_query_class.py new file mode 100644 index 00000000..6170e256 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/dns_query_class.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 DnsQueryClass(str, Enum): + """ + Domain class used by this test. 'in' stands for Internet, while 'ch' stands for Chaos. + """ + + """ + allowed enum values + """ + IN = 'in' + CH = 'ch' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DnsQueryClass from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/dns_sec_instant_test.py b/instant_tests_api/instant_tests_api/models/dns_sec_instant_test.py new file mode 100644 index 00000000..8da853e4 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/dns_sec_instant_test.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.agent import Agent +from instant_tests_api.models.dns_query_class import DnsQueryClass +from instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsSecInstantTest(BaseModel): + """ + DnsSecInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "domain", "dnsQueryClass"] + + 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 DnsSecInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 DnsSecInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/dns_sec_instant_test_request.py b/instant_tests_api/instant_tests_api/models/dns_sec_instant_test_request.py new file mode 100644 index 00000000..3d75b985 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/dns_sec_instant_test_request.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.dns_query_class import DnsQueryClass +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsSecInstantTestRequest(BaseModel): + """ + DnsSecInstantTestRequest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + agents: List[InstantTestRequestAgentsInner] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "domain", "dnsQueryClass"] + + 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 DnsSecInstantTestRequest 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={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 DnsSecInstantTestRequest 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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [InstantTestRequestAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/dns_server_instant_test.py b/instant_tests_api/instant_tests_api/models/dns_server_instant_test.py new file mode 100644 index 00000000..33db62a8 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/dns_server_instant_test.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.agent import Agent +from instant_tests_api.models.dns_query_class import DnsQueryClass +from instant_tests_api.models.test_dns_server import TestDnsServer +from instant_tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from instant_tests_api.models.test_ipv6_policy import TestIpv6Policy +from instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsServerInstantTest(BaseModel): + """ + DnsServerInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + dns_servers: List[TestDnsServer] = Field(alias="dnsServers") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + recursive_queries: Optional[StrictBool] = Field(default=None, description="Set true to run query with RD (recursion desired) flag enabled.", alias="recursiveQueries") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass"] + + 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 DnsServerInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 each item in dns_servers (list) + _items = [] + if self.dns_servers: + for _item in self.dns_servers: + if _item: + _items.append(_item.to_dict()) + _dict['dnsServers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DnsServerInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "dnsServers": [TestDnsServer.from_dict(_item) for _item in obj.get("dnsServers")] if obj.get("dnsServers") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "recursiveQueries": obj.get("recursiveQueries"), + "ipv6Policy": obj.get("ipv6Policy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/dns_server_instant_test_request.py b/instant_tests_api/instant_tests_api/models/dns_server_instant_test_request.py new file mode 100644 index 00000000..858776c9 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/dns_server_instant_test_request.py @@ -0,0 +1,177 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.dns_query_class import DnsQueryClass +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +from instant_tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from instant_tests_api.models.test_ipv6_policy import TestIpv6Policy +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsServerInstantTestRequest(BaseModel): + """ + DnsServerInstantTestRequest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + agents: List[InstantTestRequestAgentsInner] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + dns_servers: List[StrictStr] = Field(description="A list of DNS server FQDN.", alias="dnsServers") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + recursive_queries: Optional[StrictBool] = Field(default=None, description="Set true to run query with RD (recursion desired) flag enabled.", alias="recursiveQueries") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass"] + + 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 DnsServerInstantTestRequest 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={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 DnsServerInstantTestRequest 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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [InstantTestRequestAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "dnsServers": obj.get("dnsServers"), + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "recursiveQueries": obj.get("recursiveQueries"), + "ipv6Policy": obj.get("ipv6Policy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/dns_servers_request.py b/instant_tests_api/instant_tests_api/models/dns_servers_request.py new file mode 100644 index 00000000..bd06329b --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/dns_servers_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 DnsServersRequest(BaseModel): + """ + DnsServersRequest + """ # noqa: E501 + dns_servers: Optional[List[StrictStr]] = Field(default=None, description="A list of DNS server FQDN.", alias="dnsServers") + __properties: ClassVar[List[str]] = ["dnsServers"] + + 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 DnsServersRequest 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 DnsServersRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "dnsServers": obj.get("dnsServers") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/dns_trace_instant_test.py b/instant_tests_api/instant_tests_api/models/dns_trace_instant_test.py new file mode 100644 index 00000000..c9030449 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/dns_trace_instant_test.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.agent import Agent +from instant_tests_api.models.dns_query_class import DnsQueryClass +from instant_tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsTraceInstantTest(BaseModel): + """ + DnsTraceInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "dnsTransportProtocol", "domain", "dnsQueryClass"] + + 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 DnsTraceInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 DnsTraceInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/dns_trace_instant_test_request.py b/instant_tests_api/instant_tests_api/models/dns_trace_instant_test_request.py new file mode 100644 index 00000000..51e71f79 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/dns_trace_instant_test_request.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.dns_query_class import DnsQueryClass +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +from instant_tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsTraceInstantTestRequest(BaseModel): + """ + DnsTraceInstantTestRequest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + agents: List[InstantTestRequestAgentsInner] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "dnsTransportProtocol", "domain", "dnsQueryClass"] + + 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 DnsTraceInstantTestRequest 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={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 DnsTraceInstantTestRequest 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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [InstantTestRequestAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/error.py b/instant_tests_api/instant_tests_api/models/error.py new file mode 100644 index 00000000..5883f8ca --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 + + diff --git a/instant_tests_api/instant_tests_api/models/expand.py b/instant_tests_api/instant_tests_api/models/expand.py new file mode 100644 index 00000000..282a6baf --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/expand.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 Expand(str, Enum): + """ + Expand + """ + + """ + allowed enum values + """ + AGENT = 'agent' + LABEL = 'label' + SHARED_MINUS_WITH_MINUS_ACCOUNT = 'shared-with-account' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Expand from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/ftp_server_instant_test.py b/instant_tests_api/instant_tests_api/models/ftp_server_instant_test.py new file mode 100644 index 00000000..efd8af95 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/ftp_server_instant_test.py @@ -0,0 +1,206 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.agent import Agent +from instant_tests_api.models.ftp_server_request_type import FtpServerRequestType +from instant_tests_api.models.test_ipv6_policy import TestIpv6Policy +from instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class FtpServerInstantTest(BaseModel): + """ + FtpServerInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + download_limit: Optional[StrictInt] = Field(default=None, description="Specify maximum number of bytes to download from the target object.", alias="downloadLimit") + ftp_target_time: Optional[Annotated[int, Field(le=6000, strict=True, ge=1000)]] = Field(default=None, description="Target time for operation completion; specified in milliseconds.", alias="ftpTargetTime") + ftp_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=10)]] = Field(default=10, description="Set the time limit for the test in seconds.", alias="ftpTimeLimit") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: StrictStr = Field(description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + request_type: FtpServerRequestType = Field(alias="requestType") + url: StrictStr = Field(description="Target for the test.") + use_active_ftp: Optional[StrictBool] = Field(default=False, description="Explicitly set the flag to use active FTP.", alias="useActiveFtp") + use_explicit_ftps: Optional[StrictBool] = Field(default=None, description="Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS.", alias="useExplicitFtps") + username: StrictStr = Field(description="Username for Basic/NTLM authentication.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy"] + + 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 FtpServerInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 FtpServerInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "downloadLimit": obj.get("downloadLimit"), + "ftpTargetTime": obj.get("ftpTargetTime"), + "ftpTimeLimit": obj.get("ftpTimeLimit") if obj.get("ftpTimeLimit") is not None else 10, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "requestType": obj.get("requestType"), + "url": obj.get("url"), + "useActiveFtp": obj.get("useActiveFtp") if obj.get("useActiveFtp") is not None else False, + "useExplicitFtps": obj.get("useExplicitFtps"), + "username": obj.get("username"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/ftp_server_request_type.py b/instant_tests_api/instant_tests_api/models/ftp_server_request_type.py new file mode 100644 index 00000000..5f0a0e28 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/ftp_server_request_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 FtpServerRequestType(str, Enum): + """ + Set the type of activity for the test. + """ + + """ + allowed enum values + """ + DOWNLOAD = 'download' + UPLOAD = 'upload' + LIST = 'list' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FtpServerRequestType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/http_server_instant_test.py b/instant_tests_api/instant_tests_api/models/http_server_instant_test.py new file mode 100644 index 00000000..752ade27 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/http_server_instant_test.py @@ -0,0 +1,239 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.agent import Agent +from instant_tests_api.models.test_auth_type import TestAuthType +from instant_tests_api.models.test_custom_headers import TestCustomHeaders +from instant_tests_api.models.test_ipv6_policy import TestIpv6Policy +from instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class HttpServerInstantTest(BaseModel): + """ + HttpServerInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "headers", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "postBody", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "ipv6Policy", "followRedirects", "fixedPacketRate"] + + 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 HttpServerInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of HttpServerInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "headers": obj.get("headers"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "postBody": obj.get("postBody"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "ipv6Policy": obj.get("ipv6Policy"), + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/http_server_instant_test_request.py b/instant_tests_api/instant_tests_api/models/http_server_instant_test_request.py new file mode 100644 index 00000000..d404e380 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/http_server_instant_test_request.py @@ -0,0 +1,217 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +from instant_tests_api.models.test_auth_type import TestAuthType +from instant_tests_api.models.test_custom_headers import TestCustomHeaders +from instant_tests_api.models.test_ipv6_policy import TestIpv6Policy +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class HttpServerInstantTestRequest(BaseModel): + """ + HttpServerInstantTestRequest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + agents: List[InstantTestRequestAgentsInner] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "headers", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "postBody", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "ipv6Policy", "followRedirects", "fixedPacketRate"] + + 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 HttpServerInstantTestRequest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of HttpServerInstantTestRequest 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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [InstantTestRequestAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "headers": obj.get("headers"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "postBody": obj.get("postBody"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "ipv6Policy": obj.get("ipv6Policy"), + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/instant_test.py b/instant_tests_api/instant_tests_api/models/instant_test.py new file mode 100644 index 00000000..5a1d16a8 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/instant_test.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.test_type import TestType +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class InstantTest(BaseModel): + """ + InstantTest + """ # 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") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts"] + + 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 InstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "labels", + "shared_with_accounts", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of InstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/instant_test_request.py b/instant_tests_api/instant_tests_api/models/instant_test_request.py new file mode 100644 index 00000000..daf26aa8 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/instant_test_request.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class InstantTestRequest(BaseModel): + """ + InstantTestRequest + """ # noqa: E501 + labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + agents: Optional[List[InstantTestRequestAgentsInner]] = Field(default=None, description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + __properties: ClassVar[List[str]] = ["labels", "sharedWithAccounts", "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 InstantTestRequest 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 InstantTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [InstantTestRequestAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/instant_test_request_agents_inner.py b/instant_tests_api/instant_tests_api/models/instant_test_request_agents_inner.py new file mode 100644 index 00000000..693b8ae6 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/instant_test_request_agents_inner.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 InstantTestRequestAgentsInner(BaseModel): + """ + InstantTestRequestAgentsInner + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Identifier for the agent (get `agentId` from `/agents` endpoint).", alias="agentId") + source_ip_address: Optional[StrictStr] = Field(default=None, description="IP address from the agent's `ipAddresses` field (get `ipAddresses` from `/agents` endpoint). Used for interface selection.", alias="sourceIpAddress") + __properties: ClassVar[List[str]] = ["agentId", "sourceIpAddress"] + + 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 InstantTestRequestAgentsInner 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 InstantTestRequestAgentsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "sourceIpAddress": obj.get("sourceIpAddress") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/link.py b/instant_tests_api/instant_tests_api/models/link.py new file mode 100644 index 00000000..256be11d --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 + + diff --git a/instant_tests_api/instant_tests_api/models/map_item.py b/instant_tests_api/instant_tests_api/models/map_item.py new file mode 100644 index 00000000..fa1ffd17 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/map_item.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 MapItem(BaseModel): + """ + MapItem + """ # noqa: E501 + key: Optional[StrictStr] = None + value: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["key", "value"] + + 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 MapItem 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 MapItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "key": obj.get("key"), + "value": obj.get("value") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/page_load_instant_test.py b/instant_tests_api/instant_tests_api/models/page_load_instant_test.py new file mode 100644 index 00000000..7cef263a --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/page_load_instant_test.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.agent import Agent +from instant_tests_api.models.test_auth_type import TestAuthType +from instant_tests_api.models.test_custom_headers import TestCustomHeaders +from instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PageLoadInstantTest(BaseModel): + """ + PageLoadInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + page_load_target_time: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`.", alias="pageLoadTargetTime") + page_load_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=10, description="Page load time limit. Must be larger than the `httpTimeLimit`.", alias="pageLoadTimeLimit") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pageLoadTargetTime", "pageLoadTimeLimit", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate"] + + 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 PageLoadInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PageLoadInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pageLoadTargetTime": obj.get("pageLoadTargetTime"), + "pageLoadTimeLimit": obj.get("pageLoadTimeLimit") if obj.get("pageLoadTimeLimit") is not None else 10, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "fixedPacketRate": obj.get("fixedPacketRate") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/page_load_instant_test_request.py b/instant_tests_api/instant_tests_api/models/page_load_instant_test_request.py new file mode 100644 index 00000000..73c850ae --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/page_load_instant_test_request.py @@ -0,0 +1,221 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +from instant_tests_api.models.test_auth_type import TestAuthType +from instant_tests_api.models.test_custom_headers import TestCustomHeaders +from instant_tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PageLoadInstantTestRequest(BaseModel): + """ + PageLoadInstantTestRequest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + agents: List[InstantTestRequestAgentsInner] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + page_load_target_time: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`.", alias="pageLoadTargetTime") + page_load_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=10, description="Page load time limit. Must be larger than the `httpTimeLimit`.", alias="pageLoadTimeLimit") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pageLoadTargetTime", "pageLoadTimeLimit", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate"] + + 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 PageLoadInstantTestRequest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PageLoadInstantTestRequest 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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [InstantTestRequestAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pageLoadTargetTime": obj.get("pageLoadTargetTime"), + "pageLoadTimeLimit": obj.get("pageLoadTimeLimit") if obj.get("pageLoadTimeLimit") is not None else 10, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "fixedPacketRate": obj.get("fixedPacketRate") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/server_instant_test_request.py b/instant_tests_api/instant_tests_api/models/server_instant_test_request.py new file mode 100644 index 00000000..3b5af149 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/server_instant_test_request.py @@ -0,0 +1,184 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.ftp_server_request_type import FtpServerRequestType +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +from instant_tests_api.models.test_ipv6_policy import TestIpv6Policy +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ServerInstantTestRequest(BaseModel): + """ + ServerInstantTestRequest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + agents: List[InstantTestRequestAgentsInner] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + download_limit: Optional[StrictInt] = Field(default=None, description="Specify maximum number of bytes to download from the target object.", alias="downloadLimit") + ftp_target_time: Optional[Annotated[int, Field(le=6000, strict=True, ge=1000)]] = Field(default=None, description="Target time for operation completion; specified in milliseconds.", alias="ftpTargetTime") + ftp_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=10)]] = Field(default=10, description="Set the time limit for the test in seconds.", alias="ftpTimeLimit") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: StrictStr = Field(description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + request_type: FtpServerRequestType = Field(alias="requestType") + url: StrictStr = Field(description="Target for the test.") + use_active_ftp: Optional[StrictBool] = Field(default=False, description="Explicitly set the flag to use active FTP.", alias="useActiveFtp") + use_explicit_ftps: Optional[StrictBool] = Field(default=None, description="Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS.", alias="useExplicitFtps") + username: StrictStr = Field(description="Username for Basic/NTLM authentication.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy"] + + 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 ServerInstantTestRequest 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={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 ServerInstantTestRequest 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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [InstantTestRequestAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "downloadLimit": obj.get("downloadLimit"), + "ftpTargetTime": obj.get("ftpTargetTime"), + "ftpTimeLimit": obj.get("ftpTimeLimit") if obj.get("ftpTimeLimit") is not None else 10, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "requestType": obj.get("requestType"), + "url": obj.get("url"), + "useActiveFtp": obj.get("useActiveFtp") if obj.get("useActiveFtp") is not None else False, + "useExplicitFtps": obj.get("useExplicitFtps"), + "username": obj.get("username"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/sip_server_instant_test.py b/instant_tests_api/instant_tests_api/models/sip_server_instant_test.py new file mode 100644 index 00000000..0a0a0818 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/sip_server_instant_test.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.agent import Agent +from instant_tests_api.models.sip_test_protocol import SipTestProtocol +from instant_tests_api.models.test_ipv6_policy import TestIpv6Policy +from instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.test_sip_credentials import TestSipCredentials +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SipServerInstantTest(BaseModel): + """ + SipServerInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_user: Optional[StrictStr] = Field(default=None, description="Username for authentication with SIP server.", alias="authUser") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + options_regex: Optional[StrictStr] = Field(default=None, description="Options regex, this field does not require escaping.", alias="optionsRegex") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Annotated[int, Field(le=65535, strict=True, ge=1)] = Field(description="Target port.") + protocol: Optional[SipTestProtocol] = None + register_enabled: Optional[StrictBool] = Field(default=False, description="Set to true to perform SIP registration on the test target with the SIP REGISTER command.", alias="registerEnabled") + sip_registrar: Optional[StrictStr] = Field(default=None, description="SIP server to be tested, specified by domain name or IP address.", alias="sipRegistrar") + sip_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for test completion in milliseconds.", alias="sipTargetTime") + sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit") + target_sip_credentials: TestSipCredentials = Field(alias="targetSipCredentials") + user: Optional[StrictStr] = Field(default=None, description="Username for SIP registration, should be unique within a ThousandEyes account group.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authUser", "mtuMeasurements", "networkMeasurements", "optionsRegex", "password", "pathTraceMode", "port", "protocol", "registerEnabled", "sipRegistrar", "sipTargetTime", "sipTimeLimit", "targetSipCredentials", "user", "fixedPacketRate", "ipv6Policy"] + + 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 SipServerInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 target_sip_credentials + if self.target_sip_credentials: + _dict['targetSipCredentials'] = self.target_sip_credentials.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SipServerInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authUser": obj.get("authUser"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "optionsRegex": obj.get("optionsRegex"), + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "registerEnabled": obj.get("registerEnabled") if obj.get("registerEnabled") is not None else False, + "sipRegistrar": obj.get("sipRegistrar"), + "sipTargetTime": obj.get("sipTargetTime"), + "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5, + "targetSipCredentials": TestSipCredentials.from_dict(obj.get("targetSipCredentials")) if obj.get("targetSipCredentials") is not None else None, + "user": obj.get("user"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/sip_server_instant_test_request.py b/instant_tests_api/instant_tests_api/models/sip_server_instant_test_request.py new file mode 100644 index 00000000..b38b0f1f --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/sip_server_instant_test_request.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +from instant_tests_api.models.sip_test_protocol import SipTestProtocol +from instant_tests_api.models.test_ipv6_policy import TestIpv6Policy +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_sip_credentials import TestSipCredentials +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SipServerInstantTestRequest(BaseModel): + """ + SipServerInstantTestRequest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + agents: List[InstantTestRequestAgentsInner] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + auth_user: Optional[StrictStr] = Field(default=None, description="Username for authentication with SIP server.", alias="authUser") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + options_regex: Optional[StrictStr] = Field(default=None, description="Options regex, this field does not require escaping.", alias="optionsRegex") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Annotated[int, Field(le=65535, strict=True, ge=1)] = Field(description="Target port.") + protocol: Optional[SipTestProtocol] = None + register_enabled: Optional[StrictBool] = Field(default=False, description="Set to true to perform SIP registration on the test target with the SIP REGISTER command.", alias="registerEnabled") + sip_registrar: Optional[StrictStr] = Field(default=None, description="SIP server to be tested, specified by domain name or IP address.", alias="sipRegistrar") + sip_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for test completion in milliseconds.", alias="sipTargetTime") + sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit") + target_sip_credentials: TestSipCredentials = Field(alias="targetSipCredentials") + user: Optional[StrictStr] = Field(default=None, description="Username for SIP registration, should be unique within a ThousandEyes account group.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authUser", "mtuMeasurements", "networkMeasurements", "optionsRegex", "password", "pathTraceMode", "port", "protocol", "registerEnabled", "sipRegistrar", "sipTargetTime", "sipTimeLimit", "targetSipCredentials", "user", "fixedPacketRate", "ipv6Policy"] + + 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 SipServerInstantTestRequest 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={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 target_sip_credentials + if self.target_sip_credentials: + _dict['targetSipCredentials'] = self.target_sip_credentials.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SipServerInstantTestRequest 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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [InstantTestRequestAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authUser": obj.get("authUser"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "optionsRegex": obj.get("optionsRegex"), + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "registerEnabled": obj.get("registerEnabled") if obj.get("registerEnabled") is not None else False, + "sipRegistrar": obj.get("sipRegistrar"), + "sipTargetTime": obj.get("sipTargetTime"), + "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5, + "targetSipCredentials": TestSipCredentials.from_dict(obj.get("targetSipCredentials")) if obj.get("targetSipCredentials") is not None else None, + "user": obj.get("user"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/sip_test_protocol.py b/instant_tests_api/instant_tests_api/models/sip_test_protocol.py new file mode 100644 index 00000000..7a1e6577 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/sip_test_protocol.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 SipTestProtocol(str, Enum): + """ + Transport layer for SIP communication. + """ + + """ + allowed enum values + """ + TCP = 'tcp' + TLS = 'tls' + UDP = 'udp' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SipTestProtocol from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/test_auth_type.py b/instant_tests_api/instant_tests_api/models/test_auth_type.py new file mode 100644 index 00000000..36eea66d --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_auth_type.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestAuthType(str, Enum): + """ + HTTP authentication type. + """ + + """ + allowed enum values + """ + NONE = 'none' + BASIC = 'basic' + NTLM = 'ntlm' + KERBEROS = 'kerberos' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestAuthType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/test_custom_headers.py b/instant_tests_api/instant_tests_api/models/test_custom_headers.py new file mode 100644 index 00000000..59e4aa23 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_custom_headers.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.map_item import MapItem +from instant_tests_api.models.test_custom_headers_all import TestCustomHeadersAll +from instant_tests_api.models.test_custom_headers_root import TestCustomHeadersRoot +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestCustomHeaders(BaseModel): + """ + TestCustomHeaders + """ # noqa: E501 + root: Optional[TestCustomHeadersRoot] = None + domains: Optional[Dict[str, MapItem]] = Field(default=None, description="Use these HTTP headers for the specified domains.") + all: Optional[TestCustomHeadersAll] = None + __properties: ClassVar[List[str]] = ["root", "domains", "all"] + + 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 TestCustomHeaders 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 root + if self.root: + _dict['root'] = self.root.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in domains (dict) + _field_dict = {} + if self.domains: + for _key in self.domains: + if self.domains[_key]: + _field_dict[_key] = self.domains[_key].to_dict() + _dict['domains'] = _field_dict + # override the default output from pydantic by calling `to_dict()` of all + if self.all: + _dict['all'] = self.all.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of TestCustomHeaders from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "root": TestCustomHeadersRoot.from_dict(obj.get("root")) if obj.get("root") is not None else None, + "domains": dict( + (_k, MapItem.from_dict(_v)) + for _k, _v in obj.get("domains").items() + ) + if obj.get("domains") is not None + else None, + "all": TestCustomHeadersAll.from_dict(obj.get("all")) if obj.get("all") is not None else None + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/test_custom_headers_all.py b/instant_tests_api/instant_tests_api/models/test_custom_headers_all.py new file mode 100644 index 00000000..07477fdf --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_custom_headers_all.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestCustomHeadersAll(BaseModel): + """ + TestCustomHeadersAll + """ # noqa: E501 + key: Optional[StrictStr] = None + value: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["key", "value"] + + 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 TestCustomHeadersAll 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 TestCustomHeadersAll from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "key": obj.get("key"), + "value": obj.get("value") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/test_custom_headers_root.py b/instant_tests_api/instant_tests_api/models/test_custom_headers_root.py new file mode 100644 index 00000000..226d1163 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_custom_headers_root.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestCustomHeadersRoot(BaseModel): + """ + TestCustomHeadersRoot + """ # noqa: E501 + key: Optional[StrictStr] = None + value: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["key", "value"] + + 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 TestCustomHeadersRoot 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 TestCustomHeadersRoot from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "key": obj.get("key"), + "value": obj.get("value") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/test_direction.py b/instant_tests_api/instant_tests_api/models/test_direction.py new file mode 100644 index 00000000..ff2290f8 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_direction.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestDirection(str, Enum): + """ + Direction of the test, which affects how results are shown. + """ + + """ + allowed enum values + """ + TO_MINUS_TARGET = 'to-target' + FROM_MINUS_TARGET = 'from-target' + BIDIRECTIONAL = 'bidirectional' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestDirection from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/test_dns_server.py b/instant_tests_api/instant_tests_api/models/test_dns_server.py new file mode 100644 index 00000000..96407446 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_dns_server.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestDnsServer(BaseModel): + """ + TestDnsServer + """ # noqa: E501 + server_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the DNS server.", alias="serverId") + server_name: Optional[StrictStr] = Field(default=None, description="Fully qualified domain name (FQDN) of DNS server.", alias="serverName") + __properties: ClassVar[List[str]] = ["serverId", "serverName"] + + 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 TestDnsServer 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 TestDnsServer from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "serverId": obj.get("serverId"), + "serverName": obj.get("serverName") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/test_dns_transport_protocol.py b/instant_tests_api/instant_tests_api/models/test_dns_transport_protocol.py new file mode 100644 index 00000000..834545cd --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_dns_transport_protocol.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestDnsTransportProtocol(str, Enum): + """ + Transport protocol used for DNS requests. + """ + + """ + allowed enum values + """ + UDP = 'udp' + TCP = 'tcp' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestDnsTransportProtocol from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/test_dscp_id.py b/instant_tests_api/instant_tests_api/models/test_dscp_id.py new file mode 100644 index 00000000..a1036077 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_dscp_id.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestDscpId(str, Enum): + """ + DSCP ID [to see list for acceptable values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests) + """ + + """ + allowed enum values + """ + ENUM_0 = '0' + ENUM_8 = '8' + ENUM_16 = '16' + ENUM_24 = '24' + ENUM_32 = '32' + ENUM_40 = '40' + ENUM_48 = '48' + ENUM_56 = '56' + ENUM_10 = '10' + ENUM_12 = '12' + ENUM_14 = '14' + ENUM_18 = '18' + ENUM_20 = '20' + ENUM_22 = '22' + ENUM_26 = '26' + ENUM_28 = '28' + ENUM_30 = '30' + ENUM_34 = '34' + ENUM_36 = '36' + ENUM_38 = '38' + ENUM_46 = '46' + ENUM_44 = '44' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestDscpId from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/test_ipv6_policy.py b/instant_tests_api/instant_tests_api/models/test_ipv6_policy.py new file mode 100644 index 00000000..3689c185 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_ipv6_policy.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestIpv6Policy(str, Enum): + """ + IP version policy. Overrides the IPv6 policy configured at the agent level. + """ + + """ + allowed enum values + """ + FORCE_MINUS_IPV4 = 'force-ipv4' + PREFER_MINUS_IPV6 = 'prefer-ipv6' + FORCE_MINUS_IPV6 = 'force-ipv6' + USE_MINUS_AGENT_MINUS_POLICY = 'use-agent-policy' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestIpv6Policy from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/test_labels_inner.py b/instant_tests_api/instant_tests_api/models/test_labels_inner.py new file mode 100644 index 00000000..f69b1f70 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_labels_inner.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestLabelsInner(BaseModel): + """ + TestLabelsInner + """ # 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.") + is_built_in: Optional[StrictBool] = Field(default=None, description="Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", alias="isBuiltIn") + __properties: ClassVar[List[str]] = ["labelId", "name", "isBuiltIn"] + + 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 TestLabelsInner 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 TestLabelsInner 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"), + "isBuiltIn": obj.get("isBuiltIn") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/test_page_loading_strategy.py b/instant_tests_api/instant_tests_api/models/test_page_loading_strategy.py new file mode 100644 index 00000000..a0dbf671 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_page_loading_strategy.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestPageLoadingStrategy(str, Enum): + """ + * `normal`: The test waits until the entire page is fully loaded, including the downloading and parsing of HTML content as well as all associated resources, before advancing to the next action in the transaction test script. * `eager`: The test waits for the DOMContentLoaded event, indicating that HTML content is downloaded and parsed, and the document reaches the \"interactive\" readiness state, before proceeding to the next action in the test script. * `none`: The test only waits for the download of HTML content. Once the HTML is downloaded, the test continues to the next action in the transaction test script without waiting for additional resources. + """ + + """ + allowed enum values + """ + NORMAL = 'normal' + EAGER = 'eager' + NONE = 'none' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestPageLoadingStrategy from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/test_path_trace_mode.py b/instant_tests_api/instant_tests_api/models/test_path_trace_mode.py new file mode 100644 index 00000000..847c9c37 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_path_trace_mode.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestPathTraceMode(str, Enum): + """ + Select `inSession` to perform the path trace within a TCP session. + """ + + """ + allowed enum values + """ + CLASSIC = 'classic' + IN_MINUS_SESSION = 'in-session' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestPathTraceMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/test_probe_mode.py b/instant_tests_api/instant_tests_api/models/test_probe_mode.py new file mode 100644 index 00000000..8b471630 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_probe_mode.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestProbeMode(str, Enum): + """ + Probe mode used by network test, only valid when the protocol is set to TCP. + """ + + """ + allowed enum values + """ + AUTO = 'auto' + SACK = 'sack' + SYN = 'syn' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestProbeMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/test_protocol.py b/instant_tests_api/instant_tests_api/models/test_protocol.py new file mode 100644 index 00000000..4397d25b --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_protocol.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestProtocol(str, Enum): + """ + Protocol used by dependent network tests (end-to-end, path trace, PMTUD). + """ + + """ + allowed enum values + """ + TCP = 'tcp' + ICMP = 'icmp' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestProtocol from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/test_shared_accounts_inner.py b/instant_tests_api/instant_tests_api/models/test_shared_accounts_inner.py new file mode 100644 index 00000000..7a613e14 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_shared_accounts_inner.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestSharedAccountsInner(BaseModel): + """ + TestSharedAccountsInner + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="Account group ID.") + name: Optional[StrictStr] = Field(default=None, description="Account group name.") + __properties: ClassVar[List[str]] = ["aid", "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 TestSharedAccountsInner 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 TestSharedAccountsInner 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"), + "name": obj.get("name") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/test_sip_credentials.py b/instant_tests_api/instant_tests_api/models/test_sip_credentials.py new file mode 100644 index 00000000..10123a79 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_sip_credentials.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.sip_test_protocol import SipTestProtocol +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestSipCredentials(BaseModel): + """ + TestSipCredentials + """ # noqa: E501 + auth_user: Optional[StrictStr] = Field(default=None, description="Username for authentication with SIP server.", alias="authUser") + password: Optional[StrictStr] = Field(default=None, description="Password for authentication with SIP server.") + port: Annotated[int, Field(le=65535, strict=True, ge=1024)] = Field(description="Port number for the chosen protocol.") + protocol: Optional[SipTestProtocol] = None + sip_registrar: Optional[StrictStr] = Field(default=None, description="SIP server to be tested, specified by domain name or IP address.", alias="sipRegistrar") + user: Optional[StrictStr] = Field(default=None, description="Username for SIP registration, should be unique within a ThousandEyes account group.") + __properties: ClassVar[List[str]] = ["authUser", "password", "port", "protocol", "sipRegistrar", "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 TestSipCredentials 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 TestSipCredentials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "authUser": obj.get("authUser"), + "password": obj.get("password"), + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "sipRegistrar": obj.get("sipRegistrar"), + "user": obj.get("user") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/test_ssl_version_id.py b/instant_tests_api/instant_tests_api/models/test_ssl_version_id.py new file mode 100644 index 00000000..6f9c575b --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_ssl_version_id.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 TestSslVersionId(str, Enum): + """ + SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. + """ + + """ + allowed enum values + """ + ENUM_0 = '0' + ENUM_3 = '3' + ENUM_4 = '4' + ENUM_5 = '5' + ENUM_6 = '6' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestSslVersionId from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/instant_tests_api/instant_tests_api/models/test_type.py b/instant_tests_api/instant_tests_api/models/test_type.py new file mode 100644 index 00000000..340fb364 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/test_type.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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)) + + diff --git a/instant_tests_api/instant_tests_api/models/unauthorized_error.py b/instant_tests_api/instant_tests_api/models/unauthorized_error.py new file mode 100644 index 00000000..cbe2c0ea --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 + + diff --git a/instant_tests_api/instant_tests_api/models/unexpanded_instant_test.py b/instant_tests_api/instant_tests_api/models/unexpanded_instant_test.py new file mode 100644 index 00000000..2117c466 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/unexpanded_instant_test.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.test_type import TestType +from instant_tests_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 + + diff --git a/instant_tests_api/instant_tests_api/models/unexpanded_instant_test_links.py b/instant_tests_api/instant_tests_api/models/unexpanded_instant_test_links.py new file mode 100644 index 00000000..e1913e9e --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/unexpanded_instant_test_links.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf +from instant_tests_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 + + diff --git a/instant_tests_api/instant_tests_api/models/unexpanded_instant_test_links_self.py b/instant_tests_api/instant_tests_api/models/unexpanded_instant_test_links_self.py new file mode 100644 index 00000000..e74279a1 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/unexpanded_instant_test_links_self.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 + + diff --git a/instant_tests_api/instant_tests_api/models/unexpanded_instant_test_links_test_results.py b/instant_tests_api/instant_tests_api/models/unexpanded_instant_test_links_test_results.py new file mode 100644 index 00000000..df1b1081 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/unexpanded_instant_test_links_test_results.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_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()) + + diff --git a/instant_tests_api/instant_tests_api/models/voice_instant_test.py b/instant_tests_api/instant_tests_api/models/voice_instant_test.py new file mode 100644 index 00000000..bd5b441b --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/voice_instant_test.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.agent import Agent +from instant_tests_api.models.test_dscp_id import TestDscpId +from instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class VoiceInstantTest(BaseModel): + """ + VoiceInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + codec: Optional[StrictStr] = Field(default=None, description="Codec label") + codec_id: Optional[StrictStr] = Field(default=None, description="Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab)", alias="codecId") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + duration: Optional[Annotated[int, Field(le=30, strict=True, ge=5)]] = Field(default=5, description="Duration of the test in seconds.") + jitter_buffer: Optional[Annotated[int, Field(le=150, strict=True, ge=0)]] = Field(default=40, description="De-jitter buffer size in seconds.", alias="jitterBuffer") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.") + target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId"] + + 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 VoiceInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "codec", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 VoiceInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "codec": obj.get("codec"), + "codecId": obj.get("codecId"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "duration": obj.get("duration") if obj.get("duration") is not None else 5, + "jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "port": obj.get("port"), + "targetAgentId": obj.get("targetAgentId") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/voice_instant_test_request.py b/instant_tests_api/instant_tests_api/models/voice_instant_test_request.py new file mode 100644 index 00000000..76fde7cf --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/voice_instant_test_request.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +from instant_tests_api.models.test_dscp_id import TestDscpId +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class VoiceInstantTestRequest(BaseModel): + """ + VoiceInstantTestRequest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + agents: List[InstantTestRequestAgentsInner] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + codec: Optional[StrictStr] = Field(default=None, description="Codec label") + codec_id: Optional[StrictStr] = Field(default=None, description="Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab)", alias="codecId") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + duration: Optional[Annotated[int, Field(le=30, strict=True, ge=5)]] = Field(default=5, description="Duration of the test in seconds.") + jitter_buffer: Optional[Annotated[int, Field(le=150, strict=True, ge=0)]] = Field(default=40, description="De-jitter buffer size in seconds.", alias="jitterBuffer") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.") + target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId"] + + 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 VoiceInstantTestRequest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "codec", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 VoiceInstantTestRequest 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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [InstantTestRequestAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "codec": obj.get("codec"), + "codecId": obj.get("codecId"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "duration": obj.get("duration") if obj.get("duration") is not None else 5, + "jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "port": obj.get("port"), + "targetAgentId": obj.get("targetAgentId") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/web_transaction_instant_test.py b/instant_tests_api/instant_tests_api/models/web_transaction_instant_test.py new file mode 100644 index 00000000..5839381a --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/web_transaction_instant_test.py @@ -0,0 +1,249 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.agent import Agent +from instant_tests_api.models.test_auth_type import TestAuthType +from instant_tests_api.models.test_custom_headers import TestCustomHeaders +from instant_tests_api.models.test_labels_inner import TestLabelsInner +from instant_tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class WebTransactionInstantTest(BaseModel): + """ + WebTransactionInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex") + credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=1)]] = Field(default=None, description="Target time for completion, defaults to 50% of time limit specified in seconds.", alias="targetTime") + time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds.", alias="timeLimit") + transaction_script: StrictStr = Field(description="JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ).", alias="transactionScript") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "credentials", "customHeaders", "desiredStatusCode", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "targetTime", "timeLimit", "transactionScript", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate"] + + 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 WebTransactionInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of WebTransactionInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "credentials": obj.get("credentials"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "targetTime": obj.get("targetTime"), + "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, + "transactionScript": obj.get("transactionScript"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "fixedPacketRate": obj.get("fixedPacketRate") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/models/web_transaction_instant_test_request.py b/instant_tests_api/instant_tests_api/models/web_transaction_instant_test_request.py new file mode 100644 index 00000000..8e078064 --- /dev/null +++ b/instant_tests_api/instant_tests_api/models/web_transaction_instant_test_request.py @@ -0,0 +1,227 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 typing_extensions import Annotated +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner +from instant_tests_api.models.test_auth_type import TestAuthType +from instant_tests_api.models.test_custom_headers import TestCustomHeaders +from instant_tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode +from instant_tests_api.models.test_probe_mode import TestProbeMode +from instant_tests_api.models.test_protocol import TestProtocol +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class WebTransactionInstantTestRequest(BaseModel): + """ + WebTransactionInstantTestRequest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + agents: List[InstantTestRequestAgentsInner] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex") + credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=1)]] = Field(default=None, description="Target time for completion, defaults to 50% of time limit specified in seconds.", alias="targetTime") + time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds.", alias="timeLimit") + transaction_script: StrictStr = Field(description="JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ).", alias="transactionScript") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "credentials", "customHeaders", "desiredStatusCode", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "targetTime", "timeLimit", "transactionScript", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate"] + + 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 WebTransactionInstantTestRequest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of WebTransactionInstantTestRequest 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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [InstantTestRequestAgentsInner.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "credentials": obj.get("credentials"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "targetTime": obj.get("targetTime"), + "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, + "transactionScript": obj.get("transactionScript"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "fixedPacketRate": obj.get("fixedPacketRate") + }) + return _obj + + diff --git a/instant_tests_api/instant_tests_api/py.typed b/instant_tests_api/instant_tests_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/instant_tests_api/instant_tests_api/rest.py b/instant_tests_api/instant_tests_api/rest.py new file mode 100644 index 00000000..cfbf6daf --- /dev/null +++ b/instant_tests_api/instant_tests_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 instant_tests_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) diff --git a/instant_tests_api/pyproject.toml b/instant_tests_api/pyproject.toml new file mode 100644 index 00000000..05d9544a --- /dev/null +++ b/instant_tests_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "instant_tests_api" +version = "1.0.0" +description = "Instant Tests API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Instant Tests API"] +include = ["instant_tests_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/instant_tests_api/requirements.txt b/instant_tests_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/instant_tests_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/instant_tests_api/setup.cfg b/instant_tests_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/instant_tests_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/instant_tests_api/setup.py b/instant_tests_api/setup.py new file mode 100644 index 00000000..dd59dc3a --- /dev/null +++ b/instant_tests_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "instant-tests-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Instant Tests API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Instant Tests API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + """, # noqa: E501 + package_data={"instant_tests_api": ["py.typed"]}, +) diff --git a/instant_tests_api/test-requirements.txt b/instant_tests_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/instant_tests_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/instant_tests_api/test/__init__.py b/instant_tests_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/instant_tests_api/test/test_agent.py b/instant_tests_api/test/test_agent.py new file mode 100644 index 00000000..37cf1ca5 --- /dev/null +++ b/instant_tests_api/test/test_agent.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.agent import Agent + +class TestAgent(unittest.TestCase): + """Agent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Agent: + """Test Agent + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Agent` + """ + model = Agent() + if include_optional: + return Agent( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + agent_type = 'enterprise-cluster', + location = 'San Francisco Bay Area', + country_id = 'US', + enabled = True, + verify_ssl_certificates = True + ) + else: + return Agent( + ) + """ + + def testAgent(self): + """Test Agent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_agent_base.py b/instant_tests_api/test/test_agent_base.py new file mode 100644 index 00000000..5cd307a6 --- /dev/null +++ b/instant_tests_api/test/test_agent_base.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.agent_base import AgentBase + +class TestAgentBase(unittest.TestCase): + """AgentBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentBase: + """Test AgentBase + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentBase` + """ + model = AgentBase() + if include_optional: + return AgentBase( + ip_addresses = ["99.139.65.220","99.139.65.221"], + public_ip_addresses = ["192.168.1.78","192.168.1.79"], + network = 'AT&T Services, Inc. (AS 7018)' + ) + else: + return AgentBase( + ) + """ + + def testAgentBase(self): + """Test AgentBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_agent_to_agent_api.py b/instant_tests_api/test/test_agent_to_agent_api.py new file mode 100644 index 00000000..684d2d24 --- /dev/null +++ b/instant_tests_api/test/test_agent_to_agent_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest + +from instant_tests_api.api.agent_to_agent_api import AgentToAgentApi + + +class TestAgentToAgentApi(unittest.TestCase): + """AgentToAgentApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentToAgentApi() + + def tearDown(self) -> None: + pass + + def test_post_instant_test_agent_to_agent(self) -> None: + """Test case for post_instant_test_agent_to_agent + + Create agent-to-agent instant test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_agent_to_agent_instant_test.py b/instant_tests_api/test/test_agent_to_agent_instant_test.py new file mode 100644 index 00000000..53dbefee --- /dev/null +++ b/instant_tests_api/test/test_agent_to_agent_instant_test.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.agent_to_agent_instant_test import AgentToAgentInstantTest + +class TestAgentToAgentInstantTest(unittest.TestCase): + """AgentToAgentInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentToAgentInstantTest: + """Test AgentToAgentInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentToAgentInstantTest` + """ + model = AgentToAgentInstantTest() + if include_optional: + return AgentToAgentInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-agent', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + instant_tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + instant_tests_api.models.agent.Agent() + ], + direction = 'to-target', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + mss = 20, + num_path_traces = 3, + path_trace_mode = 'classic', + port = 1, + protocol = 'tcp', + target_agent_id = '2954', + throughput_measurements = True, + throughput_duration = 5000, + throughput_rate = 8, + fixed_packet_rate = 50 + ) + else: + return AgentToAgentInstantTest( + agents = [ + instant_tests_api.models.agent.Agent() + ], + target_agent_id = '2954', + ) + """ + + def testAgentToAgentInstantTest(self): + """Test AgentToAgentInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_agent_to_agent_instant_test_request.py b/instant_tests_api/test/test_agent_to_agent_instant_test_request.py new file mode 100644 index 00000000..22dc2a31 --- /dev/null +++ b/instant_tests_api/test/test_agent_to_agent_instant_test_request.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.agent_to_agent_instant_test_request import AgentToAgentInstantTestRequest + +class TestAgentToAgentInstantTestRequest(unittest.TestCase): + """AgentToAgentInstantTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentToAgentInstantTestRequest: + """Test AgentToAgentInstantTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentToAgentInstantTestRequest` + """ + model = AgentToAgentInstantTestRequest() + if include_optional: + return AgentToAgentInstantTestRequest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-agent', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + direction = 'to-target', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + mss = 20, + num_path_traces = 3, + path_trace_mode = 'classic', + port = 1, + protocol = 'tcp', + target_agent_id = '2954', + throughput_measurements = True, + throughput_duration = 5000, + throughput_rate = 8, + fixed_packet_rate = 50 + ) + else: + return AgentToAgentInstantTestRequest( + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + target_agent_id = '2954', + ) + """ + + def testAgentToAgentInstantTestRequest(self): + """Test AgentToAgentInstantTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_agent_to_agent_test_protocol.py b/instant_tests_api/test/test_agent_to_agent_test_protocol.py new file mode 100644 index 00000000..344681d7 --- /dev/null +++ b/instant_tests_api/test/test_agent_to_agent_test_protocol.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol + +class TestAgentToAgentTestProtocol(unittest.TestCase): + """AgentToAgentTestProtocol unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAgentToAgentTestProtocol(self): + """Test AgentToAgentTestProtocol""" + # inst = AgentToAgentTestProtocol() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_agent_to_server_api.py b/instant_tests_api/test/test_agent_to_server_api.py new file mode 100644 index 00000000..c93338d9 --- /dev/null +++ b/instant_tests_api/test/test_agent_to_server_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest + +from instant_tests_api.api.agent_to_server_api import AgentToServerApi + + +class TestAgentToServerApi(unittest.TestCase): + """AgentToServerApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentToServerApi() + + def tearDown(self) -> None: + pass + + def test_post_instant_agent_to_server(self) -> None: + """Test case for post_instant_agent_to_server + + Create agent-to-server instant test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_agent_to_server_instant_test.py b/instant_tests_api/test/test_agent_to_server_instant_test.py new file mode 100644 index 00000000..070ae5fa --- /dev/null +++ b/instant_tests_api/test/test_agent_to_server_instant_test.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.agent_to_server_instant_test import AgentToServerInstantTest + +class TestAgentToServerInstantTest(unittest.TestCase): + """AgentToServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentToServerInstantTest: + """Test AgentToServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentToServerInstantTest` + """ + model = AgentToServerInstantTest() + if include_optional: + return AgentToServerInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + instant_tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + instant_tests_api.models.agent.Agent() + ], + bandwidth_measurements = True, + continuous_mode = False, + fixed_packet_rate = 25, + mtu_measurements = False, + num_path_traces = 3, + path_trace_mode = 'classic', + port = 1, + probe_mode = 'auto', + protocol = 'tcp', + server = 'www.thousandeyes.com', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + ipv6_policy = 'use-agent-policy', + ping_payload_size = 0, + network_measurements = True + ) + else: + return AgentToServerInstantTest( + agents = [ + instant_tests_api.models.agent.Agent() + ], + server = 'www.thousandeyes.com', + ) + """ + + def testAgentToServerInstantTest(self): + """Test AgentToServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_agent_to_server_instant_test_request.py b/instant_tests_api/test/test_agent_to_server_instant_test_request.py new file mode 100644 index 00000000..ffd86c9e --- /dev/null +++ b/instant_tests_api/test/test_agent_to_server_instant_test_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.agent_to_server_instant_test_request import AgentToServerInstantTestRequest + +class TestAgentToServerInstantTestRequest(unittest.TestCase): + """AgentToServerInstantTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentToServerInstantTestRequest: + """Test AgentToServerInstantTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentToServerInstantTestRequest` + """ + model = AgentToServerInstantTestRequest() + if include_optional: + return AgentToServerInstantTestRequest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + bandwidth_measurements = True, + continuous_mode = False, + fixed_packet_rate = 25, + mtu_measurements = False, + num_path_traces = 3, + path_trace_mode = 'classic', + port = 1, + probe_mode = 'auto', + protocol = 'tcp', + server = 'www.thousandeyes.com', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + ipv6_policy = 'use-agent-policy', + ping_payload_size = 0, + network_measurements = True + ) + else: + return AgentToServerInstantTestRequest( + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + server = 'www.thousandeyes.com', + ) + """ + + def testAgentToServerInstantTestRequest(self): + """Test AgentToServerInstantTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_cloud_enterprise_agent_type.py b/instant_tests_api/test/test_cloud_enterprise_agent_type.py new file mode 100644 index 00000000..afef8395 --- /dev/null +++ b/instant_tests_api/test/test_cloud_enterprise_agent_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType + +class TestCloudEnterpriseAgentType(unittest.TestCase): + """CloudEnterpriseAgentType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCloudEnterpriseAgentType(self): + """Test CloudEnterpriseAgentType""" + # inst = CloudEnterpriseAgentType() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_dns_query_class.py b/instant_tests_api/test/test_dns_query_class.py new file mode 100644 index 00000000..707ea774 --- /dev/null +++ b/instant_tests_api/test/test_dns_query_class.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.dns_query_class import DnsQueryClass + +class TestDnsQueryClass(unittest.TestCase): + """DnsQueryClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDnsQueryClass(self): + """Test DnsQueryClass""" + # inst = DnsQueryClass() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_dns_sec_instant_test.py b/instant_tests_api/test/test_dns_sec_instant_test.py new file mode 100644 index 00000000..c61226b3 --- /dev/null +++ b/instant_tests_api/test/test_dns_sec_instant_test.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.dns_sec_instant_test import DnsSecInstantTest + +class TestDnsSecInstantTest(unittest.TestCase): + """DnsSecInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsSecInstantTest: + """Test DnsSecInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsSecInstantTest` + """ + model = DnsSecInstantTest() + if include_optional: + return DnsSecInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dnssec', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + instant_tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + instant_tests_api.models.agent.Agent() + ], + domain = 'www.thousandeyes.com', + dns_query_class = 'in' + ) + else: + return DnsSecInstantTest( + agents = [ + instant_tests_api.models.agent.Agent() + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testDnsSecInstantTest(self): + """Test DnsSecInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_dns_sec_instant_test_request.py b/instant_tests_api/test/test_dns_sec_instant_test_request.py new file mode 100644 index 00000000..5242a084 --- /dev/null +++ b/instant_tests_api/test/test_dns_sec_instant_test_request.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.dns_sec_instant_test_request import DnsSecInstantTestRequest + +class TestDnsSecInstantTestRequest(unittest.TestCase): + """DnsSecInstantTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsSecInstantTestRequest: + """Test DnsSecInstantTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsSecInstantTestRequest` + """ + model = DnsSecInstantTestRequest() + if include_optional: + return DnsSecInstantTestRequest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dnssec', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + domain = 'www.thousandeyes.com', + dns_query_class = 'in' + ) + else: + return DnsSecInstantTestRequest( + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testDnsSecInstantTestRequest(self): + """Test DnsSecInstantTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_dns_security_api.py b/instant_tests_api/test/test_dns_security_api.py new file mode 100644 index 00000000..6b74a759 --- /dev/null +++ b/instant_tests_api/test/test_dns_security_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest + +from instant_tests_api.api.dns_security_api import DNSSecurityApi + + +class TestDNSSecurityApi(unittest.TestCase): + """DNSSecurityApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSSecurityApi() + + def tearDown(self) -> None: + pass + + def test_post_instant_dns_sec(self) -> None: + """Test case for post_instant_dns_sec + + Create DNS security instant test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_dns_server_api.py b/instant_tests_api/test/test_dns_server_api.py new file mode 100644 index 00000000..955d79a0 --- /dev/null +++ b/instant_tests_api/test/test_dns_server_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest + +from instant_tests_api.api.dns_server_api import DNSServerApi + + +class TestDNSServerApi(unittest.TestCase): + """DNSServerApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSServerApi() + + def tearDown(self) -> None: + pass + + def test_post_instant_dns_server(self) -> None: + """Test case for post_instant_dns_server + + Create DNS server instant test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_dns_server_instant_test.py b/instant_tests_api/test/test_dns_server_instant_test.py new file mode 100644 index 00000000..87685997 --- /dev/null +++ b/instant_tests_api/test/test_dns_server_instant_test.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.dns_server_instant_test import DnsServerInstantTest + +class TestDnsServerInstantTest(unittest.TestCase): + """DnsServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsServerInstantTest: + """Test DnsServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsServerInstantTest` + """ + model = DnsServerInstantTest() + if include_optional: + return DnsServerInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dns-server', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + instant_tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + instant_tests_api.models.agent.Agent() + ], + bandwidth_measurements = True, + dns_servers = [ + instant_tests_api.models.test_dns_server.TestDnsServer( + server_id = '1447', + server_name = 'dns-example.net', ) + ], + dns_transport_protocol = 'udp', + domain = 'www.thousandeyes.com', + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + recursive_queries = True, + ipv6_policy = 'use-agent-policy', + fixed_packet_rate = 50, + dns_query_class = 'in' + ) + else: + return DnsServerInstantTest( + agents = [ + instant_tests_api.models.agent.Agent() + ], + dns_servers = [ + instant_tests_api.models.test_dns_server.TestDnsServer( + server_id = '1447', + server_name = 'dns-example.net', ) + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testDnsServerInstantTest(self): + """Test DnsServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_dns_server_instant_test_request.py b/instant_tests_api/test/test_dns_server_instant_test_request.py new file mode 100644 index 00000000..0dda14c8 --- /dev/null +++ b/instant_tests_api/test/test_dns_server_instant_test_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.dns_server_instant_test_request import DnsServerInstantTestRequest + +class TestDnsServerInstantTestRequest(unittest.TestCase): + """DnsServerInstantTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsServerInstantTestRequest: + """Test DnsServerInstantTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsServerInstantTestRequest` + """ + model = DnsServerInstantTestRequest() + if include_optional: + return DnsServerInstantTestRequest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dns-server', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + bandwidth_measurements = True, + dns_servers = [dns-example.net, 8.8.8.8], + dns_transport_protocol = 'udp', + domain = 'www.thousandeyes.com', + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + recursive_queries = True, + ipv6_policy = 'use-agent-policy', + fixed_packet_rate = 50, + dns_query_class = 'in' + ) + else: + return DnsServerInstantTestRequest( + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + dns_servers = [dns-example.net, 8.8.8.8], + domain = 'www.thousandeyes.com', + ) + """ + + def testDnsServerInstantTestRequest(self): + """Test DnsServerInstantTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_dns_servers_request.py b/instant_tests_api/test/test_dns_servers_request.py new file mode 100644 index 00000000..8b6047bc --- /dev/null +++ b/instant_tests_api/test/test_dns_servers_request.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.dns_servers_request import DnsServersRequest + +class TestDnsServersRequest(unittest.TestCase): + """DnsServersRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsServersRequest: + """Test DnsServersRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsServersRequest` + """ + model = DnsServersRequest() + if include_optional: + return DnsServersRequest( + dns_servers = ["dns-example.net","8.8.8.8"] + ) + else: + return DnsServersRequest( + ) + """ + + def testDnsServersRequest(self): + """Test DnsServersRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_dns_trace_api.py b/instant_tests_api/test/test_dns_trace_api.py new file mode 100644 index 00000000..67626b64 --- /dev/null +++ b/instant_tests_api/test/test_dns_trace_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest + +from instant_tests_api.api.dns_trace_api import DNSTraceApi + + +class TestDNSTraceApi(unittest.TestCase): + """DNSTraceApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSTraceApi() + + def tearDown(self) -> None: + pass + + def test_post_instant_dns_trace(self) -> None: + """Test case for post_instant_dns_trace + + Create DNS trace instant test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_dns_trace_instant_test.py b/instant_tests_api/test/test_dns_trace_instant_test.py new file mode 100644 index 00000000..656e1b44 --- /dev/null +++ b/instant_tests_api/test/test_dns_trace_instant_test.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.dns_trace_instant_test import DnsTraceInstantTest + +class TestDnsTraceInstantTest(unittest.TestCase): + """DnsTraceInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsTraceInstantTest: + """Test DnsTraceInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsTraceInstantTest` + """ + model = DnsTraceInstantTest() + if include_optional: + return DnsTraceInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dns-trace', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + instant_tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + instant_tests_api.models.agent.Agent() + ], + dns_transport_protocol = 'udp', + domain = 'www.thousandeyes.com', + dns_query_class = 'in' + ) + else: + return DnsTraceInstantTest( + agents = [ + instant_tests_api.models.agent.Agent() + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testDnsTraceInstantTest(self): + """Test DnsTraceInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_dns_trace_instant_test_request.py b/instant_tests_api/test/test_dns_trace_instant_test_request.py new file mode 100644 index 00000000..f1643c02 --- /dev/null +++ b/instant_tests_api/test/test_dns_trace_instant_test_request.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.dns_trace_instant_test_request import DnsTraceInstantTestRequest + +class TestDnsTraceInstantTestRequest(unittest.TestCase): + """DnsTraceInstantTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsTraceInstantTestRequest: + """Test DnsTraceInstantTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsTraceInstantTestRequest` + """ + model = DnsTraceInstantTestRequest() + if include_optional: + return DnsTraceInstantTestRequest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dns-trace', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + dns_transport_protocol = 'udp', + domain = 'www.thousandeyes.com', + dns_query_class = 'in' + ) + else: + return DnsTraceInstantTestRequest( + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testDnsTraceInstantTestRequest(self): + """Test DnsTraceInstantTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_error.py b/instant_tests_api/test/test_error.py new file mode 100644 index 00000000..e8f41d6a --- /dev/null +++ b/instant_tests_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_expand.py b/instant_tests_api/test/test_expand.py new file mode 100644 index 00000000..c870630f --- /dev/null +++ b/instant_tests_api/test/test_expand.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.expand import Expand + +class TestExpand(unittest.TestCase): + """Expand unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testExpand(self): + """Test Expand""" + # inst = Expand() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_ftp_server_api.py b/instant_tests_api/test/test_ftp_server_api.py new file mode 100644 index 00000000..9d9b8b16 --- /dev/null +++ b/instant_tests_api/test/test_ftp_server_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest + +from instant_tests_api.api.ftp_server_api import FTPServerApi + + +class TestFTPServerApi(unittest.TestCase): + """FTPServerApi unit test stubs""" + + def setUp(self) -> None: + self.api = FTPServerApi() + + def tearDown(self) -> None: + pass + + def test_post_instant_ftp_server(self) -> None: + """Test case for post_instant_ftp_server + + Create FTP server instant test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_ftp_server_instant_test.py b/instant_tests_api/test/test_ftp_server_instant_test.py new file mode 100644 index 00000000..de36cc19 --- /dev/null +++ b/instant_tests_api/test/test_ftp_server_instant_test.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.ftp_server_instant_test import FtpServerInstantTest + +class TestFtpServerInstantTest(unittest.TestCase): + """FtpServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FtpServerInstantTest: + """Test FtpServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FtpServerInstantTest` + """ + model = FtpServerInstantTest() + if include_optional: + return FtpServerInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'ftp-server', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + instant_tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + instant_tests_api.models.agent.Agent() + ], + bandwidth_measurements = True, + download_limit = 1048576, + ftp_target_time = 1000, + ftp_time_limit = 10, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + request_type = 'download', + url = 'www.thousandeyes.com', + use_active_ftp = True, + use_explicit_ftps = False, + username = 'username', + fixed_packet_rate = 50, + ipv6_policy = 'use-agent-policy' + ) + else: + return FtpServerInstantTest( + agents = [ + instant_tests_api.models.agent.Agent() + ], + password = 'password', + request_type = 'download', + url = 'www.thousandeyes.com', + username = 'username', + ) + """ + + def testFtpServerInstantTest(self): + """Test FtpServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_ftp_server_request_type.py b/instant_tests_api/test/test_ftp_server_request_type.py new file mode 100644 index 00000000..a96e5017 --- /dev/null +++ b/instant_tests_api/test/test_ftp_server_request_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.ftp_server_request_type import FtpServerRequestType + +class TestFtpServerRequestType(unittest.TestCase): + """FtpServerRequestType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFtpServerRequestType(self): + """Test FtpServerRequestType""" + # inst = FtpServerRequestType() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_http_page_load_api.py b/instant_tests_api/test/test_http_page_load_api.py new file mode 100644 index 00000000..033a6235 --- /dev/null +++ b/instant_tests_api/test/test_http_page_load_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest + +from instant_tests_api.api.http_page_load_api import HTTPPageLoadApi + + +class TestHTTPPageLoadApi(unittest.TestCase): + """HTTPPageLoadApi unit test stubs""" + + def setUp(self) -> None: + self.api = HTTPPageLoadApi() + + def tearDown(self) -> None: + pass + + def test_post_instant_http_page_load(self) -> None: + """Test case for post_instant_http_page_load + + Create HTTP page load instant test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_http_server_api.py b/instant_tests_api/test/test_http_server_api.py new file mode 100644 index 00000000..226f1615 --- /dev/null +++ b/instant_tests_api/test/test_http_server_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest + +from instant_tests_api.api.http_server_api import HTTPServerApi + + +class TestHTTPServerApi(unittest.TestCase): + """HTTPServerApi unit test stubs""" + + def setUp(self) -> None: + self.api = HTTPServerApi() + + def tearDown(self) -> None: + pass + + def test_post_instant_http_server(self) -> None: + """Test case for post_instant_http_server + + Create HTTP server instant test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_http_server_instant_test.py b/instant_tests_api/test/test_http_server_instant_test.py new file mode 100644 index 00000000..fd49707c --- /dev/null +++ b/instant_tests_api/test/test_http_server_instant_test.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.http_server_instant_test import HttpServerInstantTest + +class TestHttpServerInstantTest(unittest.TestCase): + """HttpServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HttpServerInstantTest: + """Test HttpServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HttpServerInstantTest` + """ + model = HttpServerInstantTest() + if include_optional: + return HttpServerInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'http-server', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + instant_tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + instant_tests_api.models.agent.Agent() + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + headers = ["header1: value1","header2: value2"], + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + desired_status_code = '200', + download_limit = 2048, + dns_override = '8.8.8.8', + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + post_body = '{ "example" : "value"}', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + ipv6_policy = 'use-agent-policy', + follow_redirects = True, + fixed_packet_rate = 50 + ) + else: + return HttpServerInstantTest( + agents = [ + instant_tests_api.models.agent.Agent() + ], + url = 'www.thousandeyes.com', + ) + """ + + def testHttpServerInstantTest(self): + """Test HttpServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_http_server_instant_test_request.py b/instant_tests_api/test/test_http_server_instant_test_request.py new file mode 100644 index 00000000..8d83f3d9 --- /dev/null +++ b/instant_tests_api/test/test_http_server_instant_test_request.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.http_server_instant_test_request import HttpServerInstantTestRequest + +class TestHttpServerInstantTestRequest(unittest.TestCase): + """HttpServerInstantTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HttpServerInstantTestRequest: + """Test HttpServerInstantTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HttpServerInstantTestRequest` + """ + model = HttpServerInstantTestRequest() + if include_optional: + return HttpServerInstantTestRequest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'http-server', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + headers = ["header1: value1","header2: value2"], + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + desired_status_code = '200', + download_limit = 2048, + dns_override = '8.8.8.8', + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + post_body = '{ "example" : "value"}', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + ipv6_policy = 'use-agent-policy', + follow_redirects = True, + fixed_packet_rate = 50 + ) + else: + return HttpServerInstantTestRequest( + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + url = 'www.thousandeyes.com', + ) + """ + + def testHttpServerInstantTestRequest(self): + """Test HttpServerInstantTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_instant_test.py b/instant_tests_api/test/test_instant_test.py new file mode 100644 index 00000000..900cdf60 --- /dev/null +++ b/instant_tests_api/test/test_instant_test.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.instant_test import InstantTest + +class TestInstantTest(unittest.TestCase): + """InstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InstantTest: + """Test InstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InstantTest` + """ + model = InstantTest() + if include_optional: + return InstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + instant_tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ] + ) + else: + return InstantTest( + ) + """ + + def testInstantTest(self): + """Test InstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_instant_test_request.py b/instant_tests_api/test/test_instant_test_request.py new file mode 100644 index 00000000..5616505b --- /dev/null +++ b/instant_tests_api/test/test_instant_test_request.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.instant_test_request import InstantTestRequest + +class TestInstantTestRequest(unittest.TestCase): + """InstantTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InstantTestRequest: + """Test InstantTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InstantTestRequest` + """ + model = InstantTestRequest() + if include_optional: + return InstantTestRequest( + labels = ["9842","1283"], + shared_with_accounts = ["2087","100"], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ] + ) + else: + return InstantTestRequest( + ) + """ + + def testInstantTestRequest(self): + """Test InstantTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_instant_test_request_agents_inner.py b/instant_tests_api/test/test_instant_test_request_agents_inner.py new file mode 100644 index 00000000..711df800 --- /dev/null +++ b/instant_tests_api/test/test_instant_test_request_agents_inner.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.instant_test_request_agents_inner import InstantTestRequestAgentsInner + +class TestInstantTestRequestAgentsInner(unittest.TestCase): + """InstantTestRequestAgentsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InstantTestRequestAgentsInner: + """Test InstantTestRequestAgentsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InstantTestRequestAgentsInner` + """ + model = InstantTestRequestAgentsInner() + if include_optional: + return InstantTestRequestAgentsInner( + agent_id = '', + source_ip_address = '' + ) + else: + return InstantTestRequestAgentsInner( + ) + """ + + def testInstantTestRequestAgentsInner(self): + """Test InstantTestRequestAgentsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_link.py b/instant_tests_api/test/test_link.py new file mode 100644 index 00000000..2717901b --- /dev/null +++ b/instant_tests_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_map_item.py b/instant_tests_api/test/test_map_item.py new file mode 100644 index 00000000..f7cba5b3 --- /dev/null +++ b/instant_tests_api/test/test_map_item.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.map_item import MapItem + +class TestMapItem(unittest.TestCase): + """MapItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MapItem: + """Test MapItem + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MapItem` + """ + model = MapItem() + if include_optional: + return MapItem( + key = '', + value = '' + ) + else: + return MapItem( + ) + """ + + def testMapItem(self): + """Test MapItem""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_page_load_instant_test.py b/instant_tests_api/test/test_page_load_instant_test.py new file mode 100644 index 00000000..34739cdd --- /dev/null +++ b/instant_tests_api/test/test_page_load_instant_test.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.page_load_instant_test import PageLoadInstantTest + +class TestPageLoadInstantTest(unittest.TestCase): + """PageLoadInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PageLoadInstantTest: + """Test PageLoadInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageLoadInstantTest` + """ + model = PageLoadInstantTest() + if include_optional: + return PageLoadInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'page-load', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + instant_tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + instant_tests_api.models.agent.Agent() + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + follow_redirects = True, + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + page_load_target_time = 10, + page_load_time_limit = 5, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + block_domains = 'domain.com/', + disable_screenshot = True, + allow_mic_and_camera = True, + allow_geolocation = True, + browser_language = 'en-US', + page_loading_strategy = 'normal', + fixed_packet_rate = 50 + ) + else: + return PageLoadInstantTest( + agents = [ + instant_tests_api.models.agent.Agent() + ], + url = 'www.thousandeyes.com', + ) + """ + + def testPageLoadInstantTest(self): + """Test PageLoadInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_page_load_instant_test_request.py b/instant_tests_api/test/test_page_load_instant_test_request.py new file mode 100644 index 00000000..2ce49b8d --- /dev/null +++ b/instant_tests_api/test/test_page_load_instant_test_request.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.page_load_instant_test_request import PageLoadInstantTestRequest + +class TestPageLoadInstantTestRequest(unittest.TestCase): + """PageLoadInstantTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PageLoadInstantTestRequest: + """Test PageLoadInstantTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageLoadInstantTestRequest` + """ + model = PageLoadInstantTestRequest() + if include_optional: + return PageLoadInstantTestRequest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'page-load', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + follow_redirects = True, + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + page_load_target_time = 10, + page_load_time_limit = 5, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + block_domains = 'domain.com/', + disable_screenshot = True, + allow_mic_and_camera = True, + allow_geolocation = True, + browser_language = 'en-US', + page_loading_strategy = 'normal', + fixed_packet_rate = 50 + ) + else: + return PageLoadInstantTestRequest( + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + url = 'www.thousandeyes.com', + ) + """ + + def testPageLoadInstantTestRequest(self): + """Test PageLoadInstantTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_run_api.py b/instant_tests_api/test/test_run_api.py new file mode 100644 index 00000000..511059b3 --- /dev/null +++ b/instant_tests_api/test/test_run_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest + +from instant_tests_api.api.run_api import RunApi + + +class TestRunApi(unittest.TestCase): + """RunApi unit test stubs""" + + def setUp(self) -> None: + self.api = RunApi() + + def tearDown(self) -> None: + pass + + def test_post_instant_run(self) -> None: + """Test case for post_instant_run + + Run instant test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_server_instant_test_request.py b/instant_tests_api/test/test_server_instant_test_request.py new file mode 100644 index 00000000..ff53d56a --- /dev/null +++ b/instant_tests_api/test/test_server_instant_test_request.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.server_instant_test_request import ServerInstantTestRequest + +class TestServerInstantTestRequest(unittest.TestCase): + """ServerInstantTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServerInstantTestRequest: + """Test ServerInstantTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ServerInstantTestRequest` + """ + model = ServerInstantTestRequest() + if include_optional: + return ServerInstantTestRequest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'ftp-server', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + bandwidth_measurements = True, + download_limit = 1048576, + ftp_target_time = 1000, + ftp_time_limit = 10, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + request_type = 'download', + url = 'www.thousandeyes.com', + use_active_ftp = True, + use_explicit_ftps = False, + username = 'username', + fixed_packet_rate = 50, + ipv6_policy = 'use-agent-policy' + ) + else: + return ServerInstantTestRequest( + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + password = 'password', + request_type = 'download', + url = 'www.thousandeyes.com', + username = 'username', + ) + """ + + def testServerInstantTestRequest(self): + """Test ServerInstantTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_sip_server_api.py b/instant_tests_api/test/test_sip_server_api.py new file mode 100644 index 00000000..02dd2bca --- /dev/null +++ b/instant_tests_api/test/test_sip_server_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest + +from instant_tests_api.api.sip_server_api import SIPServerApi + + +class TestSIPServerApi(unittest.TestCase): + """SIPServerApi unit test stubs""" + + def setUp(self) -> None: + self.api = SIPServerApi() + + def tearDown(self) -> None: + pass + + def test_post_instant_sip_server(self) -> None: + """Test case for post_instant_sip_server + + Create SIP server instant test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_sip_server_instant_test.py b/instant_tests_api/test/test_sip_server_instant_test.py new file mode 100644 index 00000000..9b30df38 --- /dev/null +++ b/instant_tests_api/test/test_sip_server_instant_test.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.sip_server_instant_test import SipServerInstantTest + +class TestSipServerInstantTest(unittest.TestCase): + """SipServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SipServerInstantTest: + """Test SipServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SipServerInstantTest` + """ + model = SipServerInstantTest() + if include_optional: + return SipServerInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'sip-server', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + instant_tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + instant_tests_api.models.agent.Agent() + ], + auth_user = 'username', + mtu_measurements = False, + network_measurements = True, + options_regex = '["a-z"]', + password = 'password', + path_trace_mode = 'classic', + port = 1, + protocol = 'tcp', + register_enabled = True, + sip_registrar = 'voice.thousandeyes.com', + sip_target_time = 100, + sip_time_limit = 5, + target_sip_credentials = instant_tests_api.models.test_sip_credentials.TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username', ), + user = 'username', + fixed_packet_rate = 50, + ipv6_policy = 'use-agent-policy' + ) + else: + return SipServerInstantTest( + agents = [ + instant_tests_api.models.agent.Agent() + ], + port = 1, + target_sip_credentials = instant_tests_api.models.test_sip_credentials.TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username', ), + ) + """ + + def testSipServerInstantTest(self): + """Test SipServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_sip_server_instant_test_request.py b/instant_tests_api/test/test_sip_server_instant_test_request.py new file mode 100644 index 00000000..5e4b9d84 --- /dev/null +++ b/instant_tests_api/test/test_sip_server_instant_test_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.sip_server_instant_test_request import SipServerInstantTestRequest + +class TestSipServerInstantTestRequest(unittest.TestCase): + """SipServerInstantTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SipServerInstantTestRequest: + """Test SipServerInstantTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SipServerInstantTestRequest` + """ + model = SipServerInstantTestRequest() + if include_optional: + return SipServerInstantTestRequest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'sip-server', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + auth_user = 'username', + mtu_measurements = False, + network_measurements = True, + options_regex = '["a-z"]', + password = 'password', + path_trace_mode = 'classic', + port = 1, + protocol = 'tcp', + register_enabled = True, + sip_registrar = 'voice.thousandeyes.com', + sip_target_time = 100, + sip_time_limit = 5, + target_sip_credentials = instant_tests_api.models.test_sip_credentials.TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username', ), + user = 'username', + fixed_packet_rate = 50, + ipv6_policy = 'use-agent-policy' + ) + else: + return SipServerInstantTestRequest( + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + port = 1, + target_sip_credentials = instant_tests_api.models.test_sip_credentials.TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username', ), + ) + """ + + def testSipServerInstantTestRequest(self): + """Test SipServerInstantTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_sip_test_protocol.py b/instant_tests_api/test/test_sip_test_protocol.py new file mode 100644 index 00000000..08667a52 --- /dev/null +++ b/instant_tests_api/test/test_sip_test_protocol.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.sip_test_protocol import SipTestProtocol + +class TestSipTestProtocol(unittest.TestCase): + """SipTestProtocol unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSipTestProtocol(self): + """Test SipTestProtocol""" + # inst = SipTestProtocol() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_auth_type.py b/instant_tests_api/test/test_test_auth_type.py new file mode 100644 index 00000000..e3f4f43b --- /dev/null +++ b/instant_tests_api/test/test_test_auth_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_auth_type import TestAuthType + +class TestTestAuthType(unittest.TestCase): + """TestAuthType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestAuthType(self): + """Test TestAuthType""" + # inst = TestAuthType() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_custom_headers.py b/instant_tests_api/test/test_test_custom_headers.py new file mode 100644 index 00000000..e25caa3f --- /dev/null +++ b/instant_tests_api/test/test_test_custom_headers.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_custom_headers import TestCustomHeaders + +class TestTestCustomHeaders(unittest.TestCase): + """TestCustomHeaders unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestCustomHeaders: + """Test TestCustomHeaders + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestCustomHeaders` + """ + model = TestCustomHeaders() + if include_optional: + return TestCustomHeaders( + root = None, + domains = { + 'key' : instant_tests_api.models.map_item.MapItem( + key = '', + value = '', ) + }, + all = None + ) + else: + return TestCustomHeaders( + ) + """ + + def testTestCustomHeaders(self): + """Test TestCustomHeaders""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_custom_headers_all.py b/instant_tests_api/test/test_test_custom_headers_all.py new file mode 100644 index 00000000..da62d9dd --- /dev/null +++ b/instant_tests_api/test/test_test_custom_headers_all.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_custom_headers_all import TestCustomHeadersAll + +class TestTestCustomHeadersAll(unittest.TestCase): + """TestCustomHeadersAll unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestCustomHeadersAll: + """Test TestCustomHeadersAll + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestCustomHeadersAll` + """ + model = TestCustomHeadersAll() + if include_optional: + return TestCustomHeadersAll( + key = '', + value = '' + ) + else: + return TestCustomHeadersAll( + ) + """ + + def testTestCustomHeadersAll(self): + """Test TestCustomHeadersAll""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_custom_headers_root.py b/instant_tests_api/test/test_test_custom_headers_root.py new file mode 100644 index 00000000..65220209 --- /dev/null +++ b/instant_tests_api/test/test_test_custom_headers_root.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_custom_headers_root import TestCustomHeadersRoot + +class TestTestCustomHeadersRoot(unittest.TestCase): + """TestCustomHeadersRoot unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestCustomHeadersRoot: + """Test TestCustomHeadersRoot + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestCustomHeadersRoot` + """ + model = TestCustomHeadersRoot() + if include_optional: + return TestCustomHeadersRoot( + key = '', + value = '' + ) + else: + return TestCustomHeadersRoot( + ) + """ + + def testTestCustomHeadersRoot(self): + """Test TestCustomHeadersRoot""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_direction.py b/instant_tests_api/test/test_test_direction.py new file mode 100644 index 00000000..1459bff4 --- /dev/null +++ b/instant_tests_api/test/test_test_direction.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_direction import TestDirection + +class TestTestDirection(unittest.TestCase): + """TestDirection unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestDirection(self): + """Test TestDirection""" + # inst = TestDirection() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_dns_server.py b/instant_tests_api/test/test_test_dns_server.py new file mode 100644 index 00000000..2e72770c --- /dev/null +++ b/instant_tests_api/test/test_test_dns_server.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_dns_server import TestDnsServer + +class TestTestDnsServer(unittest.TestCase): + """TestDnsServer unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestDnsServer: + """Test TestDnsServer + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestDnsServer` + """ + model = TestDnsServer() + if include_optional: + return TestDnsServer( + server_id = '1447', + server_name = 'dns-example.net' + ) + else: + return TestDnsServer( + ) + """ + + def testTestDnsServer(self): + """Test TestDnsServer""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_dns_transport_protocol.py b/instant_tests_api/test/test_test_dns_transport_protocol.py new file mode 100644 index 00000000..27b8ef24 --- /dev/null +++ b/instant_tests_api/test/test_test_dns_transport_protocol.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol + +class TestTestDnsTransportProtocol(unittest.TestCase): + """TestDnsTransportProtocol unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestDnsTransportProtocol(self): + """Test TestDnsTransportProtocol""" + # inst = TestDnsTransportProtocol() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_dscp_id.py b/instant_tests_api/test/test_test_dscp_id.py new file mode 100644 index 00000000..d62c7634 --- /dev/null +++ b/instant_tests_api/test/test_test_dscp_id.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_dscp_id import TestDscpId + +class TestTestDscpId(unittest.TestCase): + """TestDscpId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestDscpId(self): + """Test TestDscpId""" + # inst = TestDscpId() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_ipv6_policy.py b/instant_tests_api/test/test_test_ipv6_policy.py new file mode 100644 index 00000000..b698dd26 --- /dev/null +++ b/instant_tests_api/test/test_test_ipv6_policy.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_ipv6_policy import TestIpv6Policy + +class TestTestIpv6Policy(unittest.TestCase): + """TestIpv6Policy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestIpv6Policy(self): + """Test TestIpv6Policy""" + # inst = TestIpv6Policy() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_labels_inner.py b/instant_tests_api/test/test_test_labels_inner.py new file mode 100644 index 00000000..6fc1c7d2 --- /dev/null +++ b/instant_tests_api/test/test_test_labels_inner.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_labels_inner import TestLabelsInner + +class TestTestLabelsInner(unittest.TestCase): + """TestLabelsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestLabelsInner: + """Test TestLabelsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestLabelsInner` + """ + model = TestLabelsInner() + if include_optional: + return TestLabelsInner( + label_id = '', + name = '', + is_built_in = True + ) + else: + return TestLabelsInner( + ) + """ + + def testTestLabelsInner(self): + """Test TestLabelsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_page_loading_strategy.py b/instant_tests_api/test/test_test_page_loading_strategy.py new file mode 100644 index 00000000..ce2ff58b --- /dev/null +++ b/instant_tests_api/test/test_test_page_loading_strategy.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy + +class TestTestPageLoadingStrategy(unittest.TestCase): + """TestPageLoadingStrategy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestPageLoadingStrategy(self): + """Test TestPageLoadingStrategy""" + # inst = TestPageLoadingStrategy() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_path_trace_mode.py b/instant_tests_api/test/test_test_path_trace_mode.py new file mode 100644 index 00000000..51c8b9d8 --- /dev/null +++ b/instant_tests_api/test/test_test_path_trace_mode.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_path_trace_mode import TestPathTraceMode + +class TestTestPathTraceMode(unittest.TestCase): + """TestPathTraceMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestPathTraceMode(self): + """Test TestPathTraceMode""" + # inst = TestPathTraceMode() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_probe_mode.py b/instant_tests_api/test/test_test_probe_mode.py new file mode 100644 index 00000000..80adda20 --- /dev/null +++ b/instant_tests_api/test/test_test_probe_mode.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_probe_mode import TestProbeMode + +class TestTestProbeMode(unittest.TestCase): + """TestProbeMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestProbeMode(self): + """Test TestProbeMode""" + # inst = TestProbeMode() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_protocol.py b/instant_tests_api/test/test_test_protocol.py new file mode 100644 index 00000000..8322c1f0 --- /dev/null +++ b/instant_tests_api/test/test_test_protocol.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_protocol import TestProtocol + +class TestTestProtocol(unittest.TestCase): + """TestProtocol unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestProtocol(self): + """Test TestProtocol""" + # inst = TestProtocol() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_shared_accounts_inner.py b/instant_tests_api/test/test_test_shared_accounts_inner.py new file mode 100644 index 00000000..0c1af1e6 --- /dev/null +++ b/instant_tests_api/test/test_test_shared_accounts_inner.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner + +class TestTestSharedAccountsInner(unittest.TestCase): + """TestSharedAccountsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestSharedAccountsInner: + """Test TestSharedAccountsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestSharedAccountsInner` + """ + model = TestSharedAccountsInner() + if include_optional: + return TestSharedAccountsInner( + aid = '105', + name = 'Account name' + ) + else: + return TestSharedAccountsInner( + ) + """ + + def testTestSharedAccountsInner(self): + """Test TestSharedAccountsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_sip_credentials.py b/instant_tests_api/test/test_test_sip_credentials.py new file mode 100644 index 00000000..03c36a6b --- /dev/null +++ b/instant_tests_api/test/test_test_sip_credentials.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_sip_credentials import TestSipCredentials + +class TestTestSipCredentials(unittest.TestCase): + """TestSipCredentials unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestSipCredentials: + """Test TestSipCredentials + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestSipCredentials` + """ + model = TestSipCredentials() + if include_optional: + return TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username' + ) + else: + return TestSipCredentials( + port = 1024, + ) + """ + + def testTestSipCredentials(self): + """Test TestSipCredentials""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_ssl_version_id.py b/instant_tests_api/test/test_test_ssl_version_id.py new file mode 100644 index 00000000..6d750381 --- /dev/null +++ b/instant_tests_api/test/test_test_ssl_version_id.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_ssl_version_id import TestSslVersionId + +class TestTestSslVersionId(unittest.TestCase): + """TestSslVersionId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestSslVersionId(self): + """Test TestSslVersionId""" + # inst = TestSslVersionId() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_test_type.py b/instant_tests_api/test/test_test_type.py new file mode 100644 index 00000000..27146304 --- /dev/null +++ b/instant_tests_api/test/test_test_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.test_type import TestType + +class TestTestType(unittest.TestCase): + """TestType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestType(self): + """Test TestType""" + # inst = TestType() + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_unauthorized_error.py b/instant_tests_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..a305efae --- /dev/null +++ b/instant_tests_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_unexpanded_instant_test.py b/instant_tests_api/test/test_unexpanded_instant_test.py new file mode 100644 index 00000000..a8c2e130 --- /dev/null +++ b/instant_tests_api/test/test_unexpanded_instant_test.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.unexpanded_instant_test import UnexpandedInstantTest + +class TestUnexpandedInstantTest(unittest.TestCase): + """UnexpandedInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTest: + """Test UnexpandedInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTest` + """ + model = UnexpandedInstantTest() + if include_optional: + return UnexpandedInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ) + ) + else: + return UnexpandedInstantTest( + ) + """ + + def testUnexpandedInstantTest(self): + """Test UnexpandedInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_unexpanded_instant_test_links.py b/instant_tests_api/test/test_unexpanded_instant_test_links.py new file mode 100644 index 00000000..7d0cb298 --- /dev/null +++ b/instant_tests_api/test/test_unexpanded_instant_test_links.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks + +class TestUnexpandedInstantTestLinks(unittest.TestCase): + """UnexpandedInstantTestLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinks: + """Test UnexpandedInstantTestLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinks` + """ + model = UnexpandedInstantTestLinks() + if include_optional: + return UnexpandedInstantTestLinks( + var_self = None, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}] + ) + else: + return UnexpandedInstantTestLinks( + ) + """ + + def testUnexpandedInstantTestLinks(self): + """Test UnexpandedInstantTestLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_unexpanded_instant_test_links_self.py b/instant_tests_api/test/test_unexpanded_instant_test_links_self.py new file mode 100644 index 00000000..92765ee8 --- /dev/null +++ b/instant_tests_api/test/test_unexpanded_instant_test_links_self.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf + +class TestUnexpandedInstantTestLinksSelf(unittest.TestCase): + """UnexpandedInstantTestLinksSelf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinksSelf: + """Test UnexpandedInstantTestLinksSelf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinksSelf` + """ + model = UnexpandedInstantTestLinksSelf() + if include_optional: + return UnexpandedInstantTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return UnexpandedInstantTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testUnexpandedInstantTestLinksSelf(self): + """Test UnexpandedInstantTestLinksSelf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_unexpanded_instant_test_links_test_results.py b/instant_tests_api/test/test_unexpanded_instant_test_links_test_results.py new file mode 100644 index 00000000..c75b50a9 --- /dev/null +++ b/instant_tests_api/test/test_unexpanded_instant_test_links_test_results.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults + +class TestUnexpandedInstantTestLinksTestResults(unittest.TestCase): + """UnexpandedInstantTestLinksTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinksTestResults: + """Test UnexpandedInstantTestLinksTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinksTestResults` + """ + model = UnexpandedInstantTestLinksTestResults() + if include_optional: + return UnexpandedInstantTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return UnexpandedInstantTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testUnexpandedInstantTestLinksTestResults(self): + """Test UnexpandedInstantTestLinksTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_voice_api.py b/instant_tests_api/test/test_voice_api.py new file mode 100644 index 00000000..5d4219ff --- /dev/null +++ b/instant_tests_api/test/test_voice_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest + +from instant_tests_api.api.voice_api import VoiceApi + + +class TestVoiceApi(unittest.TestCase): + """VoiceApi unit test stubs""" + + def setUp(self) -> None: + self.api = VoiceApi() + + def tearDown(self) -> None: + pass + + def test_post_instant_voice(self) -> None: + """Test case for post_instant_voice + + Create voice instant test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_voice_instant_test.py b/instant_tests_api/test/test_voice_instant_test.py new file mode 100644 index 00000000..94476f77 --- /dev/null +++ b/instant_tests_api/test/test_voice_instant_test.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.voice_instant_test import VoiceInstantTest + +class TestVoiceInstantTest(unittest.TestCase): + """VoiceInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VoiceInstantTest: + """Test VoiceInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VoiceInstantTest` + """ + model = VoiceInstantTest() + if include_optional: + return VoiceInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'voice', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + instant_tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + instant_tests_api.models.agent.Agent() + ], + codec = 'G.711 @ 64 Kbps', + codec_id = '0', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + duration = 5, + jitter_buffer = 0, + num_path_traces = 3, + port = 1024, + target_agent_id = '281474976710706' + ) + else: + return VoiceInstantTest( + agents = [ + instant_tests_api.models.agent.Agent() + ], + target_agent_id = '281474976710706', + ) + """ + + def testVoiceInstantTest(self): + """Test VoiceInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_voice_instant_test_request.py b/instant_tests_api/test/test_voice_instant_test_request.py new file mode 100644 index 00000000..52e42697 --- /dev/null +++ b/instant_tests_api/test/test_voice_instant_test_request.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.voice_instant_test_request import VoiceInstantTestRequest + +class TestVoiceInstantTestRequest(unittest.TestCase): + """VoiceInstantTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VoiceInstantTestRequest: + """Test VoiceInstantTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VoiceInstantTestRequest` + """ + model = VoiceInstantTestRequest() + if include_optional: + return VoiceInstantTestRequest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'voice', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + codec = 'G.711 @ 64 Kbps', + codec_id = '0', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + duration = 5, + jitter_buffer = 0, + num_path_traces = 3, + port = 1024, + target_agent_id = '281474976710706' + ) + else: + return VoiceInstantTestRequest( + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + target_agent_id = '281474976710706', + ) + """ + + def testVoiceInstantTestRequest(self): + """Test VoiceInstantTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_web_transaction_api.py b/instant_tests_api/test/test_web_transaction_api.py new file mode 100644 index 00000000..d50005f7 --- /dev/null +++ b/instant_tests_api/test/test_web_transaction_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest + +from instant_tests_api.api.web_transaction_api import WebTransactionApi + + +class TestWebTransactionApi(unittest.TestCase): + """WebTransactionApi unit test stubs""" + + def setUp(self) -> None: + self.api = WebTransactionApi() + + def tearDown(self) -> None: + pass + + def test_post_instant_web_transactions(self) -> None: + """Test case for post_instant_web_transactions + + Create web transactions instant test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_web_transaction_instant_test.py b/instant_tests_api/test/test_web_transaction_instant_test.py new file mode 100644 index 00000000..fe87049d --- /dev/null +++ b/instant_tests_api/test/test_web_transaction_instant_test.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.web_transaction_instant_test import WebTransactionInstantTest + +class TestWebTransactionInstantTest(unittest.TestCase): + """WebTransactionInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebTransactionInstantTest: + """Test WebTransactionInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebTransactionInstantTest` + """ + model = WebTransactionInstantTest() + if include_optional: + return WebTransactionInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'web-transactions', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + instant_tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + instant_tests_api.models.agent.Agent() + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + credentials = ["3247","1051"], + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + desired_status_code = '200', + follow_redirects = True, + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + target_time = 1, + time_limit = 5, + transaction_script = 'if (true) { return true; }', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + block_domains = 'domain.com/', + disable_screenshot = True, + allow_mic_and_camera = True, + allow_geolocation = True, + browser_language = 'en-US', + page_loading_strategy = 'normal', + fixed_packet_rate = 50 + ) + else: + return WebTransactionInstantTest( + agents = [ + instant_tests_api.models.agent.Agent() + ], + transaction_script = 'if (true) { return true; }', + url = 'www.thousandeyes.com', + ) + """ + + def testWebTransactionInstantTest(self): + """Test WebTransactionInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/test/test_web_transaction_instant_test_request.py b/instant_tests_api/test/test_web_transaction_instant_test_request.py new file mode 100644 index 00000000..acbf1d4f --- /dev/null +++ b/instant_tests_api/test/test_web_transaction_instant_test_request.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Instant Tests API + + ### Overview The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + 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 unittest +import datetime + +from instant_tests_api.models.web_transaction_instant_test_request import WebTransactionInstantTestRequest + +class TestWebTransactionInstantTestRequest(unittest.TestCase): + """WebTransactionInstantTestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebTransactionInstantTestRequest: + """Test WebTransactionInstantTestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebTransactionInstantTestRequest` + """ + model = WebTransactionInstantTestRequest() + if include_optional: + return WebTransactionInstantTestRequest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'web-transactions', + links = instant_tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + credentials = [3247, 1051], + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + desired_status_code = '200', + follow_redirects = True, + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + target_time = 1, + time_limit = 5, + transaction_script = 'if (true) { return true; }', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + block_domains = 'domain.com/', + disable_screenshot = True, + allow_mic_and_camera = True, + allow_geolocation = True, + browser_language = 'en-US', + page_loading_strategy = 'normal', + fixed_packet_rate = 50 + ) + else: + return WebTransactionInstantTestRequest( + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + transaction_script = 'if (true) { return true; }', + url = 'www.thousandeyes.com', + ) + """ + + def testWebTransactionInstantTestRequest(self): + """Test WebTransactionInstantTestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/instant_tests_api/tox.ini b/instant_tests_api/tox.ini new file mode 100644 index 00000000..3e5809f2 --- /dev/null +++ b/instant_tests_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=instant_tests_api diff --git a/internet_insights_api/.github/workflows/python.yml b/internet_insights_api/.github/workflows/python.yml new file mode 100644 index 00000000..e9128bab --- /dev/null +++ b/internet_insights_api/.github/workflows/python.yml @@ -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: internet_insights_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 diff --git a/internet_insights_api/.gitignore b/internet_insights_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/internet_insights_api/.gitignore @@ -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 diff --git a/internet_insights_api/.gitlab-ci.yml b/internet_insights_api/.gitlab-ci.yml new file mode 100644 index 00000000..0f11e5d9 --- /dev/null +++ b/internet_insights_api/.gitlab-ci.yml @@ -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=internet_insights_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 diff --git a/internet_insights_api/.openapi-generator-ignore b/internet_insights_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/internet_insights_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/internet_insights_api/.openapi-generator/FILES b/internet_insights_api/.openapi-generator/FILES new file mode 100644 index 00000000..a9d251f6 --- /dev/null +++ b/internet_insights_api/.openapi-generator/FILES @@ -0,0 +1,110 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/ApiAffectedAgent.md +docs/ApiAffectedTest.md +docs/ApiApplicationOutageAffectedLocation.md +docs/ApiApplicationOutageAffectedServer.md +docs/ApiApplicationOutageDetails.md +docs/ApiApplicationOutageResponse.md +docs/ApiAsn.md +docs/ApiCatalogProvider.md +docs/ApiCatalogProviderDetails.md +docs/ApiCatalogProviderDetailsLocationsInner.md +docs/ApiCatalogProviderDetailsResponse.md +docs/ApiCatalogProviderFilter.md +docs/ApiCatalogProviderResponse.md +docs/ApiCatalogProviderResponseAllOfProvidersInner.md +docs/ApiNetworkOutageAffectedLocation.md +docs/ApiNetworkOutageDetails.md +docs/ApiNetworkOutageResponse.md +docs/ApiOutage.md +docs/ApiOutageFilter.md +docs/ApiOutagesResponse.md +docs/ApiOutagesResponseAllOfOutagesInner.md +docs/CatalogProvidersApi.md +docs/Error.md +docs/Link.md +docs/OutageScope.md +docs/OutagesAPIPublicApi.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/UnauthorizedError.md +git_push.sh +internet_insights_api/__init__.py +internet_insights_api/api/__init__.py +internet_insights_api/api/catalog_providers_api.py +internet_insights_api/api/outages_api_public_api.py +internet_insights_api/api_client.py +internet_insights_api/api_response.py +internet_insights_api/configuration.py +internet_insights_api/exceptions.py +internet_insights_api/models/__init__.py +internet_insights_api/models/api_affected_agent.py +internet_insights_api/models/api_affected_test.py +internet_insights_api/models/api_application_outage_affected_location.py +internet_insights_api/models/api_application_outage_affected_server.py +internet_insights_api/models/api_application_outage_details.py +internet_insights_api/models/api_application_outage_response.py +internet_insights_api/models/api_asn.py +internet_insights_api/models/api_catalog_provider.py +internet_insights_api/models/api_catalog_provider_details.py +internet_insights_api/models/api_catalog_provider_details_locations_inner.py +internet_insights_api/models/api_catalog_provider_details_response.py +internet_insights_api/models/api_catalog_provider_filter.py +internet_insights_api/models/api_catalog_provider_response.py +internet_insights_api/models/api_catalog_provider_response_all_of_providers_inner.py +internet_insights_api/models/api_network_outage_affected_location.py +internet_insights_api/models/api_network_outage_details.py +internet_insights_api/models/api_network_outage_response.py +internet_insights_api/models/api_outage.py +internet_insights_api/models/api_outage_filter.py +internet_insights_api/models/api_outages_response.py +internet_insights_api/models/api_outages_response_all_of_outages_inner.py +internet_insights_api/models/error.py +internet_insights_api/models/link.py +internet_insights_api/models/outage_scope.py +internet_insights_api/models/self_links.py +internet_insights_api/models/self_links_links.py +internet_insights_api/models/unauthorized_error.py +internet_insights_api/py.typed +internet_insights_api/rest.py +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_api_affected_agent.py +test/test_api_affected_test.py +test/test_api_application_outage_affected_location.py +test/test_api_application_outage_affected_server.py +test/test_api_application_outage_details.py +test/test_api_application_outage_response.py +test/test_api_asn.py +test/test_api_catalog_provider.py +test/test_api_catalog_provider_details.py +test/test_api_catalog_provider_details_locations_inner.py +test/test_api_catalog_provider_details_response.py +test/test_api_catalog_provider_filter.py +test/test_api_catalog_provider_response.py +test/test_api_catalog_provider_response_all_of_providers_inner.py +test/test_api_network_outage_affected_location.py +test/test_api_network_outage_details.py +test/test_api_network_outage_response.py +test/test_api_outage.py +test/test_api_outage_filter.py +test/test_api_outages_response.py +test/test_api_outages_response_all_of_outages_inner.py +test/test_catalog_providers_api.py +test/test_error.py +test/test_link.py +test/test_outage_scope.py +test/test_outages_api_public_api.py +test/test_self_links.py +test/test_self_links_links.py +test/test_unauthorized_error.py +tox.ini diff --git a/internet_insights_api/.openapi-generator/VERSION b/internet_insights_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/internet_insights_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/internet_insights_api/.travis.yml b/internet_insights_api/.travis.yml new file mode 100644 index 00000000..d5a4acdb --- /dev/null +++ b/internet_insights_api/.travis.yml @@ -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=internet_insights_api diff --git a/internet_insights_api/README.md b/internet_insights_api/README.md new file mode 100644 index 00000000..6ade8f7a --- /dev/null +++ b/internet_insights_api/README.md @@ -0,0 +1,160 @@ +# internet-insights-api +# Overview +We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: +* Make our catalog provider and Internet outage data accessible to API users. +* Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. + +Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. +It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. + +Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + +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 internet_insights_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 internet_insights_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 internet_insights_api +from internet_insights_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 = internet_insights_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 = internet_insights_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with internet_insights_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = internet_insights_api.CatalogProvidersApi(api_client) + api_catalog_provider_filter = internet_insights_api.ApiCatalogProviderFilter() # ApiCatalogProviderFilter | + 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 catalog providers + api_response = api_instance.catalog_provider_list(api_catalog_provider_filter, aid=aid) + print("The response of CatalogProvidersApi->catalog_provider_list:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling CatalogProvidersApi->catalog_provider_list: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CatalogProvidersApi* | [**catalog_provider_list**](docs/CatalogProvidersApi.md#catalog_provider_list) | **POST** /v7/internet-insights/catalog/providers/filter | List catalog providers +*CatalogProvidersApi* | [**get_catalog_provider**](docs/CatalogProvidersApi.md#get_catalog_provider) | **GET** /v7/internet-insights/catalog/providers/{providerId} | Retrieve a catalog provider +*OutagesAPIPublicApi* | [**get_outages_app**](docs/OutagesAPIPublicApi.md#get_outages_app) | **GET** /v7/internet-insights/outages/app/{outageId} | Retrieve application outage +*OutagesAPIPublicApi* | [**get_outages_filter**](docs/OutagesAPIPublicApi.md#get_outages_filter) | **POST** /v7/internet-insights/outages/filter | List network and application outages +*OutagesAPIPublicApi* | [**get_outages_net**](docs/OutagesAPIPublicApi.md#get_outages_net) | **GET** /v7/internet-insights/outages/net/{outageId} | Retrieve network outage + + +## Documentation For Models + + - [ApiAffectedAgent](docs/ApiAffectedAgent.md) + - [ApiAffectedTest](docs/ApiAffectedTest.md) + - [ApiApplicationOutageAffectedLocation](docs/ApiApplicationOutageAffectedLocation.md) + - [ApiApplicationOutageAffectedServer](docs/ApiApplicationOutageAffectedServer.md) + - [ApiApplicationOutageDetails](docs/ApiApplicationOutageDetails.md) + - [ApiApplicationOutageResponse](docs/ApiApplicationOutageResponse.md) + - [ApiAsn](docs/ApiAsn.md) + - [ApiCatalogProvider](docs/ApiCatalogProvider.md) + - [ApiCatalogProviderDetails](docs/ApiCatalogProviderDetails.md) + - [ApiCatalogProviderDetailsLocationsInner](docs/ApiCatalogProviderDetailsLocationsInner.md) + - [ApiCatalogProviderDetailsResponse](docs/ApiCatalogProviderDetailsResponse.md) + - [ApiCatalogProviderFilter](docs/ApiCatalogProviderFilter.md) + - [ApiCatalogProviderResponse](docs/ApiCatalogProviderResponse.md) + - [ApiCatalogProviderResponseAllOfProvidersInner](docs/ApiCatalogProviderResponseAllOfProvidersInner.md) + - [ApiNetworkOutageAffectedLocation](docs/ApiNetworkOutageAffectedLocation.md) + - [ApiNetworkOutageDetails](docs/ApiNetworkOutageDetails.md) + - [ApiNetworkOutageResponse](docs/ApiNetworkOutageResponse.md) + - [ApiOutage](docs/ApiOutage.md) + - [ApiOutageFilter](docs/ApiOutageFilter.md) + - [ApiOutagesResponse](docs/ApiOutagesResponse.md) + - [ApiOutagesResponseAllOfOutagesInner](docs/ApiOutagesResponseAllOfOutagesInner.md) + - [Error](docs/Error.md) + - [Link](docs/Link.md) + - [OutageScope](docs/OutageScope.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/internet_insights_api/docs/ApiAffectedAgent.md b/internet_insights_api/docs/ApiAffectedAgent.md new file mode 100644 index 00000000..8dfd45f6 --- /dev/null +++ b/internet_insights_api/docs/ApiAffectedAgent.md @@ -0,0 +1,29 @@ +# ApiAffectedAgent + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from internet_insights_api.models.api_affected_agent import ApiAffectedAgent + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAffectedAgent from a JSON string +api_affected_agent_instance = ApiAffectedAgent.from_json(json) +# print the JSON string representation of the object +print ApiAffectedAgent.to_json() + +# convert the object into a dict +api_affected_agent_dict = api_affected_agent_instance.to_dict() +# create an instance of ApiAffectedAgent from a dict +api_affected_agent_form_dict = api_affected_agent.from_dict(api_affected_agent_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiAffectedTest.md b/internet_insights_api/docs/ApiAffectedTest.md new file mode 100644 index 00000000..a3c4de2b --- /dev/null +++ b/internet_insights_api/docs/ApiAffectedTest.md @@ -0,0 +1,29 @@ +# ApiAffectedTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from internet_insights_api.models.api_affected_test import ApiAffectedTest + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAffectedTest from a JSON string +api_affected_test_instance = ApiAffectedTest.from_json(json) +# print the JSON string representation of the object +print ApiAffectedTest.to_json() + +# convert the object into a dict +api_affected_test_dict = api_affected_test_instance.to_dict() +# create an instance of ApiAffectedTest from a dict +api_affected_test_form_dict = api_affected_test.from_dict(api_affected_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiApplicationOutageAffectedLocation.md b/internet_insights_api/docs/ApiApplicationOutageAffectedLocation.md new file mode 100644 index 00000000..90b5969f --- /dev/null +++ b/internet_insights_api/docs/ApiApplicationOutageAffectedLocation.md @@ -0,0 +1,29 @@ +# ApiApplicationOutageAffectedLocation + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**location** | **str** | The affected location. | [optional] +**affected_servers** | [**List[ApiApplicationOutageAffectedServer]**](ApiApplicationOutageAffectedServer.md) | The number of affected servers in this location. | [optional] + +## Example + +```python +from internet_insights_api.models.api_application_outage_affected_location import ApiApplicationOutageAffectedLocation + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiApplicationOutageAffectedLocation from a JSON string +api_application_outage_affected_location_instance = ApiApplicationOutageAffectedLocation.from_json(json) +# print the JSON string representation of the object +print ApiApplicationOutageAffectedLocation.to_json() + +# convert the object into a dict +api_application_outage_affected_location_dict = api_application_outage_affected_location_instance.to_dict() +# create an instance of ApiApplicationOutageAffectedLocation from a dict +api_application_outage_affected_location_form_dict = api_application_outage_affected_location.from_dict(api_application_outage_affected_location_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiApplicationOutageAffectedServer.md b/internet_insights_api/docs/ApiApplicationOutageAffectedServer.md new file mode 100644 index 00000000..d062980d --- /dev/null +++ b/internet_insights_api/docs/ApiApplicationOutageAffectedServer.md @@ -0,0 +1,29 @@ +# ApiApplicationOutageAffectedServer + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domain** | **str** | | [optional] +**prefix** | **str** | | [optional] + +## Example + +```python +from internet_insights_api.models.api_application_outage_affected_server import ApiApplicationOutageAffectedServer + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiApplicationOutageAffectedServer from a JSON string +api_application_outage_affected_server_instance = ApiApplicationOutageAffectedServer.from_json(json) +# print the JSON string representation of the object +print ApiApplicationOutageAffectedServer.to_json() + +# convert the object into a dict +api_application_outage_affected_server_dict = api_application_outage_affected_server_instance.to_dict() +# create an instance of ApiApplicationOutageAffectedServer from a dict +api_application_outage_affected_server_form_dict = api_application_outage_affected_server.from_dict(api_application_outage_affected_server_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiApplicationOutageDetails.md b/internet_insights_api/docs/ApiApplicationOutageDetails.md new file mode 100644 index 00000000..89df0580 --- /dev/null +++ b/internet_insights_api/docs/ApiApplicationOutageDetails.md @@ -0,0 +1,41 @@ +# ApiApplicationOutageDetails + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The ID of the outage. | [optional] +**provider_name** | **str** | The name of the affected provider. | [optional] +**provider_type** | **str** | The type of the affected provider. | [optional] +**application_name** | **str** | The name of the affected application. | [optional] +**start_date** | **str** | Date and time when the outage started. | [optional] +**start_round_id** | **int** | Epoch time (seconds) when the outage started. | [optional] +**end_date** | **str** | Date and time when the outage ended. | [optional] +**end_round_id** | **int** | Epoch time (seconds) when the outage ended. | [optional] +**duration** | **int** | Duration of the outage in seconds. | [optional] +**affected_tests** | [**List[ApiAffectedTest]**](ApiAffectedTest.md) | List of affected tests. | [optional] +**affected_domains** | **List[str]** | List of affected domains. | [optional] +**affected_agents** | [**List[ApiAffectedAgent]**](ApiAffectedAgent.md) | List of affected agents. | [optional] +**errors** | **List[str]** | List of errors. | [optional] +**affected_locations** | [**List[ApiApplicationOutageAffectedLocation]**](ApiApplicationOutageAffectedLocation.md) | List of affected locations. | [optional] + +## Example + +```python +from internet_insights_api.models.api_application_outage_details import ApiApplicationOutageDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiApplicationOutageDetails from a JSON string +api_application_outage_details_instance = ApiApplicationOutageDetails.from_json(json) +# print the JSON string representation of the object +print ApiApplicationOutageDetails.to_json() + +# convert the object into a dict +api_application_outage_details_dict = api_application_outage_details_instance.to_dict() +# create an instance of ApiApplicationOutageDetails from a dict +api_application_outage_details_form_dict = api_application_outage_details.from_dict(api_application_outage_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) + + diff --git a/internet_insights_api/docs/ApiApplicationOutageResponse.md b/internet_insights_api/docs/ApiApplicationOutageResponse.md new file mode 100644 index 00000000..ec2e9966 --- /dev/null +++ b/internet_insights_api/docs/ApiApplicationOutageResponse.md @@ -0,0 +1,42 @@ +# ApiApplicationOutageResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The ID of the outage. | [optional] +**provider_name** | **str** | The name of the affected provider. | [optional] +**provider_type** | **str** | The type of the affected provider. | [optional] +**application_name** | **str** | The name of the affected application. | [optional] +**start_date** | **str** | Date and time when the outage started. | [optional] +**start_round_id** | **int** | Epoch time (seconds) when the outage started. | [optional] +**end_date** | **str** | Date and time when the outage ended. | [optional] +**end_round_id** | **int** | Epoch time (seconds) when the outage ended. | [optional] +**duration** | **int** | Duration of the outage in seconds. | [optional] +**affected_tests** | [**List[ApiAffectedTest]**](ApiAffectedTest.md) | List of affected tests. | [optional] +**affected_domains** | **List[str]** | List of affected domains. | [optional] +**affected_agents** | [**List[ApiAffectedAgent]**](ApiAffectedAgent.md) | List of affected agents. | [optional] +**errors** | **List[str]** | List of errors. | [optional] +**affected_locations** | [**List[ApiApplicationOutageAffectedLocation]**](ApiApplicationOutageAffectedLocation.md) | List of affected locations. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from internet_insights_api.models.api_application_outage_response import ApiApplicationOutageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiApplicationOutageResponse from a JSON string +api_application_outage_response_instance = ApiApplicationOutageResponse.from_json(json) +# print the JSON string representation of the object +print ApiApplicationOutageResponse.to_json() + +# convert the object into a dict +api_application_outage_response_dict = api_application_outage_response_instance.to_dict() +# create an instance of ApiApplicationOutageResponse from a dict +api_application_outage_response_form_dict = api_application_outage_response.from_dict(api_application_outage_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiAsn.md b/internet_insights_api/docs/ApiAsn.md new file mode 100644 index 00000000..8a8f50fb --- /dev/null +++ b/internet_insights_api/docs/ApiAsn.md @@ -0,0 +1,29 @@ +# ApiAsn + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | ASN (Autonomous Systems Number) | [optional] +**name** | **str** | ASN (Autonomous Systems Number) name | [optional] + +## Example + +```python +from internet_insights_api.models.api_asn import ApiAsn + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAsn from a JSON string +api_asn_instance = ApiAsn.from_json(json) +# print the JSON string representation of the object +print ApiAsn.to_json() + +# convert the object into a dict +api_asn_dict = api_asn_instance.to_dict() +# create an instance of ApiAsn from a dict +api_asn_form_dict = api_asn.from_dict(api_asn_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiCatalogProvider.md b/internet_insights_api/docs/ApiCatalogProvider.md new file mode 100644 index 00000000..7671c2c3 --- /dev/null +++ b/internet_insights_api/docs/ApiCatalogProvider.md @@ -0,0 +1,38 @@ +# ApiCatalogProvider + +Catalog provider + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The catalog provider ID. | [optional] +**provider_name** | **str** | The name of the catalog provider. | [optional] +**provider_type** | **str** | The type of catalog provider. | [optional] +**region** | **str** | The catalog provider region. | [optional] +**data_type** | **str** | The type of data produced by the provider. | [optional] +**asns_count** | **int** | The number of ASN's covered by the provider. | [optional] +**countries_count** | **int** | The number of countries covered by the provider. | [optional] +**locations_count** | **int** | The number of locations covered by the provider. | [optional] +**interfaces_count** | **int** | The number of interfaces covered by the provider. | [optional] +**included** | **bool** | Indicates whether the catalog provider is included in the licensed packages. | [optional] + +## Example + +```python +from internet_insights_api.models.api_catalog_provider import ApiCatalogProvider + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiCatalogProvider from a JSON string +api_catalog_provider_instance = ApiCatalogProvider.from_json(json) +# print the JSON string representation of the object +print ApiCatalogProvider.to_json() + +# convert the object into a dict +api_catalog_provider_dict = api_catalog_provider_instance.to_dict() +# create an instance of ApiCatalogProvider from a dict +api_catalog_provider_form_dict = api_catalog_provider.from_dict(api_catalog_provider_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiCatalogProviderDetails.md b/internet_insights_api/docs/ApiCatalogProviderDetails.md new file mode 100644 index 00000000..6d84563d --- /dev/null +++ b/internet_insights_api/docs/ApiCatalogProviderDetails.md @@ -0,0 +1,34 @@ +# ApiCatalogProviderDetails + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The catalog provider ID. | [optional] +**provider_name** | **str** | The name of the catalog provider. | [optional] +**provider_type** | **str** | The type of catalog provider. | [optional] +**region** | **str** | The catalog provider region. | [optional] +**data_type** | **str** | The type of data produced by the provider. | [optional] +**asns** | [**List[ApiAsn]**](ApiAsn.md) | List of ASN's covered by the Provider. | [optional] +**locations** | [**List[ApiCatalogProviderDetailsLocationsInner]**](ApiCatalogProviderDetailsLocationsInner.md) | List of locations covered by the Provider. | [optional] + +## Example + +```python +from internet_insights_api.models.api_catalog_provider_details import ApiCatalogProviderDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiCatalogProviderDetails from a JSON string +api_catalog_provider_details_instance = ApiCatalogProviderDetails.from_json(json) +# print the JSON string representation of the object +print ApiCatalogProviderDetails.to_json() + +# convert the object into a dict +api_catalog_provider_details_dict = api_catalog_provider_details_instance.to_dict() +# create an instance of ApiCatalogProviderDetails from a dict +api_catalog_provider_details_form_dict = api_catalog_provider_details.from_dict(api_catalog_provider_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) + + diff --git a/internet_insights_api/docs/ApiCatalogProviderDetailsLocationsInner.md b/internet_insights_api/docs/ApiCatalogProviderDetailsLocationsInner.md new file mode 100644 index 00000000..35dc0793 --- /dev/null +++ b/internet_insights_api/docs/ApiCatalogProviderDetailsLocationsInner.md @@ -0,0 +1,29 @@ +# ApiCatalogProviderDetailsLocationsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**location** | **str** | The location covered by the Provider. | [optional] +**interfaces_count** | **int** | The number of interfaces covered by the Provider at this location. | [optional] + +## Example + +```python +from internet_insights_api.models.api_catalog_provider_details_locations_inner import ApiCatalogProviderDetailsLocationsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiCatalogProviderDetailsLocationsInner from a JSON string +api_catalog_provider_details_locations_inner_instance = ApiCatalogProviderDetailsLocationsInner.from_json(json) +# print the JSON string representation of the object +print ApiCatalogProviderDetailsLocationsInner.to_json() + +# convert the object into a dict +api_catalog_provider_details_locations_inner_dict = api_catalog_provider_details_locations_inner_instance.to_dict() +# create an instance of ApiCatalogProviderDetailsLocationsInner from a dict +api_catalog_provider_details_locations_inner_form_dict = api_catalog_provider_details_locations_inner.from_dict(api_catalog_provider_details_locations_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiCatalogProviderDetailsResponse.md b/internet_insights_api/docs/ApiCatalogProviderDetailsResponse.md new file mode 100644 index 00000000..eeae8e4b --- /dev/null +++ b/internet_insights_api/docs/ApiCatalogProviderDetailsResponse.md @@ -0,0 +1,35 @@ +# ApiCatalogProviderDetailsResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The catalog provider ID. | [optional] +**provider_name** | **str** | The name of the catalog provider. | [optional] +**provider_type** | **str** | The type of catalog provider. | [optional] +**region** | **str** | The catalog provider region. | [optional] +**data_type** | **str** | The type of data produced by the provider. | [optional] +**asns** | [**List[ApiAsn]**](ApiAsn.md) | List of ASN's covered by the Provider. | [optional] +**locations** | [**List[ApiCatalogProviderDetailsLocationsInner]**](ApiCatalogProviderDetailsLocationsInner.md) | List of locations covered by the Provider. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from internet_insights_api.models.api_catalog_provider_details_response import ApiCatalogProviderDetailsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiCatalogProviderDetailsResponse from a JSON string +api_catalog_provider_details_response_instance = ApiCatalogProviderDetailsResponse.from_json(json) +# print the JSON string representation of the object +print ApiCatalogProviderDetailsResponse.to_json() + +# convert the object into a dict +api_catalog_provider_details_response_dict = api_catalog_provider_details_response_instance.to_dict() +# create an instance of ApiCatalogProviderDetailsResponse from a dict +api_catalog_provider_details_response_form_dict = api_catalog_provider_details_response.from_dict(api_catalog_provider_details_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiCatalogProviderFilter.md b/internet_insights_api/docs/ApiCatalogProviderFilter.md new file mode 100644 index 00000000..8a786bf1 --- /dev/null +++ b/internet_insights_api/docs/ApiCatalogProviderFilter.md @@ -0,0 +1,34 @@ +# ApiCatalogProviderFilter + +Advanced filter query used to filter the response. The provider name, location, asn can be partial names. Can filter on: - Provider name - Provider type - Region - Location - ASN - included + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**provider_name** | **str** | The name of the catalog provider. | [optional] +**provider_type** | **str** | The type of catalog provider. | [optional] +**region** | **str** | The catalog provider region. | [optional] +**location** | **str** | Location of the catalog provider. | [optional] +**asn** | **str** | Name of the ASN (Autonomous Systems Number) covered by providers. | [optional] +**included** | **bool** | Indicates whether the catalog provider is included in the licensed packages. true returns providers covered by licensed packages, false returns providers not covered by licensed packages. | [optional] + +## Example + +```python +from internet_insights_api.models.api_catalog_provider_filter import ApiCatalogProviderFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiCatalogProviderFilter from a JSON string +api_catalog_provider_filter_instance = ApiCatalogProviderFilter.from_json(json) +# print the JSON string representation of the object +print ApiCatalogProviderFilter.to_json() + +# convert the object into a dict +api_catalog_provider_filter_dict = api_catalog_provider_filter_instance.to_dict() +# create an instance of ApiCatalogProviderFilter from a dict +api_catalog_provider_filter_form_dict = api_catalog_provider_filter.from_dict(api_catalog_provider_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiCatalogProviderResponse.md b/internet_insights_api/docs/ApiCatalogProviderResponse.md new file mode 100644 index 00000000..e6054cef --- /dev/null +++ b/internet_insights_api/docs/ApiCatalogProviderResponse.md @@ -0,0 +1,29 @@ +# ApiCatalogProviderResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**providers** | [**List[ApiCatalogProviderResponseAllOfProvidersInner]**](ApiCatalogProviderResponseAllOfProvidersInner.md) | List of catalog providers. | [optional] + +## Example + +```python +from internet_insights_api.models.api_catalog_provider_response import ApiCatalogProviderResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiCatalogProviderResponse from a JSON string +api_catalog_provider_response_instance = ApiCatalogProviderResponse.from_json(json) +# print the JSON string representation of the object +print ApiCatalogProviderResponse.to_json() + +# convert the object into a dict +api_catalog_provider_response_dict = api_catalog_provider_response_instance.to_dict() +# create an instance of ApiCatalogProviderResponse from a dict +api_catalog_provider_response_form_dict = api_catalog_provider_response.from_dict(api_catalog_provider_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiCatalogProviderResponseAllOfProvidersInner.md b/internet_insights_api/docs/ApiCatalogProviderResponseAllOfProvidersInner.md new file mode 100644 index 00000000..2ae008b3 --- /dev/null +++ b/internet_insights_api/docs/ApiCatalogProviderResponseAllOfProvidersInner.md @@ -0,0 +1,38 @@ +# ApiCatalogProviderResponseAllOfProvidersInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The catalog provider ID. | [optional] +**provider_name** | **str** | The name of the catalog provider. | [optional] +**provider_type** | **str** | The type of catalog provider. | [optional] +**region** | **str** | The catalog provider region. | [optional] +**data_type** | **str** | The type of data produced by the provider. | [optional] +**asns_count** | **int** | The number of ASN's covered by the provider. | [optional] +**countries_count** | **int** | The number of countries covered by the provider. | [optional] +**locations_count** | **int** | The number of locations covered by the provider. | [optional] +**interfaces_count** | **int** | The number of interfaces covered by the provider. | [optional] +**included** | **bool** | Indicates whether the catalog provider is included in the licensed packages. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from internet_insights_api.models.api_catalog_provider_response_all_of_providers_inner import ApiCatalogProviderResponseAllOfProvidersInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiCatalogProviderResponseAllOfProvidersInner from a JSON string +api_catalog_provider_response_all_of_providers_inner_instance = ApiCatalogProviderResponseAllOfProvidersInner.from_json(json) +# print the JSON string representation of the object +print ApiCatalogProviderResponseAllOfProvidersInner.to_json() + +# convert the object into a dict +api_catalog_provider_response_all_of_providers_inner_dict = api_catalog_provider_response_all_of_providers_inner_instance.to_dict() +# create an instance of ApiCatalogProviderResponseAllOfProvidersInner from a dict +api_catalog_provider_response_all_of_providers_inner_form_dict = api_catalog_provider_response_all_of_providers_inner.from_dict(api_catalog_provider_response_all_of_providers_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiNetworkOutageAffectedLocation.md b/internet_insights_api/docs/ApiNetworkOutageAffectedLocation.md new file mode 100644 index 00000000..56c89898 --- /dev/null +++ b/internet_insights_api/docs/ApiNetworkOutageAffectedLocation.md @@ -0,0 +1,29 @@ +# ApiNetworkOutageAffectedLocation + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**location** | **str** | The affected location. | [optional] +**affected_interfaces** | **List[str]** | The affected interfaces in this location. | [optional] + +## Example + +```python +from internet_insights_api.models.api_network_outage_affected_location import ApiNetworkOutageAffectedLocation + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiNetworkOutageAffectedLocation from a JSON string +api_network_outage_affected_location_instance = ApiNetworkOutageAffectedLocation.from_json(json) +# print the JSON string representation of the object +print ApiNetworkOutageAffectedLocation.to_json() + +# convert the object into a dict +api_network_outage_affected_location_dict = api_network_outage_affected_location_instance.to_dict() +# create an instance of ApiNetworkOutageAffectedLocation from a dict +api_network_outage_affected_location_form_dict = api_network_outage_affected_location.from_dict(api_network_outage_affected_location_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiNetworkOutageDetails.md b/internet_insights_api/docs/ApiNetworkOutageDetails.md new file mode 100644 index 00000000..f668b173 --- /dev/null +++ b/internet_insights_api/docs/ApiNetworkOutageDetails.md @@ -0,0 +1,41 @@ +# ApiNetworkOutageDetails + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The ID of the outage. | [optional] +**provider_name** | **str** | The name of the affected provider. | [optional] +**provider_type** | **str** | The type of the affected provider. | [optional] +**network_name** | **str** | The affected network. | [optional] +**asn** | **int** | ASN number | [optional] +**start_date** | **str** | Date and time when the outage started. | [optional] +**start_round_id** | **int** | Epoch time (seconds) when the outage started. | [optional] +**end_date** | **str** | Date and time when the outage ended. | [optional] +**end_round_id** | **int** | Epoch time (seconds) when the outage ended. | [optional] +**duration** | **int** | Duration of the outage in seconds. | [optional] +**affected_tests** | [**List[ApiAffectedTest]**](ApiAffectedTest.md) | List of affected tests. | [optional] +**affected_domains** | **List[str]** | List of affected domains. | [optional] +**affected_agents** | [**List[ApiAffectedAgent]**](ApiAffectedAgent.md) | List of affected agents. | [optional] +**affected_locations** | [**List[ApiNetworkOutageAffectedLocation]**](ApiNetworkOutageAffectedLocation.md) | List of affected locations. | [optional] + +## Example + +```python +from internet_insights_api.models.api_network_outage_details import ApiNetworkOutageDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiNetworkOutageDetails from a JSON string +api_network_outage_details_instance = ApiNetworkOutageDetails.from_json(json) +# print the JSON string representation of the object +print ApiNetworkOutageDetails.to_json() + +# convert the object into a dict +api_network_outage_details_dict = api_network_outage_details_instance.to_dict() +# create an instance of ApiNetworkOutageDetails from a dict +api_network_outage_details_form_dict = api_network_outage_details.from_dict(api_network_outage_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) + + diff --git a/internet_insights_api/docs/ApiNetworkOutageResponse.md b/internet_insights_api/docs/ApiNetworkOutageResponse.md new file mode 100644 index 00000000..1604fe15 --- /dev/null +++ b/internet_insights_api/docs/ApiNetworkOutageResponse.md @@ -0,0 +1,42 @@ +# ApiNetworkOutageResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The ID of the outage. | [optional] +**provider_name** | **str** | The name of the affected provider. | [optional] +**provider_type** | **str** | The type of the affected provider. | [optional] +**network_name** | **str** | The affected network. | [optional] +**asn** | **int** | ASN number | [optional] +**start_date** | **str** | Date and time when the outage started. | [optional] +**start_round_id** | **int** | Epoch time (seconds) when the outage started. | [optional] +**end_date** | **str** | Date and time when the outage ended. | [optional] +**end_round_id** | **int** | Epoch time (seconds) when the outage ended. | [optional] +**duration** | **int** | Duration of the outage in seconds. | [optional] +**affected_tests** | [**List[ApiAffectedTest]**](ApiAffectedTest.md) | List of affected tests. | [optional] +**affected_domains** | **List[str]** | List of affected domains. | [optional] +**affected_agents** | [**List[ApiAffectedAgent]**](ApiAffectedAgent.md) | List of affected agents. | [optional] +**affected_locations** | [**List[ApiNetworkOutageAffectedLocation]**](ApiNetworkOutageAffectedLocation.md) | List of affected locations. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from internet_insights_api.models.api_network_outage_response import ApiNetworkOutageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiNetworkOutageResponse from a JSON string +api_network_outage_response_instance = ApiNetworkOutageResponse.from_json(json) +# print the JSON string representation of the object +print ApiNetworkOutageResponse.to_json() + +# convert the object into a dict +api_network_outage_response_dict = api_network_outage_response_instance.to_dict() +# create an instance of ApiNetworkOutageResponse from a dict +api_network_outage_response_form_dict = api_network_outage_response.from_dict(api_network_outage_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiOutage.md b/internet_insights_api/docs/ApiOutage.md new file mode 100644 index 00000000..32afff4f --- /dev/null +++ b/internet_insights_api/docs/ApiOutage.md @@ -0,0 +1,41 @@ +# ApiOutage + +List of outages. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The ID of the outage. | [optional] +**type** | **str** | The type of outage e.g. app. | [optional] +**provider_name** | **str** | The name of the affected provider. | [optional] +**provider_type** | **str** | The type of the affected provider. | [optional] +**name** | **str** | The name of the affected application. | [optional] +**start_date** | **str** | Date and time when the outage started. | [optional] +**start_round_id** | **int** | Epoch time (seconds) when the outage started. | [optional] +**end_date** | **str** | Date and time when the outage ended. | [optional] +**end_round_id** | **int** | Epoch time (seconds) when the outage ended. | [optional] +**duration** | **int** | Duration of the outage (seconds) | [optional] +**affected_tests_count** | **int** | The number of affected tests | [optional] +**affected_servers_count** | **int** | The number of affected servers | [optional] +**affected_locations_count** | **int** | The number of affected locations | [optional] + +## Example + +```python +from internet_insights_api.models.api_outage import ApiOutage + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiOutage from a JSON string +api_outage_instance = ApiOutage.from_json(json) +# print the JSON string representation of the object +print ApiOutage.to_json() + +# convert the object into a dict +api_outage_dict = api_outage_instance.to_dict() +# create an instance of ApiOutage from a dict +api_outage_form_dict = api_outage.from_dict(api_outage_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiOutageFilter.md b/internet_insights_api/docs/ApiOutageFilter.md new file mode 100644 index 00000000..6d21de22 --- /dev/null +++ b/internet_insights_api/docs/ApiOutageFilter.md @@ -0,0 +1,35 @@ +# ApiOutageFilter + +Advanced filter query used to filter the response. Can filter on: - outageScope (all, affected tests (e.g. my tests only)). - providerName - interfaceNetwork - applicationName - startDate, endDate - window + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **str** | Start of the time range. Must be paired with `endDate`. | [optional] +**end_date** | **str** | End of the time range. Must be paired with `startDate`. | [optional] +**window** | **str** | Specify a time period in the past for which to retrieve data. Alternative to specifying `startDate` and `endDate`. | [optional] +**outage_scope** | [**OutageScope**](OutageScope.md) | | [optional] +**provider_name** | **List[str]** | The name used to identify the provider. | [optional] +**application_name** | **List[str]** | The name to identify the application. | [optional] +**interface_network** | **List[str]** | The name of the ASN (Interface Network). | [optional] + +## Example + +```python +from internet_insights_api.models.api_outage_filter import ApiOutageFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiOutageFilter from a JSON string +api_outage_filter_instance = ApiOutageFilter.from_json(json) +# print the JSON string representation of the object +print ApiOutageFilter.to_json() + +# convert the object into a dict +api_outage_filter_dict = api_outage_filter_instance.to_dict() +# create an instance of ApiOutageFilter from a dict +api_outage_filter_form_dict = api_outage_filter.from_dict(api_outage_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiOutagesResponse.md b/internet_insights_api/docs/ApiOutagesResponse.md new file mode 100644 index 00000000..ae68b3e2 --- /dev/null +++ b/internet_insights_api/docs/ApiOutagesResponse.md @@ -0,0 +1,29 @@ +# ApiOutagesResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**outages** | [**List[ApiOutagesResponseAllOfOutagesInner]**](ApiOutagesResponseAllOfOutagesInner.md) | List of application outages. | [optional] + +## Example + +```python +from internet_insights_api.models.api_outages_response import ApiOutagesResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiOutagesResponse from a JSON string +api_outages_response_instance = ApiOutagesResponse.from_json(json) +# print the JSON string representation of the object +print ApiOutagesResponse.to_json() + +# convert the object into a dict +api_outages_response_dict = api_outages_response_instance.to_dict() +# create an instance of ApiOutagesResponse from a dict +api_outages_response_form_dict = api_outages_response.from_dict(api_outages_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/ApiOutagesResponseAllOfOutagesInner.md b/internet_insights_api/docs/ApiOutagesResponseAllOfOutagesInner.md new file mode 100644 index 00000000..30e27e20 --- /dev/null +++ b/internet_insights_api/docs/ApiOutagesResponseAllOfOutagesInner.md @@ -0,0 +1,41 @@ +# ApiOutagesResponseAllOfOutagesInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The ID of the outage. | [optional] +**type** | **str** | The type of outage e.g. app. | [optional] +**provider_name** | **str** | The name of the affected provider. | [optional] +**provider_type** | **str** | The type of the affected provider. | [optional] +**name** | **str** | The name of the affected application. | [optional] +**start_date** | **str** | Date and time when the outage started. | [optional] +**start_round_id** | **int** | Epoch time (seconds) when the outage started. | [optional] +**end_date** | **str** | Date and time when the outage ended. | [optional] +**end_round_id** | **int** | Epoch time (seconds) when the outage ended. | [optional] +**duration** | **int** | Duration of the outage (seconds) | [optional] +**affected_tests_count** | **int** | The number of affected tests | [optional] +**affected_servers_count** | **int** | The number of affected servers | [optional] +**affected_locations_count** | **int** | The number of affected locations | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from internet_insights_api.models.api_outages_response_all_of_outages_inner import ApiOutagesResponseAllOfOutagesInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiOutagesResponseAllOfOutagesInner from a JSON string +api_outages_response_all_of_outages_inner_instance = ApiOutagesResponseAllOfOutagesInner.from_json(json) +# print the JSON string representation of the object +print ApiOutagesResponseAllOfOutagesInner.to_json() + +# convert the object into a dict +api_outages_response_all_of_outages_inner_dict = api_outages_response_all_of_outages_inner_instance.to_dict() +# create an instance of ApiOutagesResponseAllOfOutagesInner from a dict +api_outages_response_all_of_outages_inner_form_dict = api_outages_response_all_of_outages_inner.from_dict(api_outages_response_all_of_outages_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/CatalogProvidersApi.md b/internet_insights_api/docs/CatalogProvidersApi.md new file mode 100644 index 00000000..233ec12e --- /dev/null +++ b/internet_insights_api/docs/CatalogProvidersApi.md @@ -0,0 +1,185 @@ +# internet_insights_api.CatalogProvidersApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**catalog_provider_list**](CatalogProvidersApi.md#catalog_provider_list) | **POST** /v7/internet-insights/catalog/providers/filter | List catalog providers +[**get_catalog_provider**](CatalogProvidersApi.md#get_catalog_provider) | **GET** /v7/internet-insights/catalog/providers/{providerId} | Retrieve a catalog provider + + +# **catalog_provider_list** +> ApiCatalogProviderResponse catalog_provider_list(api_catalog_provider_filter, aid=aid) + +List catalog providers + +Returns a list of catalog providers using the specified filters. Returns high-level information about each catalog provider. For more details about a specific provider, call the Get a catalog provider endpoint. Note: Support for pagination will be added in the future. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import internet_insights_api +from internet_insights_api.models.api_catalog_provider_filter import ApiCatalogProviderFilter +from internet_insights_api.models.api_catalog_provider_response import ApiCatalogProviderResponse +from internet_insights_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 = internet_insights_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 = internet_insights_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with internet_insights_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = internet_insights_api.CatalogProvidersApi(api_client) + api_catalog_provider_filter = internet_insights_api.ApiCatalogProviderFilter() # ApiCatalogProviderFilter | + 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 catalog providers + api_response = api_instance.catalog_provider_list(api_catalog_provider_filter, aid=aid) + print("The response of CatalogProvidersApi->catalog_provider_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CatalogProvidersApi->catalog_provider_list: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **api_catalog_provider_filter** | [**ApiCatalogProviderFilter**](ApiCatalogProviderFilter.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiCatalogProviderResponse**](ApiCatalogProviderResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + +# **get_catalog_provider** +> ApiCatalogProviderDetailsResponse get_catalog_provider(provider_id, aid=aid) + +Retrieve a catalog provider + +Returns the details of a catalog provider. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import internet_insights_api +from internet_insights_api.models.api_catalog_provider_details_response import ApiCatalogProviderDetailsResponse +from internet_insights_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 = internet_insights_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 = internet_insights_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with internet_insights_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = internet_insights_api.CatalogProvidersApi(api_client) + provider_id = '85602a0a-54a7-4e97-946e-67492ef1fa26' # str | + 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 a catalog provider + api_response = api_instance.get_catalog_provider(provider_id, aid=aid) + print("The response of CatalogProvidersApi->get_catalog_provider:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CatalogProvidersApi->get_catalog_provider: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiCatalogProviderDetailsResponse**](ApiCatalogProviderDetailsResponse.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/internet_insights_api/docs/Error.md b/internet_insights_api/docs/Error.md new file mode 100644 index 00000000..5e08f59c --- /dev/null +++ b/internet_insights_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from internet_insights_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/Link.md b/internet_insights_api/docs/Link.md new file mode 100644 index 00000000..01597e66 --- /dev/null +++ b/internet_insights_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from internet_insights_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/OutageScope.md b/internet_insights_api/docs/OutageScope.md new file mode 100644 index 00000000..c399afc0 --- /dev/null +++ b/internet_insights_api/docs/OutageScope.md @@ -0,0 +1,11 @@ +# OutageScope + +Scope of the outage + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/OutagesAPIPublicApi.md b/internet_insights_api/docs/OutagesAPIPublicApi.md new file mode 100644 index 00000000..0bfb4c6e --- /dev/null +++ b/internet_insights_api/docs/OutagesAPIPublicApi.md @@ -0,0 +1,273 @@ +# internet_insights_api.OutagesAPIPublicApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_outages_app**](OutagesAPIPublicApi.md#get_outages_app) | **GET** /v7/internet-insights/outages/app/{outageId} | Retrieve application outage +[**get_outages_filter**](OutagesAPIPublicApi.md#get_outages_filter) | **POST** /v7/internet-insights/outages/filter | List network and application outages +[**get_outages_net**](OutagesAPIPublicApi.md#get_outages_net) | **GET** /v7/internet-insights/outages/net/{outageId} | Retrieve network outage + + +# **get_outages_app** +> ApiApplicationOutageResponse get_outages_app(outage_id, aid=aid) + +Retrieve application outage + +Returns the details of an application outage. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import internet_insights_api +from internet_insights_api.models.api_application_outage_response import ApiApplicationOutageResponse +from internet_insights_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 = internet_insights_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 = internet_insights_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with internet_insights_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = internet_insights_api.OutagesAPIPublicApi(api_client) + outage_id = 'F73E24F17E4996923196826A208BB572508A8EB13BEE14B0' # str | + 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 application outage + api_response = api_instance.get_outages_app(outage_id, aid=aid) + print("The response of OutagesAPIPublicApi->get_outages_app:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OutagesAPIPublicApi->get_outages_app: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outage_id** | **str**| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiApplicationOutageResponse**](ApiApplicationOutageResponse.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 | - | +**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) + +# **get_outages_filter** +> ApiOutagesResponse get_outages_filter(api_outage_filter, aid=aid) + +List network and application outages + +Returns a list of network and application outages using a filter object. Advanced Filter persistance is not currently supported. Note: Support for pagination will be added in the future. ## Samples Queries with Different Filter Permutations ### Window ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token --header 'Accept-Encoding: application/gzip' --header 'Content-Type: application/json' --data-raw '{ \"window\" : \"1d\" }' ``` ### Date Range ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\" }' ``` ### Date Range with Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"with-affected-test\" }' ``` ### Date Range with Network ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"interfaceNetwork\": [\"Telianet\"] }' ``` ### Date Range with Application ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"applicationName\": [\"Google\"] }' ``` ### Date Range with Provider ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"providerName\": [\"Century Link\", \"Microsoft\"] }' ``` ### Date Range with Application and Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"all\", \"applicationName\": [\"Google\"] }' ``` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import internet_insights_api +from internet_insights_api.models.api_outage_filter import ApiOutageFilter +from internet_insights_api.models.api_outages_response import ApiOutagesResponse +from internet_insights_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 = internet_insights_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 = internet_insights_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with internet_insights_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = internet_insights_api.OutagesAPIPublicApi(api_client) + api_outage_filter = internet_insights_api.ApiOutageFilter() # ApiOutageFilter | + 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 network and application outages + api_response = api_instance.get_outages_filter(api_outage_filter, aid=aid) + print("The response of OutagesAPIPublicApi->get_outages_filter:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OutagesAPIPublicApi->get_outages_filter: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **api_outage_filter** | [**ApiOutageFilter**](ApiOutageFilter.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiOutagesResponse**](ApiOutagesResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + +# **get_outages_net** +> ApiNetworkOutageResponse get_outages_net(outage_id, aid=aid) + +Retrieve network outage + +Returns the details of a network outage. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import internet_insights_api +from internet_insights_api.models.api_network_outage_response import ApiNetworkOutageResponse +from internet_insights_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 = internet_insights_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 = internet_insights_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with internet_insights_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = internet_insights_api.OutagesAPIPublicApi(api_client) + outage_id = '694D8656960F34F76489BCE5E9BCD58EC53027462740D75F' # str | + 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 network outage + api_response = api_instance.get_outages_net(outage_id, aid=aid) + print("The response of OutagesAPIPublicApi->get_outages_net:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OutagesAPIPublicApi->get_outages_net: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outage_id** | **str**| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiNetworkOutageResponse**](ApiNetworkOutageResponse.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/internet_insights_api/docs/SelfLinks.md b/internet_insights_api/docs/SelfLinks.md new file mode 100644 index 00000000..0852ec83 --- /dev/null +++ b/internet_insights_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from internet_insights_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/SelfLinksLinks.md b/internet_insights_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..49548039 --- /dev/null +++ b/internet_insights_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from internet_insights_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/docs/UnauthorizedError.md b/internet_insights_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..65e8400b --- /dev/null +++ b/internet_insights_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from internet_insights_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internet_insights_api/git_push.sh b/internet_insights_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/internet_insights_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/internet_insights_api/internet_insights_api/__init__.py b/internet_insights_api/internet_insights_api/__init__.py new file mode 100644 index 00000000..8dcb9dba --- /dev/null +++ b/internet_insights_api/internet_insights_api/__init__.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_api.api.catalog_providers_api import CatalogProvidersApi +from internet_insights_api.api.outages_api_public_api import OutagesAPIPublicApi + +# import ApiClient +from internet_insights_api.api_response import ApiResponse +from internet_insights_api.api_client import ApiClient +from internet_insights_api.configuration import Configuration +from internet_insights_api.exceptions import OpenApiException +from internet_insights_api.exceptions import ApiTypeError +from internet_insights_api.exceptions import ApiValueError +from internet_insights_api.exceptions import ApiKeyError +from internet_insights_api.exceptions import ApiAttributeError +from internet_insights_api.exceptions import ApiException + +# import models into sdk package +from internet_insights_api.models.api_affected_agent import ApiAffectedAgent +from internet_insights_api.models.api_affected_test import ApiAffectedTest +from internet_insights_api.models.api_application_outage_affected_location import ApiApplicationOutageAffectedLocation +from internet_insights_api.models.api_application_outage_affected_server import ApiApplicationOutageAffectedServer +from internet_insights_api.models.api_application_outage_details import ApiApplicationOutageDetails +from internet_insights_api.models.api_application_outage_response import ApiApplicationOutageResponse +from internet_insights_api.models.api_asn import ApiAsn +from internet_insights_api.models.api_catalog_provider import ApiCatalogProvider +from internet_insights_api.models.api_catalog_provider_details import ApiCatalogProviderDetails +from internet_insights_api.models.api_catalog_provider_details_locations_inner import ApiCatalogProviderDetailsLocationsInner +from internet_insights_api.models.api_catalog_provider_details_response import ApiCatalogProviderDetailsResponse +from internet_insights_api.models.api_catalog_provider_filter import ApiCatalogProviderFilter +from internet_insights_api.models.api_catalog_provider_response import ApiCatalogProviderResponse +from internet_insights_api.models.api_catalog_provider_response_all_of_providers_inner import ApiCatalogProviderResponseAllOfProvidersInner +from internet_insights_api.models.api_network_outage_affected_location import ApiNetworkOutageAffectedLocation +from internet_insights_api.models.api_network_outage_details import ApiNetworkOutageDetails +from internet_insights_api.models.api_network_outage_response import ApiNetworkOutageResponse +from internet_insights_api.models.api_outage import ApiOutage +from internet_insights_api.models.api_outage_filter import ApiOutageFilter +from internet_insights_api.models.api_outages_response import ApiOutagesResponse +from internet_insights_api.models.api_outages_response_all_of_outages_inner import ApiOutagesResponseAllOfOutagesInner +from internet_insights_api.models.error import Error +from internet_insights_api.models.link import Link +from internet_insights_api.models.outage_scope import OutageScope +from internet_insights_api.models.self_links import SelfLinks +from internet_insights_api.models.self_links_links import SelfLinksLinks +from internet_insights_api.models.unauthorized_error import UnauthorizedError diff --git a/internet_insights_api/internet_insights_api/api/__init__.py b/internet_insights_api/internet_insights_api/api/__init__.py new file mode 100644 index 00000000..3c471366 --- /dev/null +++ b/internet_insights_api/internet_insights_api/api/__init__.py @@ -0,0 +1,6 @@ +# flake8: noqa + +# import apis into api package +from internet_insights_api.api.catalog_providers_api import CatalogProvidersApi +from internet_insights_api.api.outages_api_public_api import OutagesAPIPublicApi + diff --git a/internet_insights_api/internet_insights_api/api/catalog_providers_api.py b/internet_insights_api/internet_insights_api/api/catalog_providers_api.py new file mode 100644 index 00000000..9cf05300 --- /dev/null +++ b/internet_insights_api/internet_insights_api/api/catalog_providers_api.py @@ -0,0 +1,672 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_api.models.api_catalog_provider_details_response import ApiCatalogProviderDetailsResponse +from internet_insights_api.models.api_catalog_provider_filter import ApiCatalogProviderFilter +from internet_insights_api.models.api_catalog_provider_response import ApiCatalogProviderResponse + +from internet_insights_api.api_client import ApiClient +from internet_insights_api.api_response import ApiResponse +from internet_insights_api.rest import RESTResponseType + + +class CatalogProvidersApi: + """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 catalog_provider_list( + self, + api_catalog_provider_filter: ApiCatalogProviderFilter, + 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, + ) -> ApiCatalogProviderResponse: + """List catalog providers + + Returns a list of catalog providers using the specified filters. Returns high-level information about each catalog provider. For more details about a specific provider, call the Get a catalog provider endpoint. Note: Support for pagination will be added in the future. + + :param api_catalog_provider_filter: (required) + :type api_catalog_provider_filter: ApiCatalogProviderFilter + :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._catalog_provider_list_serialize( + api_catalog_provider_filter=api_catalog_provider_filter, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiCatalogProviderResponse", + '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 catalog_provider_list_with_http_info( + self, + api_catalog_provider_filter: ApiCatalogProviderFilter, + 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[ApiCatalogProviderResponse]: + """List catalog providers + + Returns a list of catalog providers using the specified filters. Returns high-level information about each catalog provider. For more details about a specific provider, call the Get a catalog provider endpoint. Note: Support for pagination will be added in the future. + + :param api_catalog_provider_filter: (required) + :type api_catalog_provider_filter: ApiCatalogProviderFilter + :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._catalog_provider_list_serialize( + api_catalog_provider_filter=api_catalog_provider_filter, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiCatalogProviderResponse", + '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 catalog_provider_list_without_preload_content( + self, + api_catalog_provider_filter: ApiCatalogProviderFilter, + 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 catalog providers + + Returns a list of catalog providers using the specified filters. Returns high-level information about each catalog provider. For more details about a specific provider, call the Get a catalog provider endpoint. Note: Support for pagination will be added in the future. + + :param api_catalog_provider_filter: (required) + :type api_catalog_provider_filter: ApiCatalogProviderFilter + :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._catalog_provider_list_serialize( + api_catalog_provider_filter=api_catalog_provider_filter, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiCatalogProviderResponse", + '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 _catalog_provider_list_serialize( + self, + api_catalog_provider_filter, + 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 + if api_catalog_provider_filter is not None: + _body_params = api_catalog_provider_filter + + + # 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/internet-insights/catalog/providers/filter', + 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_catalog_provider( + self, + provider_id: StrictStr, + 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, + ) -> ApiCatalogProviderDetailsResponse: + """Retrieve a catalog provider + + Returns the details of a catalog provider. + + :param provider_id: (required) + :type provider_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_catalog_provider_serialize( + provider_id=provider_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': "ApiCatalogProviderDetailsResponse", + '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 get_catalog_provider_with_http_info( + self, + provider_id: StrictStr, + 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[ApiCatalogProviderDetailsResponse]: + """Retrieve a catalog provider + + Returns the details of a catalog provider. + + :param provider_id: (required) + :type provider_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_catalog_provider_serialize( + provider_id=provider_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': "ApiCatalogProviderDetailsResponse", + '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 get_catalog_provider_without_preload_content( + self, + provider_id: StrictStr, + 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 a catalog provider + + Returns the details of a catalog provider. + + :param provider_id: (required) + :type provider_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_catalog_provider_serialize( + provider_id=provider_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': "ApiCatalogProviderDetailsResponse", + '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 _get_catalog_provider_serialize( + self, + provider_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 provider_id is not None: + _path_params['providerId'] = provider_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/internet-insights/catalog/providers/{providerId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/internet_insights_api/internet_insights_api/api/outages_api_public_api.py b/internet_insights_api/internet_insights_api/api/outages_api_public_api.py new file mode 100644 index 00000000..2f2b8520 --- /dev/null +++ b/internet_insights_api/internet_insights_api/api/outages_api_public_api.py @@ -0,0 +1,977 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_api.models.api_application_outage_response import ApiApplicationOutageResponse +from internet_insights_api.models.api_network_outage_response import ApiNetworkOutageResponse +from internet_insights_api.models.api_outage_filter import ApiOutageFilter +from internet_insights_api.models.api_outages_response import ApiOutagesResponse + +from internet_insights_api.api_client import ApiClient +from internet_insights_api.api_response import ApiResponse +from internet_insights_api.rest import RESTResponseType + + +class OutagesAPIPublicApi: + """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_outages_app( + self, + outage_id: StrictStr, + 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, + ) -> ApiApplicationOutageResponse: + """Retrieve application outage + + Returns the details of an application outage. + + :param outage_id: (required) + :type outage_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_outages_app_serialize( + outage_id=outage_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': "ApiApplicationOutageResponse", + '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 get_outages_app_with_http_info( + self, + outage_id: StrictStr, + 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[ApiApplicationOutageResponse]: + """Retrieve application outage + + Returns the details of an application outage. + + :param outage_id: (required) + :type outage_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_outages_app_serialize( + outage_id=outage_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': "ApiApplicationOutageResponse", + '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 get_outages_app_without_preload_content( + self, + outage_id: StrictStr, + 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 application outage + + Returns the details of an application outage. + + :param outage_id: (required) + :type outage_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_outages_app_serialize( + outage_id=outage_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': "ApiApplicationOutageResponse", + '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 _get_outages_app_serialize( + self, + outage_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 outage_id is not None: + _path_params['outageId'] = outage_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/internet-insights/outages/app/{outageId}', + 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_outages_filter( + self, + api_outage_filter: ApiOutageFilter, + 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, + ) -> ApiOutagesResponse: + """List network and application outages + + Returns a list of network and application outages using a filter object. Advanced Filter persistance is not currently supported. Note: Support for pagination will be added in the future. ## Samples Queries with Different Filter Permutations ### Window ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token --header 'Accept-Encoding: application/gzip' --header 'Content-Type: application/json' --data-raw '{ \"window\" : \"1d\" }' ``` ### Date Range ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\" }' ``` ### Date Range with Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"with-affected-test\" }' ``` ### Date Range with Network ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"interfaceNetwork\": [\"Telianet\"] }' ``` ### Date Range with Application ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"applicationName\": [\"Google\"] }' ``` ### Date Range with Provider ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"providerName\": [\"Century Link\", \"Microsoft\"] }' ``` ### Date Range with Application and Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"all\", \"applicationName\": [\"Google\"] }' ``` + + :param api_outage_filter: (required) + :type api_outage_filter: ApiOutageFilter + :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_outages_filter_serialize( + api_outage_filter=api_outage_filter, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiOutagesResponse", + '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 get_outages_filter_with_http_info( + self, + api_outage_filter: ApiOutageFilter, + 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[ApiOutagesResponse]: + """List network and application outages + + Returns a list of network and application outages using a filter object. Advanced Filter persistance is not currently supported. Note: Support for pagination will be added in the future. ## Samples Queries with Different Filter Permutations ### Window ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token --header 'Accept-Encoding: application/gzip' --header 'Content-Type: application/json' --data-raw '{ \"window\" : \"1d\" }' ``` ### Date Range ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\" }' ``` ### Date Range with Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"with-affected-test\" }' ``` ### Date Range with Network ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"interfaceNetwork\": [\"Telianet\"] }' ``` ### Date Range with Application ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"applicationName\": [\"Google\"] }' ``` ### Date Range with Provider ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"providerName\": [\"Century Link\", \"Microsoft\"] }' ``` ### Date Range with Application and Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"all\", \"applicationName\": [\"Google\"] }' ``` + + :param api_outage_filter: (required) + :type api_outage_filter: ApiOutageFilter + :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_outages_filter_serialize( + api_outage_filter=api_outage_filter, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiOutagesResponse", + '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 get_outages_filter_without_preload_content( + self, + api_outage_filter: ApiOutageFilter, + 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 network and application outages + + Returns a list of network and application outages using a filter object. Advanced Filter persistance is not currently supported. Note: Support for pagination will be added in the future. ## Samples Queries with Different Filter Permutations ### Window ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token --header 'Accept-Encoding: application/gzip' --header 'Content-Type: application/json' --data-raw '{ \"window\" : \"1d\" }' ``` ### Date Range ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\" }' ``` ### Date Range with Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"with-affected-test\" }' ``` ### Date Range with Network ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"interfaceNetwork\": [\"Telianet\"] }' ``` ### Date Range with Application ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"applicationName\": [\"Google\"] }' ``` ### Date Range with Provider ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"providerName\": [\"Century Link\", \"Microsoft\"] }' ``` ### Date Range with Application and Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"all\", \"applicationName\": [\"Google\"] }' ``` + + :param api_outage_filter: (required) + :type api_outage_filter: ApiOutageFilter + :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_outages_filter_serialize( + api_outage_filter=api_outage_filter, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiOutagesResponse", + '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 _get_outages_filter_serialize( + self, + api_outage_filter, + 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 + if api_outage_filter is not None: + _body_params = api_outage_filter + + + # 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/internet-insights/outages/filter', + 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_outages_net( + self, + outage_id: StrictStr, + 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, + ) -> ApiNetworkOutageResponse: + """Retrieve network outage + + Returns the details of a network outage. + + :param outage_id: (required) + :type outage_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_outages_net_serialize( + outage_id=outage_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': "ApiNetworkOutageResponse", + '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 get_outages_net_with_http_info( + self, + outage_id: StrictStr, + 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[ApiNetworkOutageResponse]: + """Retrieve network outage + + Returns the details of a network outage. + + :param outage_id: (required) + :type outage_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_outages_net_serialize( + outage_id=outage_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': "ApiNetworkOutageResponse", + '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 get_outages_net_without_preload_content( + self, + outage_id: StrictStr, + 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 network outage + + Returns the details of a network outage. + + :param outage_id: (required) + :type outage_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_outages_net_serialize( + outage_id=outage_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': "ApiNetworkOutageResponse", + '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 _get_outages_net_serialize( + self, + outage_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 outage_id is not None: + _path_params['outageId'] = outage_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/internet-insights/outages/net/{outageId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/internet_insights_api/internet_insights_api/api_client.py b/internet_insights_api/internet_insights_api/api_client.py new file mode 100644 index 00000000..cf7eda4d --- /dev/null +++ b/internet_insights_api/internet_insights_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_api.configuration import Configuration +from internet_insights_api.api_response import ApiResponse +import internet_insights_api.models +from internet_insights_api import rest +from internet_insights_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(internet_insights_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) diff --git a/internet_insights_api/internet_insights_api/api_response.py b/internet_insights_api/internet_insights_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/internet_insights_api/internet_insights_api/api_response.py @@ -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 + } diff --git a/internet_insights_api/internet_insights_api/configuration.py b/internet_insights_api/internet_insights_api/configuration.py new file mode 100644 index 00000000..b9b43946 --- /dev/null +++ b/internet_insights_api/internet_insights_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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("internet_insights_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 diff --git a/internet_insights_api/internet_insights_api/exceptions.py b/internet_insights_api/internet_insights_api/exceptions.py new file mode 100644 index 00000000..0de39c3d --- /dev/null +++ b/internet_insights_api/internet_insights_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 diff --git a/internet_insights_api/internet_insights_api/models/__init__.py b/internet_insights_api/internet_insights_api/models/__init__.py new file mode 100644 index 00000000..5f0f4591 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/__init__.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +# flake8: noqa +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_api.models.api_affected_agent import ApiAffectedAgent +from internet_insights_api.models.api_affected_test import ApiAffectedTest +from internet_insights_api.models.api_application_outage_affected_location import ApiApplicationOutageAffectedLocation +from internet_insights_api.models.api_application_outage_affected_server import ApiApplicationOutageAffectedServer +from internet_insights_api.models.api_application_outage_details import ApiApplicationOutageDetails +from internet_insights_api.models.api_application_outage_response import ApiApplicationOutageResponse +from internet_insights_api.models.api_asn import ApiAsn +from internet_insights_api.models.api_catalog_provider import ApiCatalogProvider +from internet_insights_api.models.api_catalog_provider_details import ApiCatalogProviderDetails +from internet_insights_api.models.api_catalog_provider_details_locations_inner import ApiCatalogProviderDetailsLocationsInner +from internet_insights_api.models.api_catalog_provider_details_response import ApiCatalogProviderDetailsResponse +from internet_insights_api.models.api_catalog_provider_filter import ApiCatalogProviderFilter +from internet_insights_api.models.api_catalog_provider_response import ApiCatalogProviderResponse +from internet_insights_api.models.api_catalog_provider_response_all_of_providers_inner import ApiCatalogProviderResponseAllOfProvidersInner +from internet_insights_api.models.api_network_outage_affected_location import ApiNetworkOutageAffectedLocation +from internet_insights_api.models.api_network_outage_details import ApiNetworkOutageDetails +from internet_insights_api.models.api_network_outage_response import ApiNetworkOutageResponse +from internet_insights_api.models.api_outage import ApiOutage +from internet_insights_api.models.api_outage_filter import ApiOutageFilter +from internet_insights_api.models.api_outages_response import ApiOutagesResponse +from internet_insights_api.models.api_outages_response_all_of_outages_inner import ApiOutagesResponseAllOfOutagesInner +from internet_insights_api.models.error import Error +from internet_insights_api.models.link import Link +from internet_insights_api.models.outage_scope import OutageScope +from internet_insights_api.models.self_links import SelfLinks +from internet_insights_api.models.self_links_links import SelfLinksLinks +from internet_insights_api.models.unauthorized_error import UnauthorizedError diff --git a/internet_insights_api/internet_insights_api/models/api_affected_agent.py b/internet_insights_api/internet_insights_api/models/api_affected_agent.py new file mode 100644 index 00000000..1d0d0040 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_affected_agent.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiAffectedAgent(BaseModel): + """ + ApiAffectedAgent + """ # noqa: E501 + id: Optional[StrictInt] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "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 ApiAffectedAgent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _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 ApiAffectedAgent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name") + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_affected_test.py b/internet_insights_api/internet_insights_api/models/api_affected_test.py new file mode 100644 index 00000000..27db2cf5 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_affected_test.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiAffectedTest(BaseModel): + """ + ApiAffectedTest + """ # noqa: E501 + id: Optional[StrictInt] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "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 ApiAffectedTest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _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 ApiAffectedTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name") + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_application_outage_affected_location.py b/internet_insights_api/internet_insights_api/models/api_application_outage_affected_location.py new file mode 100644 index 00000000..7b9e398b --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_application_outage_affected_location.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_api.models.api_application_outage_affected_server import ApiApplicationOutageAffectedServer +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiApplicationOutageAffectedLocation(BaseModel): + """ + ApiApplicationOutageAffectedLocation + """ # noqa: E501 + location: Optional[StrictStr] = Field(default=None, description="The affected location.") + affected_servers: Optional[List[ApiApplicationOutageAffectedServer]] = Field(default=None, description="The number of affected servers in this location.", alias="affectedServers") + __properties: ClassVar[List[str]] = ["location", "affectedServers"] + + 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 ApiApplicationOutageAffectedLocation 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 affected_servers (list) + _items = [] + if self.affected_servers: + for _item in self.affected_servers: + if _item: + _items.append(_item.to_dict()) + _dict['affectedServers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiApplicationOutageAffectedLocation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "location": obj.get("location"), + "affectedServers": [ApiApplicationOutageAffectedServer.from_dict(_item) for _item in obj.get("affectedServers")] if obj.get("affectedServers") is not None else None + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_application_outage_affected_server.py b/internet_insights_api/internet_insights_api/models/api_application_outage_affected_server.py new file mode 100644 index 00000000..131fa7ec --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_application_outage_affected_server.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 ApiApplicationOutageAffectedServer(BaseModel): + """ + ApiApplicationOutageAffectedServer + """ # noqa: E501 + domain: Optional[StrictStr] = None + prefix: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["domain", "prefix"] + + 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 ApiApplicationOutageAffectedServer 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 ApiApplicationOutageAffectedServer from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "domain": obj.get("domain"), + "prefix": obj.get("prefix") + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_application_outage_details.py b/internet_insights_api/internet_insights_api/models/api_application_outage_details.py new file mode 100644 index 00000000..c19c4c15 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_application_outage_details.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 +from internet_insights_api.models.api_affected_agent import ApiAffectedAgent +from internet_insights_api.models.api_affected_test import ApiAffectedTest +from internet_insights_api.models.api_application_outage_affected_location import ApiApplicationOutageAffectedLocation +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiApplicationOutageDetails(BaseModel): + """ + ApiApplicationOutageDetails + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The ID of the outage.") + provider_name: Optional[StrictStr] = Field(default=None, description="The name of the affected provider.", alias="providerName") + provider_type: Optional[StrictStr] = Field(default=None, description="The type of the affected provider.", alias="providerType") + application_name: Optional[StrictStr] = Field(default=None, description="The name of the affected application.", alias="applicationName") + start_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage started.", alias="startDate") + start_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage started.", alias="startRoundId") + end_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage ended.", alias="endDate") + end_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage ended.", alias="endRoundId") + duration: Optional[StrictInt] = Field(default=None, description="Duration of the outage in seconds.") + affected_tests: Optional[List[ApiAffectedTest]] = Field(default=None, description="List of affected tests.", alias="affectedTests") + affected_domains: Optional[List[StrictStr]] = Field(default=None, description="List of affected domains.", alias="affectedDomains") + affected_agents: Optional[List[ApiAffectedAgent]] = Field(default=None, description="List of affected agents.", alias="affectedAgents") + errors: Optional[List[StrictStr]] = Field(default=None, description="List of errors.") + affected_locations: Optional[List[ApiApplicationOutageAffectedLocation]] = Field(default=None, description="List of affected locations.", alias="affectedLocations") + __properties: ClassVar[List[str]] = ["id", "providerName", "providerType", "applicationName", "startDate", "startRoundId", "endDate", "endRoundId", "duration", "affectedTests", "affectedDomains", "affectedAgents", "errors", "affectedLocations"] + + 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 ApiApplicationOutageDetails 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 affected_tests (list) + _items = [] + if self.affected_tests: + for _item in self.affected_tests: + if _item: + _items.append(_item.to_dict()) + _dict['affectedTests'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in affected_agents (list) + _items = [] + if self.affected_agents: + for _item in self.affected_agents: + if _item: + _items.append(_item.to_dict()) + _dict['affectedAgents'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in affected_locations (list) + _items = [] + if self.affected_locations: + for _item in self.affected_locations: + if _item: + _items.append(_item.to_dict()) + _dict['affectedLocations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiApplicationOutageDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "providerName": obj.get("providerName"), + "providerType": obj.get("providerType"), + "applicationName": obj.get("applicationName"), + "startDate": obj.get("startDate"), + "startRoundId": obj.get("startRoundId"), + "endDate": obj.get("endDate"), + "endRoundId": obj.get("endRoundId"), + "duration": obj.get("duration"), + "affectedTests": [ApiAffectedTest.from_dict(_item) for _item in obj.get("affectedTests")] if obj.get("affectedTests") is not None else None, + "affectedDomains": obj.get("affectedDomains"), + "affectedAgents": [ApiAffectedAgent.from_dict(_item) for _item in obj.get("affectedAgents")] if obj.get("affectedAgents") is not None else None, + "errors": obj.get("errors"), + "affectedLocations": [ApiApplicationOutageAffectedLocation.from_dict(_item) for _item in obj.get("affectedLocations")] if obj.get("affectedLocations") is not None else None + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_application_outage_response.py b/internet_insights_api/internet_insights_api/models/api_application_outage_response.py new file mode 100644 index 00000000..e7ff7743 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_application_outage_response.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 +from internet_insights_api.models.api_affected_agent import ApiAffectedAgent +from internet_insights_api.models.api_affected_test import ApiAffectedTest +from internet_insights_api.models.api_application_outage_affected_location import ApiApplicationOutageAffectedLocation +from internet_insights_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiApplicationOutageResponse(BaseModel): + """ + ApiApplicationOutageResponse + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The ID of the outage.") + provider_name: Optional[StrictStr] = Field(default=None, description="The name of the affected provider.", alias="providerName") + provider_type: Optional[StrictStr] = Field(default=None, description="The type of the affected provider.", alias="providerType") + application_name: Optional[StrictStr] = Field(default=None, description="The name of the affected application.", alias="applicationName") + start_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage started.", alias="startDate") + start_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage started.", alias="startRoundId") + end_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage ended.", alias="endDate") + end_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage ended.", alias="endRoundId") + duration: Optional[StrictInt] = Field(default=None, description="Duration of the outage in seconds.") + affected_tests: Optional[List[ApiAffectedTest]] = Field(default=None, description="List of affected tests.", alias="affectedTests") + affected_domains: Optional[List[StrictStr]] = Field(default=None, description="List of affected domains.", alias="affectedDomains") + affected_agents: Optional[List[ApiAffectedAgent]] = Field(default=None, description="List of affected agents.", alias="affectedAgents") + errors: Optional[List[StrictStr]] = Field(default=None, description="List of errors.") + affected_locations: Optional[List[ApiApplicationOutageAffectedLocation]] = Field(default=None, description="List of affected locations.", alias="affectedLocations") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["id", "providerName", "providerType", "applicationName", "startDate", "startRoundId", "endDate", "endRoundId", "duration", "affectedTests", "affectedDomains", "affectedAgents", "errors", "affectedLocations", "_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 ApiApplicationOutageResponse 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 affected_tests (list) + _items = [] + if self.affected_tests: + for _item in self.affected_tests: + if _item: + _items.append(_item.to_dict()) + _dict['affectedTests'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in affected_agents (list) + _items = [] + if self.affected_agents: + for _item in self.affected_agents: + if _item: + _items.append(_item.to_dict()) + _dict['affectedAgents'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in affected_locations (list) + _items = [] + if self.affected_locations: + for _item in self.affected_locations: + if _item: + _items.append(_item.to_dict()) + _dict['affectedLocations'] = _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 ApiApplicationOutageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "providerName": obj.get("providerName"), + "providerType": obj.get("providerType"), + "applicationName": obj.get("applicationName"), + "startDate": obj.get("startDate"), + "startRoundId": obj.get("startRoundId"), + "endDate": obj.get("endDate"), + "endRoundId": obj.get("endRoundId"), + "duration": obj.get("duration"), + "affectedTests": [ApiAffectedTest.from_dict(_item) for _item in obj.get("affectedTests")] if obj.get("affectedTests") is not None else None, + "affectedDomains": obj.get("affectedDomains"), + "affectedAgents": [ApiAffectedAgent.from_dict(_item) for _item in obj.get("affectedAgents")] if obj.get("affectedAgents") is not None else None, + "errors": obj.get("errors"), + "affectedLocations": [ApiApplicationOutageAffectedLocation.from_dict(_item) for _item in obj.get("affectedLocations")] if obj.get("affectedLocations") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_asn.py b/internet_insights_api/internet_insights_api/models/api_asn.py new file mode 100644 index 00000000..5de8ec6d --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_asn.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 ApiAsn(BaseModel): + """ + ApiAsn + """ # noqa: E501 + id: Optional[StrictInt] = Field(default=None, description="ASN (Autonomous Systems Number)") + name: Optional[StrictStr] = Field(default=None, description="ASN (Autonomous Systems Number) name") + __properties: ClassVar[List[str]] = ["id", "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 ApiAsn 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 ApiAsn from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name") + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_catalog_provider.py b/internet_insights_api/internet_insights_api/models/api_catalog_provider.py new file mode 100644 index 00000000..6d3e76f2 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_catalog_provider.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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, StrictInt, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiCatalogProvider(BaseModel): + """ + Catalog provider + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The catalog provider ID.") + provider_name: Optional[StrictStr] = Field(default=None, description="The name of the catalog provider.", alias="providerName") + provider_type: Optional[StrictStr] = Field(default=None, description="The type of catalog provider.", alias="providerType") + region: Optional[StrictStr] = Field(default=None, description="The catalog provider region.") + data_type: Optional[StrictStr] = Field(default=None, description="The type of data produced by the provider.", alias="dataType") + asns_count: Optional[StrictInt] = Field(default=None, description="The number of ASN's covered by the provider.", alias="asnsCount") + countries_count: Optional[StrictInt] = Field(default=None, description="The number of countries covered by the provider.", alias="countriesCount") + locations_count: Optional[StrictInt] = Field(default=None, description="The number of locations covered by the provider.", alias="locationsCount") + interfaces_count: Optional[StrictInt] = Field(default=None, description="The number of interfaces covered by the provider.", alias="interfacesCount") + included: Optional[StrictBool] = Field(default=None, description="Indicates whether the catalog provider is included in the licensed packages.") + __properties: ClassVar[List[str]] = ["id", "providerName", "providerType", "region", "dataType", "asnsCount", "countriesCount", "locationsCount", "interfacesCount", "included"] + + 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 ApiCatalogProvider 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 ApiCatalogProvider from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "providerName": obj.get("providerName"), + "providerType": obj.get("providerType"), + "region": obj.get("region"), + "dataType": obj.get("dataType"), + "asnsCount": obj.get("asnsCount"), + "countriesCount": obj.get("countriesCount"), + "locationsCount": obj.get("locationsCount"), + "interfacesCount": obj.get("interfacesCount"), + "included": obj.get("included") + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_catalog_provider_details.py b/internet_insights_api/internet_insights_api/models/api_catalog_provider_details.py new file mode 100644 index 00000000..6153e47e --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_catalog_provider_details.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_api.models.api_asn import ApiAsn +from internet_insights_api.models.api_catalog_provider_details_locations_inner import ApiCatalogProviderDetailsLocationsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiCatalogProviderDetails(BaseModel): + """ + ApiCatalogProviderDetails + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The catalog provider ID.") + provider_name: Optional[StrictStr] = Field(default=None, description="The name of the catalog provider.", alias="providerName") + provider_type: Optional[StrictStr] = Field(default=None, description="The type of catalog provider.", alias="providerType") + region: Optional[StrictStr] = Field(default=None, description="The catalog provider region.") + data_type: Optional[StrictStr] = Field(default=None, description="The type of data produced by the provider.", alias="dataType") + asns: Optional[List[ApiAsn]] = Field(default=None, description="List of ASN's covered by the Provider.") + locations: Optional[List[ApiCatalogProviderDetailsLocationsInner]] = Field(default=None, description="List of locations covered by the Provider.") + __properties: ClassVar[List[str]] = ["id", "providerName", "providerType", "region", "dataType", "asns", "locations"] + + 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 ApiCatalogProviderDetails 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 asns (list) + _items = [] + if self.asns: + for _item in self.asns: + if _item: + _items.append(_item.to_dict()) + _dict['asns'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in locations (list) + _items = [] + if self.locations: + for _item in self.locations: + if _item: + _items.append(_item.to_dict()) + _dict['locations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiCatalogProviderDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "providerName": obj.get("providerName"), + "providerType": obj.get("providerType"), + "region": obj.get("region"), + "dataType": obj.get("dataType"), + "asns": [ApiAsn.from_dict(_item) for _item in obj.get("asns")] if obj.get("asns") is not None else None, + "locations": [ApiCatalogProviderDetailsLocationsInner.from_dict(_item) for _item in obj.get("locations")] if obj.get("locations") is not None else None + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_catalog_provider_details_locations_inner.py b/internet_insights_api/internet_insights_api/models/api_catalog_provider_details_locations_inner.py new file mode 100644 index 00000000..9a209a1e --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_catalog_provider_details_locations_inner.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 ApiCatalogProviderDetailsLocationsInner(BaseModel): + """ + ApiCatalogProviderDetailsLocationsInner + """ # noqa: E501 + location: Optional[StrictStr] = Field(default=None, description="The location covered by the Provider.") + interfaces_count: Optional[StrictInt] = Field(default=None, description="The number of interfaces covered by the Provider at this location.", alias="interfacesCount") + __properties: ClassVar[List[str]] = ["location", "interfacesCount"] + + 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 ApiCatalogProviderDetailsLocationsInner 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 ApiCatalogProviderDetailsLocationsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "location": obj.get("location"), + "interfacesCount": obj.get("interfacesCount") + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_catalog_provider_details_response.py b/internet_insights_api/internet_insights_api/models/api_catalog_provider_details_response.py new file mode 100644 index 00000000..1595aff1 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_catalog_provider_details_response.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_api.models.api_asn import ApiAsn +from internet_insights_api.models.api_catalog_provider_details_locations_inner import ApiCatalogProviderDetailsLocationsInner +from internet_insights_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiCatalogProviderDetailsResponse(BaseModel): + """ + ApiCatalogProviderDetailsResponse + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The catalog provider ID.") + provider_name: Optional[StrictStr] = Field(default=None, description="The name of the catalog provider.", alias="providerName") + provider_type: Optional[StrictStr] = Field(default=None, description="The type of catalog provider.", alias="providerType") + region: Optional[StrictStr] = Field(default=None, description="The catalog provider region.") + data_type: Optional[StrictStr] = Field(default=None, description="The type of data produced by the provider.", alias="dataType") + asns: Optional[List[ApiAsn]] = Field(default=None, description="List of ASN's covered by the Provider.") + locations: Optional[List[ApiCatalogProviderDetailsLocationsInner]] = Field(default=None, description="List of locations covered by the Provider.") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["id", "providerName", "providerType", "region", "dataType", "asns", "locations", "_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 ApiCatalogProviderDetailsResponse 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 asns (list) + _items = [] + if self.asns: + for _item in self.asns: + if _item: + _items.append(_item.to_dict()) + _dict['asns'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in locations (list) + _items = [] + if self.locations: + for _item in self.locations: + if _item: + _items.append(_item.to_dict()) + _dict['locations'] = _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 ApiCatalogProviderDetailsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "providerName": obj.get("providerName"), + "providerType": obj.get("providerType"), + "region": obj.get("region"), + "dataType": obj.get("dataType"), + "asns": [ApiAsn.from_dict(_item) for _item in obj.get("asns")] if obj.get("asns") is not None else None, + "locations": [ApiCatalogProviderDetailsLocationsInner.from_dict(_item) for _item in obj.get("locations")] if obj.get("locations") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_catalog_provider_filter.py b/internet_insights_api/internet_insights_api/models/api_catalog_provider_filter.py new file mode 100644 index 00000000..27a0de69 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_catalog_provider_filter.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 ApiCatalogProviderFilter(BaseModel): + """ + Advanced filter query used to filter the response. The provider name, location, asn can be partial names. Can filter on: - Provider name - Provider type - Region - Location - ASN - included + """ # noqa: E501 + provider_name: Optional[StrictStr] = Field(default=None, description="The name of the catalog provider.", alias="providerName") + provider_type: Optional[StrictStr] = Field(default=None, description="The type of catalog provider.", alias="providerType") + region: Optional[StrictStr] = Field(default=None, description="The catalog provider region.") + location: Optional[StrictStr] = Field(default=None, description="Location of the catalog provider.") + asn: Optional[StrictStr] = Field(default=None, description="Name of the ASN (Autonomous Systems Number) covered by providers.") + included: Optional[StrictBool] = Field(default=None, description="Indicates whether the catalog provider is included in the licensed packages. true returns providers covered by licensed packages, false returns providers not covered by licensed packages.") + __properties: ClassVar[List[str]] = ["providerName", "providerType", "region", "location", "asn", "included"] + + 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 ApiCatalogProviderFilter 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 ApiCatalogProviderFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "providerName": obj.get("providerName"), + "providerType": obj.get("providerType"), + "region": obj.get("region"), + "location": obj.get("location"), + "asn": obj.get("asn"), + "included": obj.get("included") + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_catalog_provider_response.py b/internet_insights_api/internet_insights_api/models/api_catalog_provider_response.py new file mode 100644 index 00000000..72a578da --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_catalog_provider_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_api.models.api_catalog_provider_response_all_of_providers_inner import ApiCatalogProviderResponseAllOfProvidersInner +from internet_insights_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiCatalogProviderResponse(BaseModel): + """ + ApiCatalogProviderResponse + """ # noqa: E501 + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + providers: Optional[List[ApiCatalogProviderResponseAllOfProvidersInner]] = Field(default=None, description="List of catalog providers.") + __properties: ClassVar[List[str]] = ["_links", "providers"] + + 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 ApiCatalogProviderResponse 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() + # override the default output from pydantic by calling `to_dict()` of each item in providers (list) + _items = [] + if self.providers: + for _item in self.providers: + if _item: + _items.append(_item.to_dict()) + _dict['providers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiCatalogProviderResponse 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, + "providers": [ApiCatalogProviderResponseAllOfProvidersInner.from_dict(_item) for _item in obj.get("providers")] if obj.get("providers") is not None else None + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_catalog_provider_response_all_of_providers_inner.py b/internet_insights_api/internet_insights_api/models/api_catalog_provider_response_all_of_providers_inner.py new file mode 100644 index 00000000..1001b858 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_catalog_provider_response_all_of_providers_inner.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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, StrictInt, StrictStr +from pydantic import Field +from internet_insights_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiCatalogProviderResponseAllOfProvidersInner(BaseModel): + """ + ApiCatalogProviderResponseAllOfProvidersInner + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The catalog provider ID.") + provider_name: Optional[StrictStr] = Field(default=None, description="The name of the catalog provider.", alias="providerName") + provider_type: Optional[StrictStr] = Field(default=None, description="The type of catalog provider.", alias="providerType") + region: Optional[StrictStr] = Field(default=None, description="The catalog provider region.") + data_type: Optional[StrictStr] = Field(default=None, description="The type of data produced by the provider.", alias="dataType") + asns_count: Optional[StrictInt] = Field(default=None, description="The number of ASN's covered by the provider.", alias="asnsCount") + countries_count: Optional[StrictInt] = Field(default=None, description="The number of countries covered by the provider.", alias="countriesCount") + locations_count: Optional[StrictInt] = Field(default=None, description="The number of locations covered by the provider.", alias="locationsCount") + interfaces_count: Optional[StrictInt] = Field(default=None, description="The number of interfaces covered by the provider.", alias="interfacesCount") + included: Optional[StrictBool] = Field(default=None, description="Indicates whether the catalog provider is included in the licensed packages.") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["id", "providerName", "providerType", "region", "dataType", "asnsCount", "countriesCount", "locationsCount", "interfacesCount", "included", "_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 ApiCatalogProviderResponseAllOfProvidersInner 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 ApiCatalogProviderResponseAllOfProvidersInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "providerName": obj.get("providerName"), + "providerType": obj.get("providerType"), + "region": obj.get("region"), + "dataType": obj.get("dataType"), + "asnsCount": obj.get("asnsCount"), + "countriesCount": obj.get("countriesCount"), + "locationsCount": obj.get("locationsCount"), + "interfacesCount": obj.get("interfacesCount"), + "included": obj.get("included"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_network_outage_affected_location.py b/internet_insights_api/internet_insights_api/models/api_network_outage_affected_location.py new file mode 100644 index 00000000..cb6f398a --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_network_outage_affected_location.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 ApiNetworkOutageAffectedLocation(BaseModel): + """ + ApiNetworkOutageAffectedLocation + """ # noqa: E501 + location: Optional[StrictStr] = Field(default=None, description="The affected location.") + affected_interfaces: Optional[List[StrictStr]] = Field(default=None, description="The affected interfaces in this location.", alias="affectedInterfaces") + __properties: ClassVar[List[str]] = ["location", "affectedInterfaces"] + + 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 ApiNetworkOutageAffectedLocation 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 ApiNetworkOutageAffectedLocation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "location": obj.get("location"), + "affectedInterfaces": obj.get("affectedInterfaces") + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_network_outage_details.py b/internet_insights_api/internet_insights_api/models/api_network_outage_details.py new file mode 100644 index 00000000..5fd00c85 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_network_outage_details.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 +from internet_insights_api.models.api_affected_agent import ApiAffectedAgent +from internet_insights_api.models.api_affected_test import ApiAffectedTest +from internet_insights_api.models.api_network_outage_affected_location import ApiNetworkOutageAffectedLocation +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiNetworkOutageDetails(BaseModel): + """ + ApiNetworkOutageDetails + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The ID of the outage.") + provider_name: Optional[StrictStr] = Field(default=None, description="The name of the affected provider.", alias="providerName") + provider_type: Optional[StrictStr] = Field(default=None, description="The type of the affected provider.", alias="providerType") + network_name: Optional[StrictStr] = Field(default=None, description="The affected network.", alias="networkName") + asn: Optional[StrictInt] = Field(default=None, description="ASN number") + start_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage started.", alias="startDate") + start_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage started.", alias="startRoundId") + end_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage ended.", alias="endDate") + end_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage ended.", alias="endRoundId") + duration: Optional[StrictInt] = Field(default=None, description="Duration of the outage in seconds.") + affected_tests: Optional[List[ApiAffectedTest]] = Field(default=None, description="List of affected tests.", alias="affectedTests") + affected_domains: Optional[List[StrictStr]] = Field(default=None, description="List of affected domains.", alias="affectedDomains") + affected_agents: Optional[List[ApiAffectedAgent]] = Field(default=None, description="List of affected agents.", alias="affectedAgents") + affected_locations: Optional[List[ApiNetworkOutageAffectedLocation]] = Field(default=None, description="List of affected locations.", alias="affectedLocations") + __properties: ClassVar[List[str]] = ["id", "providerName", "providerType", "networkName", "asn", "startDate", "startRoundId", "endDate", "endRoundId", "duration", "affectedTests", "affectedDomains", "affectedAgents", "affectedLocations"] + + 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 ApiNetworkOutageDetails 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 affected_tests (list) + _items = [] + if self.affected_tests: + for _item in self.affected_tests: + if _item: + _items.append(_item.to_dict()) + _dict['affectedTests'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in affected_agents (list) + _items = [] + if self.affected_agents: + for _item in self.affected_agents: + if _item: + _items.append(_item.to_dict()) + _dict['affectedAgents'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in affected_locations (list) + _items = [] + if self.affected_locations: + for _item in self.affected_locations: + if _item: + _items.append(_item.to_dict()) + _dict['affectedLocations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiNetworkOutageDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "providerName": obj.get("providerName"), + "providerType": obj.get("providerType"), + "networkName": obj.get("networkName"), + "asn": obj.get("asn"), + "startDate": obj.get("startDate"), + "startRoundId": obj.get("startRoundId"), + "endDate": obj.get("endDate"), + "endRoundId": obj.get("endRoundId"), + "duration": obj.get("duration"), + "affectedTests": [ApiAffectedTest.from_dict(_item) for _item in obj.get("affectedTests")] if obj.get("affectedTests") is not None else None, + "affectedDomains": obj.get("affectedDomains"), + "affectedAgents": [ApiAffectedAgent.from_dict(_item) for _item in obj.get("affectedAgents")] if obj.get("affectedAgents") is not None else None, + "affectedLocations": [ApiNetworkOutageAffectedLocation.from_dict(_item) for _item in obj.get("affectedLocations")] if obj.get("affectedLocations") is not None else None + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_network_outage_response.py b/internet_insights_api/internet_insights_api/models/api_network_outage_response.py new file mode 100644 index 00000000..dd9fbfa6 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_network_outage_response.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 +from internet_insights_api.models.api_affected_agent import ApiAffectedAgent +from internet_insights_api.models.api_affected_test import ApiAffectedTest +from internet_insights_api.models.api_network_outage_affected_location import ApiNetworkOutageAffectedLocation +from internet_insights_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiNetworkOutageResponse(BaseModel): + """ + ApiNetworkOutageResponse + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The ID of the outage.") + provider_name: Optional[StrictStr] = Field(default=None, description="The name of the affected provider.", alias="providerName") + provider_type: Optional[StrictStr] = Field(default=None, description="The type of the affected provider.", alias="providerType") + network_name: Optional[StrictStr] = Field(default=None, description="The affected network.", alias="networkName") + asn: Optional[StrictInt] = Field(default=None, description="ASN number") + start_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage started.", alias="startDate") + start_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage started.", alias="startRoundId") + end_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage ended.", alias="endDate") + end_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage ended.", alias="endRoundId") + duration: Optional[StrictInt] = Field(default=None, description="Duration of the outage in seconds.") + affected_tests: Optional[List[ApiAffectedTest]] = Field(default=None, description="List of affected tests.", alias="affectedTests") + affected_domains: Optional[List[StrictStr]] = Field(default=None, description="List of affected domains.", alias="affectedDomains") + affected_agents: Optional[List[ApiAffectedAgent]] = Field(default=None, description="List of affected agents.", alias="affectedAgents") + affected_locations: Optional[List[ApiNetworkOutageAffectedLocation]] = Field(default=None, description="List of affected locations.", alias="affectedLocations") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["id", "providerName", "providerType", "networkName", "asn", "startDate", "startRoundId", "endDate", "endRoundId", "duration", "affectedTests", "affectedDomains", "affectedAgents", "affectedLocations", "_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 ApiNetworkOutageResponse 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 affected_tests (list) + _items = [] + if self.affected_tests: + for _item in self.affected_tests: + if _item: + _items.append(_item.to_dict()) + _dict['affectedTests'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in affected_agents (list) + _items = [] + if self.affected_agents: + for _item in self.affected_agents: + if _item: + _items.append(_item.to_dict()) + _dict['affectedAgents'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in affected_locations (list) + _items = [] + if self.affected_locations: + for _item in self.affected_locations: + if _item: + _items.append(_item.to_dict()) + _dict['affectedLocations'] = _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 ApiNetworkOutageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "providerName": obj.get("providerName"), + "providerType": obj.get("providerType"), + "networkName": obj.get("networkName"), + "asn": obj.get("asn"), + "startDate": obj.get("startDate"), + "startRoundId": obj.get("startRoundId"), + "endDate": obj.get("endDate"), + "endRoundId": obj.get("endRoundId"), + "duration": obj.get("duration"), + "affectedTests": [ApiAffectedTest.from_dict(_item) for _item in obj.get("affectedTests")] if obj.get("affectedTests") is not None else None, + "affectedDomains": obj.get("affectedDomains"), + "affectedAgents": [ApiAffectedAgent.from_dict(_item) for _item in obj.get("affectedAgents")] if obj.get("affectedAgents") is not None else None, + "affectedLocations": [ApiNetworkOutageAffectedLocation.from_dict(_item) for _item in obj.get("affectedLocations")] if obj.get("affectedLocations") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_outage.py b/internet_insights_api/internet_insights_api/models/api_outage.py new file mode 100644 index 00000000..929c70e5 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_outage.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 ApiOutage(BaseModel): + """ + List of outages. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The ID of the outage.") + type: Optional[StrictStr] = Field(default=None, description="The type of outage e.g. app.") + provider_name: Optional[StrictStr] = Field(default=None, description="The name of the affected provider.", alias="providerName") + provider_type: Optional[StrictStr] = Field(default=None, description="The type of the affected provider.", alias="providerType") + name: Optional[StrictStr] = Field(default=None, description="The name of the affected application.") + start_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage started.", alias="startDate") + start_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage started.", alias="startRoundId") + end_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage ended.", alias="endDate") + end_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage ended.", alias="endRoundId") + duration: Optional[StrictInt] = Field(default=None, description="Duration of the outage (seconds)") + affected_tests_count: Optional[StrictInt] = Field(default=None, description="The number of affected tests", alias="affectedTestsCount") + affected_servers_count: Optional[StrictInt] = Field(default=None, description="The number of affected servers", alias="affectedServersCount") + affected_locations_count: Optional[StrictInt] = Field(default=None, description="The number of affected locations", alias="affectedLocationsCount") + __properties: ClassVar[List[str]] = ["id", "type", "providerName", "providerType", "name", "startDate", "startRoundId", "endDate", "endRoundId", "duration", "affectedTestsCount", "affectedServersCount", "affectedLocationsCount"] + + 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 ApiOutage 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 ApiOutage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "providerName": obj.get("providerName"), + "providerType": obj.get("providerType"), + "name": obj.get("name"), + "startDate": obj.get("startDate"), + "startRoundId": obj.get("startRoundId"), + "endDate": obj.get("endDate"), + "endRoundId": obj.get("endRoundId"), + "duration": obj.get("duration"), + "affectedTestsCount": obj.get("affectedTestsCount"), + "affectedServersCount": obj.get("affectedServersCount"), + "affectedLocationsCount": obj.get("affectedLocationsCount") + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_outage_filter.py b/internet_insights_api/internet_insights_api/models/api_outage_filter.py new file mode 100644 index 00000000..e9d95ea7 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_outage_filter.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_api.models.outage_scope import OutageScope +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiOutageFilter(BaseModel): + """ + Advanced filter query used to filter the response. Can filter on: - outageScope (all, affected tests (e.g. my tests only)). - providerName - interfaceNetwork - applicationName - startDate, endDate - window + """ # noqa: E501 + start_date: Optional[StrictStr] = Field(default=None, description="Start of the time range. Must be paired with `endDate`.", alias="startDate") + end_date: Optional[StrictStr] = Field(default=None, description="End of the time range. Must be paired with `startDate`.", alias="endDate") + window: Optional[StrictStr] = Field(default=None, description="Specify a time period in the past for which to retrieve data. Alternative to specifying `startDate` and `endDate`.") + outage_scope: Optional[OutageScope] = Field(default=None, alias="outageScope") + provider_name: Optional[List[StrictStr]] = Field(default=None, description="The name used to identify the provider.", alias="providerName") + application_name: Optional[List[StrictStr]] = Field(default=None, description="The name to identify the application.", alias="applicationName") + interface_network: Optional[List[StrictStr]] = Field(default=None, description="The name of the ASN (Interface Network).", alias="interfaceNetwork") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "window", "outageScope", "providerName", "applicationName", "interfaceNetwork"] + + 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 ApiOutageFilter 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 ApiOutageFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "window": obj.get("window"), + "outageScope": obj.get("outageScope"), + "providerName": obj.get("providerName"), + "applicationName": obj.get("applicationName"), + "interfaceNetwork": obj.get("interfaceNetwork") + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_outages_response.py b/internet_insights_api/internet_insights_api/models/api_outages_response.py new file mode 100644 index 00000000..a1634b1d --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_outages_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_api.models.api_outages_response_all_of_outages_inner import ApiOutagesResponseAllOfOutagesInner +from internet_insights_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiOutagesResponse(BaseModel): + """ + ApiOutagesResponse + """ # noqa: E501 + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + outages: Optional[List[ApiOutagesResponseAllOfOutagesInner]] = Field(default=None, description="List of application outages.") + __properties: ClassVar[List[str]] = ["_links", "outages"] + + 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 ApiOutagesResponse 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() + # override the default output from pydantic by calling `to_dict()` of each item in outages (list) + _items = [] + if self.outages: + for _item in self.outages: + if _item: + _items.append(_item.to_dict()) + _dict['outages'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ApiOutagesResponse 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, + "outages": [ApiOutagesResponseAllOfOutagesInner.from_dict(_item) for _item in obj.get("outages")] if obj.get("outages") is not None else None + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/api_outages_response_all_of_outages_inner.py b/internet_insights_api/internet_insights_api/models/api_outages_response_all_of_outages_inner.py new file mode 100644 index 00000000..c8f32465 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/api_outages_response_all_of_outages_inner.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 +from internet_insights_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiOutagesResponseAllOfOutagesInner(BaseModel): + """ + ApiOutagesResponseAllOfOutagesInner + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The ID of the outage.") + type: Optional[StrictStr] = Field(default=None, description="The type of outage e.g. app.") + provider_name: Optional[StrictStr] = Field(default=None, description="The name of the affected provider.", alias="providerName") + provider_type: Optional[StrictStr] = Field(default=None, description="The type of the affected provider.", alias="providerType") + name: Optional[StrictStr] = Field(default=None, description="The name of the affected application.") + start_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage started.", alias="startDate") + start_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage started.", alias="startRoundId") + end_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage ended.", alias="endDate") + end_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage ended.", alias="endRoundId") + duration: Optional[StrictInt] = Field(default=None, description="Duration of the outage (seconds)") + affected_tests_count: Optional[StrictInt] = Field(default=None, description="The number of affected tests", alias="affectedTestsCount") + affected_servers_count: Optional[StrictInt] = Field(default=None, description="The number of affected servers", alias="affectedServersCount") + affected_locations_count: Optional[StrictInt] = Field(default=None, description="The number of affected locations", alias="affectedLocationsCount") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["id", "type", "providerName", "providerType", "name", "startDate", "startRoundId", "endDate", "endRoundId", "duration", "affectedTestsCount", "affectedServersCount", "affectedLocationsCount", "_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 ApiOutagesResponseAllOfOutagesInner 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 ApiOutagesResponseAllOfOutagesInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "providerName": obj.get("providerName"), + "providerType": obj.get("providerType"), + "name": obj.get("name"), + "startDate": obj.get("startDate"), + "startRoundId": obj.get("startRoundId"), + "endDate": obj.get("endDate"), + "endRoundId": obj.get("endRoundId"), + "duration": obj.get("duration"), + "affectedTestsCount": obj.get("affectedTestsCount"), + "affectedServersCount": obj.get("affectedServersCount"), + "affectedLocationsCount": obj.get("affectedLocationsCount"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/internet_insights_api/internet_insights_api/models/error.py b/internet_insights_api/internet_insights_api/models/error.py new file mode 100644 index 00000000..d1c8c977 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 + + diff --git a/internet_insights_api/internet_insights_api/models/link.py b/internet_insights_api/internet_insights_api/models/link.py new file mode 100644 index 00000000..aebc7a80 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 + + diff --git a/internet_insights_api/internet_insights_api/models/outage_scope.py b/internet_insights_api/internet_insights_api/models/outage_scope.py new file mode 100644 index 00000000..cc2a8a40 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/outage_scope.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 OutageScope(str, Enum): + """ + Scope of the outage + """ + + """ + allowed enum values + """ + ALL = 'all' + WITH_MINUS_AFFECTED_MINUS_TEST = 'with-affected-test' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OutageScope from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/internet_insights_api/internet_insights_api/models/self_links.py b/internet_insights_api/internet_insights_api/models/self_links.py new file mode 100644 index 00000000..615cdbf0 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_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 + + diff --git a/internet_insights_api/internet_insights_api/models/self_links_links.py b/internet_insights_api/internet_insights_api/models/self_links_links.py new file mode 100644 index 00000000..58c9aac2 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_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 + + diff --git a/internet_insights_api/internet_insights_api/models/unauthorized_error.py b/internet_insights_api/internet_insights_api/models/unauthorized_error.py new file mode 100644 index 00000000..df3fd773 --- /dev/null +++ b/internet_insights_api/internet_insights_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 + + diff --git a/internet_insights_api/internet_insights_api/py.typed b/internet_insights_api/internet_insights_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/internet_insights_api/internet_insights_api/rest.py b/internet_insights_api/internet_insights_api/rest.py new file mode 100644 index 00000000..e8eeec13 --- /dev/null +++ b/internet_insights_api/internet_insights_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 internet_insights_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) diff --git a/internet_insights_api/pyproject.toml b/internet_insights_api/pyproject.toml new file mode 100644 index 00000000..2aae9efc --- /dev/null +++ b/internet_insights_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "internet_insights_api" +version = "1.0.0" +description = "Internet Insights API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Internet Insights API"] +include = ["internet_insights_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/internet_insights_api/requirements.txt b/internet_insights_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/internet_insights_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/internet_insights_api/setup.cfg b/internet_insights_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/internet_insights_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/internet_insights_api/setup.py b/internet_insights_api/setup.py new file mode 100644 index 00000000..589ebe67 --- /dev/null +++ b/internet_insights_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "internet-insights-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Internet Insights API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Internet Insights API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + """, # noqa: E501 + package_data={"internet_insights_api": ["py.typed"]}, +) diff --git a/internet_insights_api/test-requirements.txt b/internet_insights_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/internet_insights_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/internet_insights_api/test/__init__.py b/internet_insights_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/internet_insights_api/test/test_api_affected_agent.py b/internet_insights_api/test/test_api_affected_agent.py new file mode 100644 index 00000000..5a08e420 --- /dev/null +++ b/internet_insights_api/test/test_api_affected_agent.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_affected_agent import ApiAffectedAgent + +class TestApiAffectedAgent(unittest.TestCase): + """ApiAffectedAgent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiAffectedAgent: + """Test ApiAffectedAgent + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiAffectedAgent` + """ + model = ApiAffectedAgent() + if include_optional: + return ApiAffectedAgent( + id = 11, + name = 'London, England' + ) + else: + return ApiAffectedAgent( + ) + """ + + def testApiAffectedAgent(self): + """Test ApiAffectedAgent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_affected_test.py b/internet_insights_api/test/test_api_affected_test.py new file mode 100644 index 00000000..a0553d45 --- /dev/null +++ b/internet_insights_api/test/test_api_affected_test.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_affected_test import ApiAffectedTest + +class TestApiAffectedTest(unittest.TestCase): + """ApiAffectedTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiAffectedTest: + """Test ApiAffectedTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiAffectedTest` + """ + model = ApiAffectedTest() + if include_optional: + return ApiAffectedTest( + id = 5, + name = 'amazon-test2' + ) + else: + return ApiAffectedTest( + ) + """ + + def testApiAffectedTest(self): + """Test ApiAffectedTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_application_outage_affected_location.py b/internet_insights_api/test/test_api_application_outage_affected_location.py new file mode 100644 index 00000000..607aecf3 --- /dev/null +++ b/internet_insights_api/test/test_api_application_outage_affected_location.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_application_outage_affected_location import ApiApplicationOutageAffectedLocation + +class TestApiApplicationOutageAffectedLocation(unittest.TestCase): + """ApiApplicationOutageAffectedLocation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiApplicationOutageAffectedLocation: + """Test ApiApplicationOutageAffectedLocation + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiApplicationOutageAffectedLocation` + """ + model = ApiApplicationOutageAffectedLocation() + if include_optional: + return ApiApplicationOutageAffectedLocation( + location = 'Chicago, Illinois, US', + affected_servers = [ + internet_insights_api.models.api_application_outage_affected_server.ApiApplicationOutageAffectedServer( + domain = 'amazon.com', + prefix = '123.176.185.0/23', ) + ] + ) + else: + return ApiApplicationOutageAffectedLocation( + ) + """ + + def testApiApplicationOutageAffectedLocation(self): + """Test ApiApplicationOutageAffectedLocation""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_application_outage_affected_server.py b/internet_insights_api/test/test_api_application_outage_affected_server.py new file mode 100644 index 00000000..57b0556e --- /dev/null +++ b/internet_insights_api/test/test_api_application_outage_affected_server.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_application_outage_affected_server import ApiApplicationOutageAffectedServer + +class TestApiApplicationOutageAffectedServer(unittest.TestCase): + """ApiApplicationOutageAffectedServer unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiApplicationOutageAffectedServer: + """Test ApiApplicationOutageAffectedServer + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiApplicationOutageAffectedServer` + """ + model = ApiApplicationOutageAffectedServer() + if include_optional: + return ApiApplicationOutageAffectedServer( + domain = 'amazon.com', + prefix = '123.176.185.0/23' + ) + else: + return ApiApplicationOutageAffectedServer( + ) + """ + + def testApiApplicationOutageAffectedServer(self): + """Test ApiApplicationOutageAffectedServer""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_application_outage_details.py b/internet_insights_api/test/test_api_application_outage_details.py new file mode 100644 index 00000000..4c0df50a --- /dev/null +++ b/internet_insights_api/test/test_api_application_outage_details.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_application_outage_details import ApiApplicationOutageDetails + +class TestApiApplicationOutageDetails(unittest.TestCase): + """ApiApplicationOutageDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiApplicationOutageDetails: + """Test ApiApplicationOutageDetails + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiApplicationOutageDetails` + """ + model = ApiApplicationOutageDetails() + if include_optional: + return ApiApplicationOutageDetails( + id = '0CC4C4209887126DE42E92252FB43962CBB3193147F318EA', + provider_name = 'Amazon Web Services', + provider_type = 'SAAS', + application_name = 'Amazon Web Services', + start_date = '2023-01-27T20:50:51.256Z', + start_round_id = 1674852600, + end_date = '2023-01-27T20:53:51.256Z', + end_round_id = 1674852600, + duration = 180, + affected_tests = [ + internet_insights_api.models.api_affected_test.ApiAffectedTest( + id = 5, + name = 'amazon-test2', ) + ], + affected_domains = [ + 'amazon.com' + ], + affected_agents = [ + internet_insights_api.models.api_affected_agent.ApiAffectedAgent( + id = 11, + name = 'London, England', ) + ], + errors = [ + 'HTTP_SERVER_TIMEOUT' + ], + affected_locations = [ + internet_insights_api.models.api_application_outage_affected_location.ApiApplicationOutageAffectedLocation( + location = 'Chicago, Illinois, US', + affected_servers = [ + internet_insights_api.models.api_application_outage_affected_server.ApiApplicationOutageAffectedServer( + domain = 'amazon.com', + prefix = '123.176.185.0/23', ) + ], ) + ] + ) + else: + return ApiApplicationOutageDetails( + ) + """ + + def testApiApplicationOutageDetails(self): + """Test ApiApplicationOutageDetails""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_application_outage_response.py b/internet_insights_api/test/test_api_application_outage_response.py new file mode 100644 index 00000000..49bb2175 --- /dev/null +++ b/internet_insights_api/test/test_api_application_outage_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_application_outage_response import ApiApplicationOutageResponse + +class TestApiApplicationOutageResponse(unittest.TestCase): + """ApiApplicationOutageResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiApplicationOutageResponse: + """Test ApiApplicationOutageResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiApplicationOutageResponse` + """ + model = ApiApplicationOutageResponse() + if include_optional: + return ApiApplicationOutageResponse( + id = '0CC4C4209887126DE42E92252FB43962CBB3193147F318EA', + provider_name = 'Amazon Web Services', + provider_type = 'SAAS', + application_name = 'Amazon Web Services', + start_date = '2023-01-27T20:50:51.256Z', + start_round_id = 1674852600, + end_date = '2023-01-27T20:53:51.256Z', + end_round_id = 1674852600, + duration = 180, + affected_tests = [ + internet_insights_api.models.api_affected_test.ApiAffectedTest( + id = 5, + name = 'amazon-test2', ) + ], + affected_domains = [ + 'amazon.com' + ], + affected_agents = [ + internet_insights_api.models.api_affected_agent.ApiAffectedAgent( + id = 11, + name = 'London, England', ) + ], + errors = [ + 'HTTP_SERVER_TIMEOUT' + ], + affected_locations = [ + internet_insights_api.models.api_application_outage_affected_location.ApiApplicationOutageAffectedLocation( + location = 'Chicago, Illinois, US', + affected_servers = [ + internet_insights_api.models.api_application_outage_affected_server.ApiApplicationOutageAffectedServer( + domain = 'amazon.com', + prefix = '123.176.185.0/23', ) + ], ) + ], + links = internet_insights_api.models.self_links__links.SelfLinks__links( + self = internet_insights_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return ApiApplicationOutageResponse( + ) + """ + + def testApiApplicationOutageResponse(self): + """Test ApiApplicationOutageResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_asn.py b/internet_insights_api/test/test_api_asn.py new file mode 100644 index 00000000..ab7ebf8c --- /dev/null +++ b/internet_insights_api/test/test_api_asn.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_asn import ApiAsn + +class TestApiAsn(unittest.TestCase): + """ApiAsn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiAsn: + """Test ApiAsn + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiAsn` + """ + model = ApiAsn() + if include_optional: + return ApiAsn( + id = 1, + name = 'LVLT-1 - Level 3 Communications, Inc.' + ) + else: + return ApiAsn( + ) + """ + + def testApiAsn(self): + """Test ApiAsn""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_catalog_provider.py b/internet_insights_api/test/test_api_catalog_provider.py new file mode 100644 index 00000000..66e3f7fa --- /dev/null +++ b/internet_insights_api/test/test_api_catalog_provider.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_catalog_provider import ApiCatalogProvider + +class TestApiCatalogProvider(unittest.TestCase): + """ApiCatalogProvider unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiCatalogProvider: + """Test ApiCatalogProvider + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiCatalogProvider` + """ + model = ApiCatalogProvider() + if include_optional: + return ApiCatalogProvider( + id = '85602a0a-54a7-4e97-946e-67492ef1fa26', + provider_name = 'Amazon Web Services', + provider_type = 'IAAS', + region = 'North America', + data_type = 'Application', + asns_count = 10, + countries_count = 2, + locations_count = 50, + interfaces_count = 15, + included = True + ) + else: + return ApiCatalogProvider( + ) + """ + + def testApiCatalogProvider(self): + """Test ApiCatalogProvider""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_catalog_provider_details.py b/internet_insights_api/test/test_api_catalog_provider_details.py new file mode 100644 index 00000000..415a7873 --- /dev/null +++ b/internet_insights_api/test/test_api_catalog_provider_details.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_catalog_provider_details import ApiCatalogProviderDetails + +class TestApiCatalogProviderDetails(unittest.TestCase): + """ApiCatalogProviderDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiCatalogProviderDetails: + """Test ApiCatalogProviderDetails + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiCatalogProviderDetails` + """ + model = ApiCatalogProviderDetails() + if include_optional: + return ApiCatalogProviderDetails( + id = '85602a0a-54a7-4e97-946e-67492ef1fa26', + provider_name = 'Amazon Web Services', + provider_type = 'IAAS', + region = 'North America', + data_type = 'Application', + asns = [ + internet_insights_api.models.api_asn.ApiAsn( + id = 1, + name = 'LVLT-1 - Level 3 Communications, Inc.', ) + ], + locations = [ + internet_insights_api.models.api_catalog_provider_details_locations_inner.ApiCatalogProviderDetails_locations_inner( + location = 'San Jose, US', + interfaces_count = 5, ) + ] + ) + else: + return ApiCatalogProviderDetails( + ) + """ + + def testApiCatalogProviderDetails(self): + """Test ApiCatalogProviderDetails""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_catalog_provider_details_locations_inner.py b/internet_insights_api/test/test_api_catalog_provider_details_locations_inner.py new file mode 100644 index 00000000..a81154c6 --- /dev/null +++ b/internet_insights_api/test/test_api_catalog_provider_details_locations_inner.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_catalog_provider_details_locations_inner import ApiCatalogProviderDetailsLocationsInner + +class TestApiCatalogProviderDetailsLocationsInner(unittest.TestCase): + """ApiCatalogProviderDetailsLocationsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiCatalogProviderDetailsLocationsInner: + """Test ApiCatalogProviderDetailsLocationsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiCatalogProviderDetailsLocationsInner` + """ + model = ApiCatalogProviderDetailsLocationsInner() + if include_optional: + return ApiCatalogProviderDetailsLocationsInner( + location = 'San Jose, US', + interfaces_count = 5 + ) + else: + return ApiCatalogProviderDetailsLocationsInner( + ) + """ + + def testApiCatalogProviderDetailsLocationsInner(self): + """Test ApiCatalogProviderDetailsLocationsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_catalog_provider_details_response.py b/internet_insights_api/test/test_api_catalog_provider_details_response.py new file mode 100644 index 00000000..22421b26 --- /dev/null +++ b/internet_insights_api/test/test_api_catalog_provider_details_response.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_catalog_provider_details_response import ApiCatalogProviderDetailsResponse + +class TestApiCatalogProviderDetailsResponse(unittest.TestCase): + """ApiCatalogProviderDetailsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiCatalogProviderDetailsResponse: + """Test ApiCatalogProviderDetailsResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiCatalogProviderDetailsResponse` + """ + model = ApiCatalogProviderDetailsResponse() + if include_optional: + return ApiCatalogProviderDetailsResponse( + id = '85602a0a-54a7-4e97-946e-67492ef1fa26', + provider_name = 'Amazon Web Services', + provider_type = 'IAAS', + region = 'North America', + data_type = 'Application', + asns = [ + internet_insights_api.models.api_asn.ApiAsn( + id = 1, + name = 'LVLT-1 - Level 3 Communications, Inc.', ) + ], + locations = [ + internet_insights_api.models.api_catalog_provider_details_locations_inner.ApiCatalogProviderDetails_locations_inner( + location = 'San Jose, US', + interfaces_count = 5, ) + ], + links = internet_insights_api.models.self_links__links.SelfLinks__links( + self = internet_insights_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return ApiCatalogProviderDetailsResponse( + ) + """ + + def testApiCatalogProviderDetailsResponse(self): + """Test ApiCatalogProviderDetailsResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_catalog_provider_filter.py b/internet_insights_api/test/test_api_catalog_provider_filter.py new file mode 100644 index 00000000..5d6960cb --- /dev/null +++ b/internet_insights_api/test/test_api_catalog_provider_filter.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_catalog_provider_filter import ApiCatalogProviderFilter + +class TestApiCatalogProviderFilter(unittest.TestCase): + """ApiCatalogProviderFilter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiCatalogProviderFilter: + """Test ApiCatalogProviderFilter + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiCatalogProviderFilter` + """ + model = ApiCatalogProviderFilter() + if include_optional: + return ApiCatalogProviderFilter( + provider_name = 'Amazon Web Services', + provider_type = 'IAAS', + region = 'North America', + location = 'San Jose, US', + asn = 'Amazon.com, Inc.', + included = True + ) + else: + return ApiCatalogProviderFilter( + ) + """ + + def testApiCatalogProviderFilter(self): + """Test ApiCatalogProviderFilter""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_catalog_provider_response.py b/internet_insights_api/test/test_api_catalog_provider_response.py new file mode 100644 index 00000000..e10fa59f --- /dev/null +++ b/internet_insights_api/test/test_api_catalog_provider_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_catalog_provider_response import ApiCatalogProviderResponse + +class TestApiCatalogProviderResponse(unittest.TestCase): + """ApiCatalogProviderResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiCatalogProviderResponse: + """Test ApiCatalogProviderResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiCatalogProviderResponse` + """ + model = ApiCatalogProviderResponse() + if include_optional: + return ApiCatalogProviderResponse( + links = internet_insights_api.models.self_links__links.SelfLinks__links( + self = internet_insights_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + providers = [ + null + ] + ) + else: + return ApiCatalogProviderResponse( + ) + """ + + def testApiCatalogProviderResponse(self): + """Test ApiCatalogProviderResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_catalog_provider_response_all_of_providers_inner.py b/internet_insights_api/test/test_api_catalog_provider_response_all_of_providers_inner.py new file mode 100644 index 00000000..1279f5da --- /dev/null +++ b/internet_insights_api/test/test_api_catalog_provider_response_all_of_providers_inner.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_catalog_provider_response_all_of_providers_inner import ApiCatalogProviderResponseAllOfProvidersInner + +class TestApiCatalogProviderResponseAllOfProvidersInner(unittest.TestCase): + """ApiCatalogProviderResponseAllOfProvidersInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiCatalogProviderResponseAllOfProvidersInner: + """Test ApiCatalogProviderResponseAllOfProvidersInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiCatalogProviderResponseAllOfProvidersInner` + """ + model = ApiCatalogProviderResponseAllOfProvidersInner() + if include_optional: + return ApiCatalogProviderResponseAllOfProvidersInner( + id = '85602a0a-54a7-4e97-946e-67492ef1fa26', + provider_name = 'Amazon Web Services', + provider_type = 'IAAS', + region = 'North America', + data_type = 'Application', + asns_count = 10, + countries_count = 2, + locations_count = 50, + interfaces_count = 15, + included = True, + links = internet_insights_api.models.self_links__links.SelfLinks__links( + self = internet_insights_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return ApiCatalogProviderResponseAllOfProvidersInner( + ) + """ + + def testApiCatalogProviderResponseAllOfProvidersInner(self): + """Test ApiCatalogProviderResponseAllOfProvidersInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_network_outage_affected_location.py b/internet_insights_api/test/test_api_network_outage_affected_location.py new file mode 100644 index 00000000..4426e8cc --- /dev/null +++ b/internet_insights_api/test/test_api_network_outage_affected_location.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_network_outage_affected_location import ApiNetworkOutageAffectedLocation + +class TestApiNetworkOutageAffectedLocation(unittest.TestCase): + """ApiNetworkOutageAffectedLocation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiNetworkOutageAffectedLocation: + """Test ApiNetworkOutageAffectedLocation + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiNetworkOutageAffectedLocation` + """ + model = ApiNetworkOutageAffectedLocation() + if include_optional: + return ApiNetworkOutageAffectedLocation( + location = 'Chicago, Illinois, US', + affected_interfaces = [ + '50.51.52.53' + ] + ) + else: + return ApiNetworkOutageAffectedLocation( + ) + """ + + def testApiNetworkOutageAffectedLocation(self): + """Test ApiNetworkOutageAffectedLocation""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_network_outage_details.py b/internet_insights_api/test/test_api_network_outage_details.py new file mode 100644 index 00000000..45bc517e --- /dev/null +++ b/internet_insights_api/test/test_api_network_outage_details.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_network_outage_details import ApiNetworkOutageDetails + +class TestApiNetworkOutageDetails(unittest.TestCase): + """ApiNetworkOutageDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiNetworkOutageDetails: + """Test ApiNetworkOutageDetails + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiNetworkOutageDetails` + """ + model = ApiNetworkOutageDetails() + if include_optional: + return ApiNetworkOutageDetails( + id = '8EF2760862C705783A2F8BCBAAABB44F28DBC670DBA3B610', + provider_name = 'Rackspace', + provider_type = 'IAAS', + network_name = 'Rackspace Hosting', + asn = 19994, + start_date = '2023-01-27T20:50:51.256Z', + start_round_id = 1674852600, + end_date = '2023-01-27T20:53:51.256Z', + end_round_id = 1674852600, + duration = 180, + affected_tests = [ + internet_insights_api.models.api_affected_test.ApiAffectedTest( + id = 5, + name = 'amazon-test2', ) + ], + affected_domains = [ + 'periodic-failure.com' + ], + affected_agents = [ + internet_insights_api.models.api_affected_agent.ApiAffectedAgent( + id = 11, + name = 'London, England', ) + ], + affected_locations = [ + internet_insights_api.models.api_network_outage_affected_location.ApiNetworkOutageAffectedLocation( + location = 'Chicago, Illinois, US', + affected_interfaces = [ + '50.51.52.53' + ], ) + ] + ) + else: + return ApiNetworkOutageDetails( + ) + """ + + def testApiNetworkOutageDetails(self): + """Test ApiNetworkOutageDetails""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_network_outage_response.py b/internet_insights_api/test/test_api_network_outage_response.py new file mode 100644 index 00000000..940aed09 --- /dev/null +++ b/internet_insights_api/test/test_api_network_outage_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_network_outage_response import ApiNetworkOutageResponse + +class TestApiNetworkOutageResponse(unittest.TestCase): + """ApiNetworkOutageResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiNetworkOutageResponse: + """Test ApiNetworkOutageResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiNetworkOutageResponse` + """ + model = ApiNetworkOutageResponse() + if include_optional: + return ApiNetworkOutageResponse( + id = '8EF2760862C705783A2F8BCBAAABB44F28DBC670DBA3B610', + provider_name = 'Rackspace', + provider_type = 'IAAS', + network_name = 'Rackspace Hosting', + asn = 19994, + start_date = '2023-01-27T20:50:51.256Z', + start_round_id = 1674852600, + end_date = '2023-01-27T20:53:51.256Z', + end_round_id = 1674852600, + duration = 180, + affected_tests = [ + internet_insights_api.models.api_affected_test.ApiAffectedTest( + id = 5, + name = 'amazon-test2', ) + ], + affected_domains = [ + 'periodic-failure.com' + ], + affected_agents = [ + internet_insights_api.models.api_affected_agent.ApiAffectedAgent( + id = 11, + name = 'London, England', ) + ], + affected_locations = [ + internet_insights_api.models.api_network_outage_affected_location.ApiNetworkOutageAffectedLocation( + location = 'Chicago, Illinois, US', + affected_interfaces = [ + '50.51.52.53' + ], ) + ], + links = internet_insights_api.models.self_links__links.SelfLinks__links( + self = internet_insights_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return ApiNetworkOutageResponse( + ) + """ + + def testApiNetworkOutageResponse(self): + """Test ApiNetworkOutageResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_outage.py b/internet_insights_api/test/test_api_outage.py new file mode 100644 index 00000000..5ee3adb3 --- /dev/null +++ b/internet_insights_api/test/test_api_outage.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_outage import ApiOutage + +class TestApiOutage(unittest.TestCase): + """ApiOutage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiOutage: + """Test ApiOutage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiOutage` + """ + model = ApiOutage() + if include_optional: + return ApiOutage( + id = 'xxxxxxxxxxxxxxxxxx1', + type = 'app', + provider_name = 'Google', + provider_type = 'SAAS', + name = 'Google', + start_date = '2022-03-01T23:31:11Z', + start_round_id = 1646177400, + end_date = '2022-03-01T23:31:11Z', + end_round_id = 1646177700, + duration = 214, + affected_tests_count = 1, + affected_servers_count = 2, + affected_locations_count = 1 + ) + else: + return ApiOutage( + ) + """ + + def testApiOutage(self): + """Test ApiOutage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_outage_filter.py b/internet_insights_api/test/test_api_outage_filter.py new file mode 100644 index 00000000..15624546 --- /dev/null +++ b/internet_insights_api/test/test_api_outage_filter.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_outage_filter import ApiOutageFilter + +class TestApiOutageFilter(unittest.TestCase): + """ApiOutageFilter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiOutageFilter: + """Test ApiOutageFilter + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiOutageFilter` + """ + model = ApiOutageFilter() + if include_optional: + return ApiOutageFilter( + start_date = '2022-03-01T01:30:00Z', + end_date = '2022-03-01T23:30:15Z', + window = '1d', + outage_scope = 'all', + provider_name = ["Telia","Amazon"], + application_name = ["slack","facebook"], + interface_network = [ + '' + ] + ) + else: + return ApiOutageFilter( + ) + """ + + def testApiOutageFilter(self): + """Test ApiOutageFilter""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_outages_response.py b/internet_insights_api/test/test_api_outages_response.py new file mode 100644 index 00000000..eb5c05e0 --- /dev/null +++ b/internet_insights_api/test/test_api_outages_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_outages_response import ApiOutagesResponse + +class TestApiOutagesResponse(unittest.TestCase): + """ApiOutagesResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiOutagesResponse: + """Test ApiOutagesResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiOutagesResponse` + """ + model = ApiOutagesResponse() + if include_optional: + return ApiOutagesResponse( + links = internet_insights_api.models.self_links__links.SelfLinks__links( + self = internet_insights_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + outages = [ + null + ] + ) + else: + return ApiOutagesResponse( + ) + """ + + def testApiOutagesResponse(self): + """Test ApiOutagesResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_api_outages_response_all_of_outages_inner.py b/internet_insights_api/test/test_api_outages_response_all_of_outages_inner.py new file mode 100644 index 00000000..1091eb50 --- /dev/null +++ b/internet_insights_api/test/test_api_outages_response_all_of_outages_inner.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.api_outages_response_all_of_outages_inner import ApiOutagesResponseAllOfOutagesInner + +class TestApiOutagesResponseAllOfOutagesInner(unittest.TestCase): + """ApiOutagesResponseAllOfOutagesInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiOutagesResponseAllOfOutagesInner: + """Test ApiOutagesResponseAllOfOutagesInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiOutagesResponseAllOfOutagesInner` + """ + model = ApiOutagesResponseAllOfOutagesInner() + if include_optional: + return ApiOutagesResponseAllOfOutagesInner( + id = 'xxxxxxxxxxxxxxxxxx1', + type = 'app', + provider_name = 'Google', + provider_type = 'SAAS', + name = 'Google', + start_date = '2022-03-01T23:31:11Z', + start_round_id = 1646177400, + end_date = '2022-03-01T23:31:11Z', + end_round_id = 1646177700, + duration = 214, + affected_tests_count = 1, + affected_servers_count = 2, + affected_locations_count = 1, + links = internet_insights_api.models.self_links__links.SelfLinks__links( + self = internet_insights_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return ApiOutagesResponseAllOfOutagesInner( + ) + """ + + def testApiOutagesResponseAllOfOutagesInner(self): + """Test ApiOutagesResponseAllOfOutagesInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_catalog_providers_api.py b/internet_insights_api/test/test_catalog_providers_api.py new file mode 100644 index 00000000..e5ab8ed7 --- /dev/null +++ b/internet_insights_api/test/test_catalog_providers_api.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest + +from internet_insights_api.api.catalog_providers_api import CatalogProvidersApi + + +class TestCatalogProvidersApi(unittest.TestCase): + """CatalogProvidersApi unit test stubs""" + + def setUp(self) -> None: + self.api = CatalogProvidersApi() + + def tearDown(self) -> None: + pass + + def test_catalog_provider_list(self) -> None: + """Test case for catalog_provider_list + + List catalog providers + """ + pass + + def test_get_catalog_provider(self) -> None: + """Test case for get_catalog_provider + + Retrieve a catalog provider + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_error.py b/internet_insights_api/test/test_error.py new file mode 100644 index 00000000..baa0a45d --- /dev/null +++ b/internet_insights_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_link.py b/internet_insights_api/test/test_link.py new file mode 100644 index 00000000..ebaece3b --- /dev/null +++ b/internet_insights_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_outage_scope.py b/internet_insights_api/test/test_outage_scope.py new file mode 100644 index 00000000..91086a45 --- /dev/null +++ b/internet_insights_api/test/test_outage_scope.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.outage_scope import OutageScope + +class TestOutageScope(unittest.TestCase): + """OutageScope unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOutageScope(self): + """Test OutageScope""" + # inst = OutageScope() + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_outages_api_public_api.py b/internet_insights_api/test/test_outages_api_public_api.py new file mode 100644 index 00000000..83767ec0 --- /dev/null +++ b/internet_insights_api/test/test_outages_api_public_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest + +from internet_insights_api.api.outages_api_public_api import OutagesAPIPublicApi + + +class TestOutagesAPIPublicApi(unittest.TestCase): + """OutagesAPIPublicApi unit test stubs""" + + def setUp(self) -> None: + self.api = OutagesAPIPublicApi() + + def tearDown(self) -> None: + pass + + def test_get_outages_app(self) -> None: + """Test case for get_outages_app + + Retrieve application outage + """ + pass + + def test_get_outages_filter(self) -> None: + """Test case for get_outages_filter + + List network and application outages + """ + pass + + def test_get_outages_net(self) -> None: + """Test case for get_outages_net + + Retrieve network outage + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_self_links.py b/internet_insights_api/test/test_self_links.py new file mode 100644 index 00000000..badbe6a2 --- /dev/null +++ b/internet_insights_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = internet_insights_api.models.self_links__links.SelfLinks__links( + self = internet_insights_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_self_links_links.py b/internet_insights_api/test/test_self_links_links.py new file mode 100644 index 00000000..07d4ee40 --- /dev/null +++ b/internet_insights_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = internet_insights_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/test/test_unauthorized_error.py b/internet_insights_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..1bff4ead --- /dev/null +++ b/internet_insights_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Internet Insights API + + # Overview We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including: ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include: Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. + + 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 unittest +import datetime + +from internet_insights_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/internet_insights_api/tox.ini b/internet_insights_api/tox.ini new file mode 100644 index 00000000..0c0e34c8 --- /dev/null +++ b/internet_insights_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=internet_insights_api diff --git a/labels_api/.github/workflows/python.yml b/labels_api/.github/workflows/python.yml new file mode 100644 index 00000000..20120cac --- /dev/null +++ b/labels_api/.github/workflows/python.yml @@ -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: labels_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 diff --git a/labels_api/.gitignore b/labels_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/labels_api/.gitignore @@ -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 diff --git a/labels_api/.gitlab-ci.yml b/labels_api/.gitlab-ci.yml new file mode 100644 index 00000000..bd6c155d --- /dev/null +++ b/labels_api/.gitlab-ci.yml @@ -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=labels_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 diff --git a/labels_api/.openapi-generator-ignore b/labels_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/labels_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/labels_api/.openapi-generator/FILES b/labels_api/.openapi-generator/FILES new file mode 100644 index 00000000..c6f78686 --- /dev/null +++ b/labels_api/.openapi-generator/FILES @@ -0,0 +1,74 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/AgentApi.md +docs/AllLabelsApi.md +docs/CreateAgentLabel201Response.md +docs/DashboardApi.md +docs/EndpointTestApi.md +docs/Error.md +docs/GetLabels200Response.md +docs/Label.md +docs/LabelDetail.md +docs/LabelRequest.md +docs/LabelType.md +docs/Labels.md +docs/Link.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/TestApi.md +docs/UnauthorizedError.md +git_push.sh +labels_api/__init__.py +labels_api/api/__init__.py +labels_api/api/agent_api.py +labels_api/api/all_labels_api.py +labels_api/api/dashboard_api.py +labels_api/api/endpoint_test_api.py +labels_api/api/test_api.py +labels_api/api_client.py +labels_api/api_response.py +labels_api/configuration.py +labels_api/exceptions.py +labels_api/models/__init__.py +labels_api/models/create_agent_label201_response.py +labels_api/models/error.py +labels_api/models/get_labels200_response.py +labels_api/models/label.py +labels_api/models/label_detail.py +labels_api/models/label_request.py +labels_api/models/label_type.py +labels_api/models/labels.py +labels_api/models/link.py +labels_api/models/self_links.py +labels_api/models/self_links_links.py +labels_api/models/unauthorized_error.py +labels_api/py.typed +labels_api/rest.py +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_agent_api.py +test/test_all_labels_api.py +test/test_create_agent_label201_response.py +test/test_dashboard_api.py +test/test_endpoint_test_api.py +test/test_error.py +test/test_get_labels200_response.py +test/test_label.py +test/test_label_detail.py +test/test_label_request.py +test/test_label_type.py +test/test_labels.py +test/test_link.py +test/test_self_links.py +test/test_self_links_links.py +test/test_test_api.py +test/test_unauthorized_error.py +tox.ini diff --git a/labels_api/.openapi-generator/VERSION b/labels_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/labels_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/labels_api/.travis.yml b/labels_api/.travis.yml new file mode 100644 index 00000000..d7ebb0c5 --- /dev/null +++ b/labels_api/.travis.yml @@ -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=labels_api diff --git a/labels_api/README.md b/labels_api/README.md new file mode 100644 index 00000000..98d47baf --- /dev/null +++ b/labels_api/README.md @@ -0,0 +1,149 @@ +# labels-api +### Overview +This is API for the Labels API (formerly called groups). + +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 labels_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 labels_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 labels_api +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.AgentApi(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) + label_request = labels_api.LabelRequest() # LabelRequest | Label resource (optional) + + try: + # Create a Label of type `agent` + api_response = api_instance.create_agent_label(aid=aid, label_request=label_request) + print("The response of AgentApi->create_agent_label:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling AgentApi->create_agent_label: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AgentApi* | [**create_agent_label**](docs/AgentApi.md#create_agent_label) | **POST** /v7/labels/agent | Create a Label of type `agent` +*AgentApi* | [**delete_agent_label**](docs/AgentApi.md#delete_agent_label) | **DELETE** /v7/labels/agent/{labelId} | Delete a Label object of type `agent` +*AgentApi* | [**get_agent_label**](docs/AgentApi.md#get_agent_label) | **GET** /v7/labels/agent/{labelId} | Get a Label object of type `agent` +*AgentApi* | [**update_agent_label**](docs/AgentApi.md#update_agent_label) | **PUT** /v7/labels/agent/{labelId} | Update a Label object of type `agent` +*AllLabelsApi* | [**get_labels**](docs/AllLabelsApi.md#get_labels) | **GET** /v7/labels | Get list of Labels +*DashboardApi* | [**create_dashboard_label**](docs/DashboardApi.md#create_dashboard_label) | **POST** /v7/labels/dashboard | Create a Label of type `dashboard` +*DashboardApi* | [**delete_dashboard_label**](docs/DashboardApi.md#delete_dashboard_label) | **DELETE** /v7/labels/dashboard/{labelId} | Delete a Label object of type `dashboard` +*DashboardApi* | [**get_dashboard_label**](docs/DashboardApi.md#get_dashboard_label) | **GET** /v7/labels/dashboard/{labelId} | Get a Label object of type `dashboard` +*DashboardApi* | [**update_dashboard_label**](docs/DashboardApi.md#update_dashboard_label) | **PUT** /v7/labels/dashboard/{labelId} | Update a Label object of type `dashboard` +*EndpointTestApi* | [**create_endpoint_tests_label**](docs/EndpointTestApi.md#create_endpoint_tests_label) | **POST** /v7/labels/endpoint-test | Create a Label of type `endpoint-test` +*EndpointTestApi* | [**delete_endpoint_test_label**](docs/EndpointTestApi.md#delete_endpoint_test_label) | **DELETE** /v7/labels/endpoint-test/{labelId} | Delete a Label object of type `endpoint-test` +*EndpointTestApi* | [**get_endpoint_test_label**](docs/EndpointTestApi.md#get_endpoint_test_label) | **GET** /v7/labels/endpoint-test/{labelId} | Get a Label object of type `endpoint-test` +*EndpointTestApi* | [**update_endpoint_test_label**](docs/EndpointTestApi.md#update_endpoint_test_label) | **PUT** /v7/labels/endpoint-test/{labelId} | Update a Label object of type `endpoint-test` +*TestApi* | [**create_test_label**](docs/TestApi.md#create_test_label) | **POST** /v7/labels/test | Create a Label of type `test` +*TestApi* | [**delete_test_label**](docs/TestApi.md#delete_test_label) | **DELETE** /v7/labels/test/{labelId} | Delete a Label object of type `test` +*TestApi* | [**get_test_label**](docs/TestApi.md#get_test_label) | **GET** /v7/labels/test/{labelId} | Get a Label object of type `test` +*TestApi* | [**update_test_label**](docs/TestApi.md#update_test_label) | **PUT** /v7/labels/test/{labelId} | Update a Label object of type `test` + + +## Documentation For Models + + - [CreateAgentLabel201Response](docs/CreateAgentLabel201Response.md) + - [Error](docs/Error.md) + - [GetLabels200Response](docs/GetLabels200Response.md) + - [Label](docs/Label.md) + - [LabelDetail](docs/LabelDetail.md) + - [LabelRequest](docs/LabelRequest.md) + - [LabelType](docs/LabelType.md) + - [Labels](docs/Labels.md) + - [Link](docs/Link.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/labels_api/docs/AgentApi.md b/labels_api/docs/AgentApi.md new file mode 100644 index 00000000..1f7186eb --- /dev/null +++ b/labels_api/docs/AgentApi.md @@ -0,0 +1,347 @@ +# labels_api.AgentApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_agent_label**](AgentApi.md#create_agent_label) | **POST** /v7/labels/agent | Create a Label of type `agent` +[**delete_agent_label**](AgentApi.md#delete_agent_label) | **DELETE** /v7/labels/agent/{labelId} | Delete a Label object of type `agent` +[**get_agent_label**](AgentApi.md#get_agent_label) | **GET** /v7/labels/agent/{labelId} | Get a Label object of type `agent` +[**update_agent_label**](AgentApi.md#update_agent_label) | **PUT** /v7/labels/agent/{labelId} | Update a Label object of type `agent` + + +# **create_agent_label** +> CreateAgentLabel201Response create_agent_label(aid=aid, label_request=label_request) + +Create a Label of type `agent` + +Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning `agent` or `test`, the user needs permission to modify the objects being added. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.label_request import LabelRequest +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.AgentApi(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) + label_request = labels_api.LabelRequest() # LabelRequest | Label resource (optional) + + try: + # Create a Label of type `agent` + api_response = api_instance.create_agent_label(aid=aid, label_request=label_request) + print("The response of AgentApi->create_agent_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentApi->create_agent_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **label_request** | [**LabelRequest**](LabelRequest.md)| Label resource | [optional] + +### Return type + +[**CreateAgentLabel201Response**](CreateAgentLabel201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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 | - | + +[[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) + +# **delete_agent_label** +> delete_agent_label(label_id, aid=aid) + +Delete a Label object of type `agent` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.AgentApi(api_client) + label_id = '961' # str | ID of the label to get + 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 a Label object of type `agent` + api_instance.delete_agent_label(label_id, aid=aid) + except Exception as e: + print("Exception when calling AgentApi->delete_agent_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **str**| ID of the label to get | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | - | +**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 | - | + +[[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_label** +> CreateAgentLabel201Response get_agent_label(label_id, aid=aid) + +Get a Label object of type `agent` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.AgentApi(api_client) + label_id = '961' # str | ID of the label to get + 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: + # Get a Label object of type `agent` + api_response = api_instance.get_agent_label(label_id, aid=aid) + print("The response of AgentApi->get_agent_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentApi->get_agent_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **str**| ID of the label to get | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**CreateAgentLabel201Response**](CreateAgentLabel201Response.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 | - | +**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 | - | + +[[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_agent_label** +> CreateAgentLabel201Response update_agent_label(label_id, aid=aid, label_request=label_request) + +Update a Label object of type `agent` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.label_request import LabelRequest +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.AgentApi(api_client) + label_id = '961' # str | ID of the label to get + 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) + label_request = labels_api.LabelRequest() # LabelRequest | (optional) + + try: + # Update a Label object of type `agent` + api_response = api_instance.update_agent_label(label_id, aid=aid, label_request=label_request) + print("The response of AgentApi->update_agent_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentApi->update_agent_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **str**| ID of the label to get | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **label_request** | [**LabelRequest**](LabelRequest.md)| | [optional] + +### Return type + +[**CreateAgentLabel201Response**](CreateAgentLabel201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/labels_api/docs/AllLabelsApi.md b/labels_api/docs/AllLabelsApi.md new file mode 100644 index 00000000..7f63302f --- /dev/null +++ b/labels_api/docs/AllLabelsApi.md @@ -0,0 +1,92 @@ +# labels_api.AllLabelsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_labels**](AllLabelsApi.md#get_labels) | **GET** /v7/labels | Get list of Labels + + +# **get_labels** +> GetLabels200Response get_labels(aid=aid) + +Get list of Labels + +Returns a list of all labels (formerly called groups) configured in ThousandEyes. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.get_labels200_response import GetLabels200Response +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.AllLabelsApi(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: + # Get list of Labels + api_response = api_instance.get_labels(aid=aid) + print("The response of AllLabelsApi->get_labels:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AllLabelsApi->get_labels: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetLabels200Response**](GetLabels200Response.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 | - | +**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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/labels_api/docs/CreateAgentLabel201Response.md b/labels_api/docs/CreateAgentLabel201Response.md new file mode 100644 index 00000000..43103125 --- /dev/null +++ b/labels_api/docs/CreateAgentLabel201Response.md @@ -0,0 +1,33 @@ +# CreateAgentLabel201Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label_id** | **str** | Unique ID of the label; this number is negative for built-in labels. Query `/v7/labels/{type}/{id}` endpoint to see the list of agent/test/dashboard ids with this label. | [optional] +**is_built_in** | **bool** | `true` for built-in labels, and `false` for user-created labels. Note that built-in labels are read-only. | [optional] +**name** | **str** | The name of the new label - this must be unique. | [optional] +**type** | [**LabelType**](LabelType.md) | | [optional] +**ids** | **List[str]** | Array of agent/test/dashboard IDs the label is assigned to, depending on the type of label. | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateAgentLabel201Response from a JSON string +create_agent_label201_response_instance = CreateAgentLabel201Response.from_json(json) +# print the JSON string representation of the object +print CreateAgentLabel201Response.to_json() + +# convert the object into a dict +create_agent_label201_response_dict = create_agent_label201_response_instance.to_dict() +# create an instance of CreateAgentLabel201Response from a dict +create_agent_label201_response_form_dict = create_agent_label201_response.from_dict(create_agent_label201_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/labels_api/docs/DashboardApi.md b/labels_api/docs/DashboardApi.md new file mode 100644 index 00000000..24420f5d --- /dev/null +++ b/labels_api/docs/DashboardApi.md @@ -0,0 +1,347 @@ +# labels_api.DashboardApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_dashboard_label**](DashboardApi.md#create_dashboard_label) | **POST** /v7/labels/dashboard | Create a Label of type `dashboard` +[**delete_dashboard_label**](DashboardApi.md#delete_dashboard_label) | **DELETE** /v7/labels/dashboard/{labelId} | Delete a Label object of type `dashboard` +[**get_dashboard_label**](DashboardApi.md#get_dashboard_label) | **GET** /v7/labels/dashboard/{labelId} | Get a Label object of type `dashboard` +[**update_dashboard_label**](DashboardApi.md#update_dashboard_label) | **PUT** /v7/labels/dashboard/{labelId} | Update a Label object of type `dashboard` + + +# **create_dashboard_label** +> CreateAgentLabel201Response create_dashboard_label(aid=aid, label_request=label_request) + +Create a Label of type `dashboard` + +Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning agents or tests, the user needs permission to modify the objects being added. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.label_request import LabelRequest +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.DashboardApi(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) + label_request = labels_api.LabelRequest() # LabelRequest | Label resource (optional) + + try: + # Create a Label of type `dashboard` + api_response = api_instance.create_dashboard_label(aid=aid, label_request=label_request) + print("The response of DashboardApi->create_dashboard_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DashboardApi->create_dashboard_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **label_request** | [**LabelRequest**](LabelRequest.md)| Label resource | [optional] + +### Return type + +[**CreateAgentLabel201Response**](CreateAgentLabel201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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 | - | + +[[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) + +# **delete_dashboard_label** +> delete_dashboard_label(label_id, aid=aid) + +Delete a Label object of type `dashboard` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.DashboardApi(api_client) + label_id = '961' # str | ID of the label to get + 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 a Label object of type `dashboard` + api_instance.delete_dashboard_label(label_id, aid=aid) + except Exception as e: + print("Exception when calling DashboardApi->delete_dashboard_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **str**| ID of the label to get | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | - | +**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 | - | + +[[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_dashboard_label** +> CreateAgentLabel201Response get_dashboard_label(label_id, aid=aid) + +Get a Label object of type `dashboard` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.DashboardApi(api_client) + label_id = '961' # str | ID of the label to get + 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: + # Get a Label object of type `dashboard` + api_response = api_instance.get_dashboard_label(label_id, aid=aid) + print("The response of DashboardApi->get_dashboard_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DashboardApi->get_dashboard_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **str**| ID of the label to get | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**CreateAgentLabel201Response**](CreateAgentLabel201Response.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 | - | +**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 | - | + +[[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_dashboard_label** +> CreateAgentLabel201Response update_dashboard_label(label_id, aid=aid, label_request=label_request) + +Update a Label object of type `dashboard` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.label_request import LabelRequest +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.DashboardApi(api_client) + label_id = '961' # str | ID of the label to get + 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) + label_request = labels_api.LabelRequest() # LabelRequest | (optional) + + try: + # Update a Label object of type `dashboard` + api_response = api_instance.update_dashboard_label(label_id, aid=aid, label_request=label_request) + print("The response of DashboardApi->update_dashboard_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DashboardApi->update_dashboard_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **str**| ID of the label to get | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **label_request** | [**LabelRequest**](LabelRequest.md)| | [optional] + +### Return type + +[**CreateAgentLabel201Response**](CreateAgentLabel201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/labels_api/docs/EndpointTestApi.md b/labels_api/docs/EndpointTestApi.md new file mode 100644 index 00000000..18a4bdca --- /dev/null +++ b/labels_api/docs/EndpointTestApi.md @@ -0,0 +1,347 @@ +# labels_api.EndpointTestApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_endpoint_tests_label**](EndpointTestApi.md#create_endpoint_tests_label) | **POST** /v7/labels/endpoint-test | Create a Label of type `endpoint-test` +[**delete_endpoint_test_label**](EndpointTestApi.md#delete_endpoint_test_label) | **DELETE** /v7/labels/endpoint-test/{labelId} | Delete a Label object of type `endpoint-test` +[**get_endpoint_test_label**](EndpointTestApi.md#get_endpoint_test_label) | **GET** /v7/labels/endpoint-test/{labelId} | Get a Label object of type `endpoint-test` +[**update_endpoint_test_label**](EndpointTestApi.md#update_endpoint_test_label) | **PUT** /v7/labels/endpoint-test/{labelId} | Update a Label object of type `endpoint-test` + + +# **create_endpoint_tests_label** +> CreateAgentLabel201Response create_endpoint_tests_label(aid=aid, label_request=label_request) + +Create a Label of type `endpoint-test` + +Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning agents or tests, the user needs permission to modify the objects being added. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.label_request import LabelRequest +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.EndpointTestApi(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) + label_request = labels_api.LabelRequest() # LabelRequest | Label resource (optional) + + try: + # Create a Label of type `endpoint-test` + api_response = api_instance.create_endpoint_tests_label(aid=aid, label_request=label_request) + print("The response of EndpointTestApi->create_endpoint_tests_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointTestApi->create_endpoint_tests_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **label_request** | [**LabelRequest**](LabelRequest.md)| Label resource | [optional] + +### Return type + +[**CreateAgentLabel201Response**](CreateAgentLabel201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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 | - | + +[[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) + +# **delete_endpoint_test_label** +> delete_endpoint_test_label(label_id, aid=aid) + +Delete a Label object of type `endpoint-test` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.EndpointTestApi(api_client) + label_id = '961' # str | ID of the label to get + 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 a Label object of type `endpoint-test` + api_instance.delete_endpoint_test_label(label_id, aid=aid) + except Exception as e: + print("Exception when calling EndpointTestApi->delete_endpoint_test_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **str**| ID of the label to get | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | - | +**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 | - | + +[[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_endpoint_test_label** +> CreateAgentLabel201Response get_endpoint_test_label(label_id, aid=aid) + +Get a Label object of type `endpoint-test` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.EndpointTestApi(api_client) + label_id = '961' # str | ID of the label to get + 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: + # Get a Label object of type `endpoint-test` + api_response = api_instance.get_endpoint_test_label(label_id, aid=aid) + print("The response of EndpointTestApi->get_endpoint_test_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointTestApi->get_endpoint_test_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **str**| ID of the label to get | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**CreateAgentLabel201Response**](CreateAgentLabel201Response.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 | - | +**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 | - | + +[[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_endpoint_test_label** +> CreateAgentLabel201Response update_endpoint_test_label(label_id, aid=aid, label_request=label_request) + +Update a Label object of type `endpoint-test` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.label_request import LabelRequest +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.EndpointTestApi(api_client) + label_id = '961' # str | ID of the label to get + 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) + label_request = labels_api.LabelRequest() # LabelRequest | (optional) + + try: + # Update a Label object of type `endpoint-test` + api_response = api_instance.update_endpoint_test_label(label_id, aid=aid, label_request=label_request) + print("The response of EndpointTestApi->update_endpoint_test_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointTestApi->update_endpoint_test_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **str**| ID of the label to get | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **label_request** | [**LabelRequest**](LabelRequest.md)| | [optional] + +### Return type + +[**CreateAgentLabel201Response**](CreateAgentLabel201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/labels_api/docs/Error.md b/labels_api/docs/Error.md new file mode 100644 index 00000000..64391133 --- /dev/null +++ b/labels_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from labels_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/labels_api/docs/GetLabels200Response.md b/labels_api/docs/GetLabels200Response.md new file mode 100644 index 00000000..6517f95c --- /dev/null +++ b/labels_api/docs/GetLabels200Response.md @@ -0,0 +1,29 @@ +# GetLabels200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**labels** | [**List[Label]**](Label.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from labels_api.models.get_labels200_response import GetLabels200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetLabels200Response from a JSON string +get_labels200_response_instance = GetLabels200Response.from_json(json) +# print the JSON string representation of the object +print GetLabels200Response.to_json() + +# convert the object into a dict +get_labels200_response_dict = get_labels200_response_instance.to_dict() +# create an instance of GetLabels200Response from a dict +get_labels200_response_form_dict = get_labels200_response.from_dict(get_labels200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/labels_api/docs/Label.md b/labels_api/docs/Label.md new file mode 100644 index 00000000..841a1132 --- /dev/null +++ b/labels_api/docs/Label.md @@ -0,0 +1,31 @@ +# Label + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label_id** | **str** | Unique ID of the label; this number is negative for built-in labels. Query `/v7/labels/{type}/{id}` endpoint to see the list of agent/test/dashboard ids with this label. | [optional] +**is_built_in** | **bool** | `true` for built-in labels, and `false` for user-created labels. Note that built-in labels are read-only. | [optional] +**name** | **str** | The name of the new label - this must be unique. | [optional] +**type** | [**LabelType**](LabelType.md) | | [optional] + +## Example + +```python +from labels_api.models.label import Label + +# TODO update the JSON string below +json = "{}" +# create an instance of Label from a JSON string +label_instance = Label.from_json(json) +# print the JSON string representation of the object +print Label.to_json() + +# convert the object into a dict +label_dict = label_instance.to_dict() +# create an instance of Label from a dict +label_form_dict = label.from_dict(label_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/labels_api/docs/LabelDetail.md b/labels_api/docs/LabelDetail.md new file mode 100644 index 00000000..eb99f0ca --- /dev/null +++ b/labels_api/docs/LabelDetail.md @@ -0,0 +1,32 @@ +# LabelDetail + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label_id** | **str** | Unique ID of the label; this number is negative for built-in labels. Query `/v7/labels/{type}/{id}` endpoint to see the list of agent/test/dashboard ids with this label. | [optional] +**is_built_in** | **bool** | `true` for built-in labels, and `false` for user-created labels. Note that built-in labels are read-only. | [optional] +**name** | **str** | The name of the new label - this must be unique. | [optional] +**type** | [**LabelType**](LabelType.md) | | [optional] +**ids** | **List[str]** | Array of agent/test/dashboard IDs the label is assigned to, depending on the type of label. | [optional] + +## Example + +```python +from labels_api.models.label_detail import LabelDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of LabelDetail from a JSON string +label_detail_instance = LabelDetail.from_json(json) +# print the JSON string representation of the object +print LabelDetail.to_json() + +# convert the object into a dict +label_detail_dict = label_detail_instance.to_dict() +# create an instance of LabelDetail from a dict +label_detail_form_dict = label_detail.from_dict(label_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/labels_api/docs/LabelRequest.md b/labels_api/docs/LabelRequest.md new file mode 100644 index 00000000..d12f151c --- /dev/null +++ b/labels_api/docs/LabelRequest.md @@ -0,0 +1,29 @@ +# LabelRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the new label - this must be unique. | [optional] +**ids** | **List[str]** | Array of agent/test/dashboard ids the label should be assigned to, depending on the type of label | [optional] + +## Example + +```python +from labels_api.models.label_request import LabelRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of LabelRequest from a JSON string +label_request_instance = LabelRequest.from_json(json) +# print the JSON string representation of the object +print LabelRequest.to_json() + +# convert the object into a dict +label_request_dict = label_request_instance.to_dict() +# create an instance of LabelRequest from a dict +label_request_form_dict = label_request.from_dict(label_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) + + diff --git a/labels_api/docs/LabelType.md b/labels_api/docs/LabelType.md new file mode 100644 index 00000000..a4da61dc --- /dev/null +++ b/labels_api/docs/LabelType.md @@ -0,0 +1,11 @@ +# LabelType + +Either `test`, `agent`, `endpoint-test`, `endpoint-agent` or `dashboard`, indicates the type of label. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/labels_api/docs/Labels.md b/labels_api/docs/Labels.md new file mode 100644 index 00000000..3c353ec4 --- /dev/null +++ b/labels_api/docs/Labels.md @@ -0,0 +1,28 @@ +# Labels + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**labels** | [**List[Label]**](Label.md) | | [optional] + +## Example + +```python +from labels_api.models.labels import Labels + +# TODO update the JSON string below +json = "{}" +# create an instance of Labels from a JSON string +labels_instance = Labels.from_json(json) +# print the JSON string representation of the object +print Labels.to_json() + +# convert the object into a dict +labels_dict = labels_instance.to_dict() +# create an instance of Labels from a dict +labels_form_dict = labels.from_dict(labels_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/labels_api/docs/Link.md b/labels_api/docs/Link.md new file mode 100644 index 00000000..ab89c4f1 --- /dev/null +++ b/labels_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from labels_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/labels_api/docs/SelfLinks.md b/labels_api/docs/SelfLinks.md new file mode 100644 index 00000000..bccde48b --- /dev/null +++ b/labels_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from labels_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/labels_api/docs/SelfLinksLinks.md b/labels_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..99a51f81 --- /dev/null +++ b/labels_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from labels_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/labels_api/docs/TestApi.md b/labels_api/docs/TestApi.md new file mode 100644 index 00000000..b9f4c230 --- /dev/null +++ b/labels_api/docs/TestApi.md @@ -0,0 +1,347 @@ +# labels_api.TestApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_test_label**](TestApi.md#create_test_label) | **POST** /v7/labels/test | Create a Label of type `test` +[**delete_test_label**](TestApi.md#delete_test_label) | **DELETE** /v7/labels/test/{labelId} | Delete a Label object of type `test` +[**get_test_label**](TestApi.md#get_test_label) | **GET** /v7/labels/test/{labelId} | Get a Label object of type `test` +[**update_test_label**](TestApi.md#update_test_label) | **PUT** /v7/labels/test/{labelId} | Update a Label object of type `test` + + +# **create_test_label** +> CreateAgentLabel201Response create_test_label(aid=aid, label_request=label_request) + +Create a Label of type `test` + +Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning `agent` or `test`, the user needs permission to modify the objects being added. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.label_request import LabelRequest +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.TestApi(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) + label_request = labels_api.LabelRequest() # LabelRequest | Label resource (optional) + + try: + # Create a Label of type `test` + api_response = api_instance.create_test_label(aid=aid, label_request=label_request) + print("The response of TestApi->create_test_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TestApi->create_test_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **label_request** | [**LabelRequest**](LabelRequest.md)| Label resource | [optional] + +### Return type + +[**CreateAgentLabel201Response**](CreateAgentLabel201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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 | - | + +[[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) + +# **delete_test_label** +> delete_test_label(label_id, aid=aid) + +Delete a Label object of type `test` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.TestApi(api_client) + label_id = '961' # str | ID of the label to get + 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 a Label object of type `test` + api_instance.delete_test_label(label_id, aid=aid) + except Exception as e: + print("Exception when calling TestApi->delete_test_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **str**| ID of the label to get | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | - | +**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 | - | + +[[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_test_label** +> CreateAgentLabel201Response get_test_label(label_id, aid=aid) + +Get a Label object of type `test` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.TestApi(api_client) + label_id = '961' # str | ID of the label to get + 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: + # Get a Label object of type `test` + api_response = api_instance.get_test_label(label_id, aid=aid) + print("The response of TestApi->get_test_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TestApi->get_test_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **str**| ID of the label to get | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**CreateAgentLabel201Response**](CreateAgentLabel201Response.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 | - | +**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 | - | + +[[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_test_label** +> CreateAgentLabel201Response update_test_label(label_id, aid=aid, label_request=label_request) + +Update a Label object of type `test` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import labels_api +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.label_request import LabelRequest +from labels_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 = labels_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 = labels_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with labels_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labels_api.TestApi(api_client) + label_id = '961' # str | ID of the label to get + 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) + label_request = labels_api.LabelRequest() # LabelRequest | (optional) + + try: + # Update a Label object of type `test` + api_response = api_instance.update_test_label(label_id, aid=aid, label_request=label_request) + print("The response of TestApi->update_test_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TestApi->update_test_label: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **str**| ID of the label to get | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **label_request** | [**LabelRequest**](LabelRequest.md)| | [optional] + +### Return type + +[**CreateAgentLabel201Response**](CreateAgentLabel201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/labels_api/docs/UnauthorizedError.md b/labels_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..77e1e6d9 --- /dev/null +++ b/labels_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from labels_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/labels_api/git_push.sh b/labels_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/labels_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/labels_api/labels_api/__init__.py b/labels_api/labels_api/__init__.py new file mode 100644 index 00000000..5fe4802e --- /dev/null +++ b/labels_api/labels_api/__init__.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_api.api.agent_api import AgentApi +from labels_api.api.all_labels_api import AllLabelsApi +from labels_api.api.dashboard_api import DashboardApi +from labels_api.api.endpoint_test_api import EndpointTestApi +from labels_api.api.test_api import TestApi + +# import ApiClient +from labels_api.api_response import ApiResponse +from labels_api.api_client import ApiClient +from labels_api.configuration import Configuration +from labels_api.exceptions import OpenApiException +from labels_api.exceptions import ApiTypeError +from labels_api.exceptions import ApiValueError +from labels_api.exceptions import ApiKeyError +from labels_api.exceptions import ApiAttributeError +from labels_api.exceptions import ApiException + +# import models into sdk package +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.error import Error +from labels_api.models.get_labels200_response import GetLabels200Response +from labels_api.models.label import Label +from labels_api.models.label_detail import LabelDetail +from labels_api.models.label_request import LabelRequest +from labels_api.models.label_type import LabelType +from labels_api.models.labels import Labels +from labels_api.models.link import Link +from labels_api.models.self_links import SelfLinks +from labels_api.models.self_links_links import SelfLinksLinks +from labels_api.models.unauthorized_error import UnauthorizedError diff --git a/labels_api/labels_api/api/__init__.py b/labels_api/labels_api/api/__init__.py new file mode 100644 index 00000000..d3cef85e --- /dev/null +++ b/labels_api/labels_api/api/__init__.py @@ -0,0 +1,9 @@ +# flake8: noqa + +# import apis into api package +from labels_api.api.agent_api import AgentApi +from labels_api.api.all_labels_api import AllLabelsApi +from labels_api.api.dashboard_api import DashboardApi +from labels_api.api.endpoint_test_api import EndpointTestApi +from labels_api.api.test_api import TestApi + diff --git a/labels_api/labels_api/api/agent_api.py b/labels_api/labels_api/api/agent_api.py new file mode 100644 index 00000000..5e2df234 --- /dev/null +++ b/labels_api/labels_api/api/agent_api.py @@ -0,0 +1,1253 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.label_request import LabelRequest + +from labels_api.api_client import ApiClient +from labels_api.api_response import ApiResponse +from labels_api.rest import RESTResponseType + + +class AgentApi: + """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 create_agent_label( + 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, + label_request: Annotated[Optional[LabelRequest], Field(description="Label resource")] = 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, + ) -> CreateAgentLabel201Response: + """Create a Label of type `agent` + + Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning `agent` or `test`, the user needs permission to modify the objects being added. + + :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 label_request: Label resource + :type label_request: LabelRequest + :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._create_agent_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_agent_label_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, + label_request: Annotated[Optional[LabelRequest], Field(description="Label resource")] = 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[CreateAgentLabel201Response]: + """Create a Label of type `agent` + + Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning `agent` or `test`, the user needs permission to modify the objects being added. + + :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 label_request: Label resource + :type label_request: LabelRequest + :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._create_agent_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_agent_label_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, + label_request: Annotated[Optional[LabelRequest], Field(description="Label resource")] = 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: + """Create a Label of type `agent` + + Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning `agent` or `test`, the user needs permission to modify the objects being added. + + :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 label_request: Label resource + :type label_request: LabelRequest + :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._create_agent_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_agent_label_serialize( + self, + aid, + label_request, + _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 + if label_request is not None: + _body_params = label_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/labels/agent', + 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 delete_agent_label( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + ) -> None: + """Delete a Label object of type `agent` + + + :param label_id: ID of the label to get (required) + :type label_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._delete_agent_label_serialize( + label_id=label_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_agent_label_with_http_info( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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[None]: + """Delete a Label object of type `agent` + + + :param label_id: ID of the label to get (required) + :type label_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._delete_agent_label_serialize( + label_id=label_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_agent_label_without_preload_content( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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: + """Delete a Label object of type `agent` + + + :param label_id: ID of the label to get (required) + :type label_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._delete_agent_label_serialize( + label_id=label_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_agent_label_serialize( + self, + label_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 label_id is not None: + _path_params['labelId'] = label_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/labels/agent/{labelId}', + 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_agent_label( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + ) -> CreateAgentLabel201Response: + """Get a Label object of type `agent` + + + :param label_id: ID of the label to get (required) + :type label_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_agent_label_serialize( + label_id=label_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': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_label_with_http_info( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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[CreateAgentLabel201Response]: + """Get a Label object of type `agent` + + + :param label_id: ID of the label to get (required) + :type label_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_agent_label_serialize( + label_id=label_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': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_label_without_preload_content( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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: + """Get a Label object of type `agent` + + + :param label_id: ID of the label to get (required) + :type label_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_agent_label_serialize( + label_id=label_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': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_label_serialize( + self, + label_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 label_id is not None: + _path_params['labelId'] = label_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/labels/agent/{labelId}', + 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 update_agent_label( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + label_request: Optional[LabelRequest] = 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, + ) -> CreateAgentLabel201Response: + """Update a Label object of type `agent` + + + :param label_id: ID of the label to get (required) + :type label_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 label_request: + :type label_request: LabelRequest + :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._update_agent_label_serialize( + label_id=label_id, + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_agent_label_with_http_info( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + label_request: Optional[LabelRequest] = 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[CreateAgentLabel201Response]: + """Update a Label object of type `agent` + + + :param label_id: ID of the label to get (required) + :type label_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 label_request: + :type label_request: LabelRequest + :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._update_agent_label_serialize( + label_id=label_id, + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_agent_label_without_preload_content( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + label_request: Optional[LabelRequest] = 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: + """Update a Label object of type `agent` + + + :param label_id: ID of the label to get (required) + :type label_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 label_request: + :type label_request: LabelRequest + :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._update_agent_label_serialize( + label_id=label_id, + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_agent_label_serialize( + self, + label_id, + aid, + label_request, + _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 label_id is not None: + _path_params['labelId'] = label_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 + if label_request is not None: + _body_params = label_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='PUT', + resource_path='/v7/labels/agent/{labelId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/labels_api/labels_api/api/all_labels_api.py b/labels_api/labels_api/api/all_labels_api.py new file mode 100644 index 00000000..4f2edd8d --- /dev/null +++ b/labels_api/labels_api/api/all_labels_api.py @@ -0,0 +1,332 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_api.models.get_labels200_response import GetLabels200Response + +from labels_api.api_client import ApiClient +from labels_api.api_response import ApiResponse +from labels_api.rest import RESTResponseType + + +class AllLabelsApi: + """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_labels( + 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, + ) -> GetLabels200Response: + """Get list of Labels + + Returns a list of all labels (formerly called groups) configured in ThousandEyes. + + :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_labels_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': "GetLabels200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_labels_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[GetLabels200Response]: + """Get list of Labels + + Returns a list of all labels (formerly called groups) configured in ThousandEyes. + + :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_labels_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': "GetLabels200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_labels_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: + """Get list of Labels + + Returns a list of all labels (formerly called groups) configured in ThousandEyes. + + :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_labels_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': "GetLabels200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_labels_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/labels', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/labels_api/labels_api/api/dashboard_api.py b/labels_api/labels_api/api/dashboard_api.py new file mode 100644 index 00000000..6fcc3919 --- /dev/null +++ b/labels_api/labels_api/api/dashboard_api.py @@ -0,0 +1,1253 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.label_request import LabelRequest + +from labels_api.api_client import ApiClient +from labels_api.api_response import ApiResponse +from labels_api.rest import RESTResponseType + + +class DashboardApi: + """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 create_dashboard_label( + 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, + label_request: Annotated[Optional[LabelRequest], Field(description="Label resource")] = 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, + ) -> CreateAgentLabel201Response: + """Create a Label of type `dashboard` + + Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning agents or tests, the user needs permission to modify the objects being added. + + :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 label_request: Label resource + :type label_request: LabelRequest + :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._create_dashboard_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_dashboard_label_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, + label_request: Annotated[Optional[LabelRequest], Field(description="Label resource")] = 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[CreateAgentLabel201Response]: + """Create a Label of type `dashboard` + + Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning agents or tests, the user needs permission to modify the objects being added. + + :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 label_request: Label resource + :type label_request: LabelRequest + :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._create_dashboard_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_dashboard_label_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, + label_request: Annotated[Optional[LabelRequest], Field(description="Label resource")] = 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: + """Create a Label of type `dashboard` + + Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning agents or tests, the user needs permission to modify the objects being added. + + :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 label_request: Label resource + :type label_request: LabelRequest + :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._create_dashboard_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_dashboard_label_serialize( + self, + aid, + label_request, + _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 + if label_request is not None: + _body_params = label_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/labels/dashboard', + 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 delete_dashboard_label( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + ) -> None: + """Delete a Label object of type `dashboard` + + + :param label_id: ID of the label to get (required) + :type label_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._delete_dashboard_label_serialize( + label_id=label_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_dashboard_label_with_http_info( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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[None]: + """Delete a Label object of type `dashboard` + + + :param label_id: ID of the label to get (required) + :type label_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._delete_dashboard_label_serialize( + label_id=label_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_dashboard_label_without_preload_content( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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: + """Delete a Label object of type `dashboard` + + + :param label_id: ID of the label to get (required) + :type label_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._delete_dashboard_label_serialize( + label_id=label_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_dashboard_label_serialize( + self, + label_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 label_id is not None: + _path_params['labelId'] = label_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/labels/dashboard/{labelId}', + 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_dashboard_label( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + ) -> CreateAgentLabel201Response: + """Get a Label object of type `dashboard` + + + :param label_id: ID of the label to get (required) + :type label_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_dashboard_label_serialize( + label_id=label_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': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_dashboard_label_with_http_info( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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[CreateAgentLabel201Response]: + """Get a Label object of type `dashboard` + + + :param label_id: ID of the label to get (required) + :type label_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_dashboard_label_serialize( + label_id=label_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': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_dashboard_label_without_preload_content( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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: + """Get a Label object of type `dashboard` + + + :param label_id: ID of the label to get (required) + :type label_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_dashboard_label_serialize( + label_id=label_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': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_dashboard_label_serialize( + self, + label_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 label_id is not None: + _path_params['labelId'] = label_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/labels/dashboard/{labelId}', + 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 update_dashboard_label( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + label_request: Optional[LabelRequest] = 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, + ) -> CreateAgentLabel201Response: + """Update a Label object of type `dashboard` + + + :param label_id: ID of the label to get (required) + :type label_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 label_request: + :type label_request: LabelRequest + :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._update_dashboard_label_serialize( + label_id=label_id, + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_dashboard_label_with_http_info( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + label_request: Optional[LabelRequest] = 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[CreateAgentLabel201Response]: + """Update a Label object of type `dashboard` + + + :param label_id: ID of the label to get (required) + :type label_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 label_request: + :type label_request: LabelRequest + :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._update_dashboard_label_serialize( + label_id=label_id, + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_dashboard_label_without_preload_content( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + label_request: Optional[LabelRequest] = 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: + """Update a Label object of type `dashboard` + + + :param label_id: ID of the label to get (required) + :type label_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 label_request: + :type label_request: LabelRequest + :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._update_dashboard_label_serialize( + label_id=label_id, + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_dashboard_label_serialize( + self, + label_id, + aid, + label_request, + _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 label_id is not None: + _path_params['labelId'] = label_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 + if label_request is not None: + _body_params = label_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='PUT', + resource_path='/v7/labels/dashboard/{labelId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/labels_api/labels_api/api/endpoint_test_api.py b/labels_api/labels_api/api/endpoint_test_api.py new file mode 100644 index 00000000..f0453df9 --- /dev/null +++ b/labels_api/labels_api/api/endpoint_test_api.py @@ -0,0 +1,1253 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.label_request import LabelRequest + +from labels_api.api_client import ApiClient +from labels_api.api_response import ApiResponse +from labels_api.rest import RESTResponseType + + +class EndpointTestApi: + """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 create_endpoint_tests_label( + 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, + label_request: Annotated[Optional[LabelRequest], Field(description="Label resource")] = 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, + ) -> CreateAgentLabel201Response: + """Create a Label of type `endpoint-test` + + Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning agents or tests, the user needs permission to modify the objects being added. + + :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 label_request: Label resource + :type label_request: LabelRequest + :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._create_endpoint_tests_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_endpoint_tests_label_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, + label_request: Annotated[Optional[LabelRequest], Field(description="Label resource")] = 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[CreateAgentLabel201Response]: + """Create a Label of type `endpoint-test` + + Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning agents or tests, the user needs permission to modify the objects being added. + + :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 label_request: Label resource + :type label_request: LabelRequest + :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._create_endpoint_tests_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_endpoint_tests_label_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, + label_request: Annotated[Optional[LabelRequest], Field(description="Label resource")] = 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: + """Create a Label of type `endpoint-test` + + Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning agents or tests, the user needs permission to modify the objects being added. + + :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 label_request: Label resource + :type label_request: LabelRequest + :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._create_endpoint_tests_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_endpoint_tests_label_serialize( + self, + aid, + label_request, + _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 + if label_request is not None: + _body_params = label_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/labels/endpoint-test', + 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 delete_endpoint_test_label( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + ) -> None: + """Delete a Label object of type `endpoint-test` + + + :param label_id: ID of the label to get (required) + :type label_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._delete_endpoint_test_label_serialize( + label_id=label_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_endpoint_test_label_with_http_info( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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[None]: + """Delete a Label object of type `endpoint-test` + + + :param label_id: ID of the label to get (required) + :type label_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._delete_endpoint_test_label_serialize( + label_id=label_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_endpoint_test_label_without_preload_content( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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: + """Delete a Label object of type `endpoint-test` + + + :param label_id: ID of the label to get (required) + :type label_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._delete_endpoint_test_label_serialize( + label_id=label_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_endpoint_test_label_serialize( + self, + label_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 label_id is not None: + _path_params['labelId'] = label_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/labels/endpoint-test/{labelId}', + 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_endpoint_test_label( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + ) -> CreateAgentLabel201Response: + """Get a Label object of type `endpoint-test` + + + :param label_id: ID of the label to get (required) + :type label_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_endpoint_test_label_serialize( + label_id=label_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': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_endpoint_test_label_with_http_info( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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[CreateAgentLabel201Response]: + """Get a Label object of type `endpoint-test` + + + :param label_id: ID of the label to get (required) + :type label_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_endpoint_test_label_serialize( + label_id=label_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': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_endpoint_test_label_without_preload_content( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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: + """Get a Label object of type `endpoint-test` + + + :param label_id: ID of the label to get (required) + :type label_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_endpoint_test_label_serialize( + label_id=label_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': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_endpoint_test_label_serialize( + self, + label_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 label_id is not None: + _path_params['labelId'] = label_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/labels/endpoint-test/{labelId}', + 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 update_endpoint_test_label( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + label_request: Optional[LabelRequest] = 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, + ) -> CreateAgentLabel201Response: + """Update a Label object of type `endpoint-test` + + + :param label_id: ID of the label to get (required) + :type label_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 label_request: + :type label_request: LabelRequest + :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._update_endpoint_test_label_serialize( + label_id=label_id, + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_endpoint_test_label_with_http_info( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + label_request: Optional[LabelRequest] = 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[CreateAgentLabel201Response]: + """Update a Label object of type `endpoint-test` + + + :param label_id: ID of the label to get (required) + :type label_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 label_request: + :type label_request: LabelRequest + :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._update_endpoint_test_label_serialize( + label_id=label_id, + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_endpoint_test_label_without_preload_content( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + label_request: Optional[LabelRequest] = 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: + """Update a Label object of type `endpoint-test` + + + :param label_id: ID of the label to get (required) + :type label_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 label_request: + :type label_request: LabelRequest + :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._update_endpoint_test_label_serialize( + label_id=label_id, + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_endpoint_test_label_serialize( + self, + label_id, + aid, + label_request, + _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 label_id is not None: + _path_params['labelId'] = label_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 + if label_request is not None: + _body_params = label_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='PUT', + resource_path='/v7/labels/endpoint-test/{labelId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/labels_api/labels_api/api/test_api.py b/labels_api/labels_api/api/test_api.py new file mode 100644 index 00000000..eefc2cc1 --- /dev/null +++ b/labels_api/labels_api/api/test_api.py @@ -0,0 +1,1253 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.label_request import LabelRequest + +from labels_api.api_client import ApiClient +from labels_api.api_response import ApiResponse +from labels_api.rest import RESTResponseType + + +class TestApi: + """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 create_test_label( + 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, + label_request: Annotated[Optional[LabelRequest], Field(description="Label resource")] = 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, + ) -> CreateAgentLabel201Response: + """Create a Label of type `test` + + Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning `agent` or `test`, the user needs permission to modify the objects being added. + + :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 label_request: Label resource + :type label_request: LabelRequest + :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._create_test_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_test_label_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, + label_request: Annotated[Optional[LabelRequest], Field(description="Label resource")] = 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[CreateAgentLabel201Response]: + """Create a Label of type `test` + + Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning `agent` or `test`, the user needs permission to modify the objects being added. + + :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 label_request: Label resource + :type label_request: LabelRequest + :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._create_test_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 create_test_label_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, + label_request: Annotated[Optional[LabelRequest], Field(description="Label resource")] = 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: + """Create a Label of type `test` + + Creates a new label (formerly called group) in ThousandEyes, based on properties provided in the POST data. In order to create a new label, the user attempting the creation must have sufficient privileges to create labels. Regular users are blocked from using any of the POST-based methods. Note: When creating or updating a label and assigning `agent` or `test`, the user needs permission to modify the objects being added. + + :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 label_request: Label resource + :type label_request: LabelRequest + :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._create_test_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_test_label_serialize( + self, + aid, + label_request, + _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 + if label_request is not None: + _body_params = label_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/labels/test', + 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 delete_test_label( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + ) -> None: + """Delete a Label object of type `test` + + + :param label_id: ID of the label to get (required) + :type label_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._delete_test_label_serialize( + label_id=label_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_test_label_with_http_info( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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[None]: + """Delete a Label object of type `test` + + + :param label_id: ID of the label to get (required) + :type label_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._delete_test_label_serialize( + label_id=label_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_test_label_without_preload_content( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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: + """Delete a Label object of type `test` + + + :param label_id: ID of the label to get (required) + :type label_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._delete_test_label_serialize( + label_id=label_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_test_label_serialize( + self, + label_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 label_id is not None: + _path_params['labelId'] = label_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/labels/test/{labelId}', + 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_test_label( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + ) -> CreateAgentLabel201Response: + """Get a Label object of type `test` + + + :param label_id: ID of the label to get (required) + :type label_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_test_label_serialize( + label_id=label_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': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_test_label_with_http_info( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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[CreateAgentLabel201Response]: + """Get a Label object of type `test` + + + :param label_id: ID of the label to get (required) + :type label_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_test_label_serialize( + label_id=label_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': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_test_label_without_preload_content( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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: + """Get a Label object of type `test` + + + :param label_id: ID of the label to get (required) + :type label_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_test_label_serialize( + label_id=label_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': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_label_serialize( + self, + label_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 label_id is not None: + _path_params['labelId'] = label_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/labels/test/{labelId}', + 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 update_test_label( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + label_request: Optional[LabelRequest] = 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, + ) -> CreateAgentLabel201Response: + """Update a Label object of type `test` + + + :param label_id: ID of the label to get (required) + :type label_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 label_request: + :type label_request: LabelRequest + :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._update_test_label_serialize( + label_id=label_id, + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_test_label_with_http_info( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + label_request: Optional[LabelRequest] = 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[CreateAgentLabel201Response]: + """Update a Label object of type `test` + + + :param label_id: ID of the label to get (required) + :type label_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 label_request: + :type label_request: LabelRequest + :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._update_test_label_serialize( + label_id=label_id, + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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 update_test_label_without_preload_content( + self, + label_id: Annotated[StrictStr, Field(description="ID of the label to get")], + 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, + label_request: Optional[LabelRequest] = 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: + """Update a Label object of type `test` + + + :param label_id: ID of the label to get (required) + :type label_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 label_request: + :type label_request: LabelRequest + :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._update_test_label_serialize( + label_id=label_id, + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAgentLabel201Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_test_label_serialize( + self, + label_id, + aid, + label_request, + _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 label_id is not None: + _path_params['labelId'] = label_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 + if label_request is not None: + _body_params = label_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='PUT', + resource_path='/v7/labels/test/{labelId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/labels_api/labels_api/api_client.py b/labels_api/labels_api/api_client.py new file mode 100644 index 00000000..0c94676f --- /dev/null +++ b/labels_api/labels_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_api.configuration import Configuration +from labels_api.api_response import ApiResponse +import labels_api.models +from labels_api import rest +from labels_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(labels_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) diff --git a/labels_api/labels_api/api_response.py b/labels_api/labels_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/labels_api/labels_api/api_response.py @@ -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 + } diff --git a/labels_api/labels_api/configuration.py b/labels_api/labels_api/configuration.py new file mode 100644 index 00000000..0633e0e3 --- /dev/null +++ b/labels_api/labels_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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("labels_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 diff --git a/labels_api/labels_api/exceptions.py b/labels_api/labels_api/exceptions.py new file mode 100644 index 00000000..f6c65eda --- /dev/null +++ b/labels_api/labels_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 diff --git a/labels_api/labels_api/models/__init__.py b/labels_api/labels_api/models/__init__.py new file mode 100644 index 00000000..961afece --- /dev/null +++ b/labels_api/labels_api/models/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +# flake8: noqa +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_api.models.create_agent_label201_response import CreateAgentLabel201Response +from labels_api.models.error import Error +from labels_api.models.get_labels200_response import GetLabels200Response +from labels_api.models.label import Label +from labels_api.models.label_detail import LabelDetail +from labels_api.models.label_request import LabelRequest +from labels_api.models.label_type import LabelType +from labels_api.models.labels import Labels +from labels_api.models.link import Link +from labels_api.models.self_links import SelfLinks +from labels_api.models.self_links_links import SelfLinksLinks +from labels_api.models.unauthorized_error import UnauthorizedError diff --git a/labels_api/labels_api/models/create_agent_label201_response.py b/labels_api/labels_api/models/create_agent_label201_response.py new file mode 100644 index 00000000..f1c9eed2 --- /dev/null +++ b/labels_api/labels_api/models/create_agent_label201_response.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_api.models.label_type import LabelType +from labels_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class CreateAgentLabel201Response(BaseModel): + """ + CreateAgentLabel201Response + """ # noqa: E501 + label_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the label; this number is negative for built-in labels. Query `/v7/labels/{type}/{id}` endpoint to see the list of agent/test/dashboard ids with this label. ", alias="labelId") + is_built_in: Optional[StrictBool] = Field(default=None, description="`true` for built-in labels, and `false` for user-created labels. Note that built-in labels are read-only. ", alias="isBuiltIn") + name: Optional[StrictStr] = Field(default=None, description="The name of the new label - this must be unique.") + type: Optional[LabelType] = None + ids: Optional[List[StrictStr]] = Field(default=None, description="Array of agent/test/dashboard IDs the label is assigned to, depending on the type of label.") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["labelId", "isBuiltIn", "name", "type", "ids", "_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 CreateAgentLabel201Response 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 CreateAgentLabel201Response 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"), + "isBuiltIn": obj.get("isBuiltIn"), + "name": obj.get("name"), + "type": obj.get("type"), + "ids": obj.get("ids"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/labels_api/labels_api/models/error.py b/labels_api/labels_api/models/error.py new file mode 100644 index 00000000..b352829b --- /dev/null +++ b/labels_api/labels_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 + + diff --git a/labels_api/labels_api/models/get_labels200_response.py b/labels_api/labels_api/models/get_labels200_response.py new file mode 100644 index 00000000..66b9d1ee --- /dev/null +++ b/labels_api/labels_api/models/get_labels200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_api.models.label import Label +from labels_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetLabels200Response(BaseModel): + """ + GetLabels200Response + """ # noqa: E501 + labels: Optional[List[Label]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["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 GetLabels200Response 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 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 GetLabels200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "labels": [Label.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 + + diff --git a/labels_api/labels_api/models/label.py b/labels_api/labels_api/models/label.py new file mode 100644 index 00000000..bb3cd7b2 --- /dev/null +++ b/labels_api/labels_api/models/label.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_api.models.label_type import LabelType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Label(BaseModel): + """ + Label + """ # noqa: E501 + label_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the label; this number is negative for built-in labels. Query `/v7/labels/{type}/{id}` endpoint to see the list of agent/test/dashboard ids with this label. ", alias="labelId") + is_built_in: Optional[StrictBool] = Field(default=None, description="`true` for built-in labels, and `false` for user-created labels. Note that built-in labels are read-only. ", alias="isBuiltIn") + name: Optional[StrictStr] = Field(default=None, description="The name of the new label - this must be unique.") + type: Optional[LabelType] = None + __properties: ClassVar[List[str]] = ["labelId", "isBuiltIn", "name", "type"] + + 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 Label 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 Label 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"), + "isBuiltIn": obj.get("isBuiltIn"), + "name": obj.get("name"), + "type": obj.get("type") + }) + return _obj + + diff --git a/labels_api/labels_api/models/label_detail.py b/labels_api/labels_api/models/label_detail.py new file mode 100644 index 00000000..671d80c9 --- /dev/null +++ b/labels_api/labels_api/models/label_detail.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_api.models.label_type import LabelType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class LabelDetail(BaseModel): + """ + LabelDetail + """ # noqa: E501 + label_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the label; this number is negative for built-in labels. Query `/v7/labels/{type}/{id}` endpoint to see the list of agent/test/dashboard ids with this label. ", alias="labelId") + is_built_in: Optional[StrictBool] = Field(default=None, description="`true` for built-in labels, and `false` for user-created labels. Note that built-in labels are read-only. ", alias="isBuiltIn") + name: Optional[StrictStr] = Field(default=None, description="The name of the new label - this must be unique.") + type: Optional[LabelType] = None + ids: Optional[List[StrictStr]] = Field(default=None, description="Array of agent/test/dashboard IDs the label is assigned to, depending on the type of label.") + __properties: ClassVar[List[str]] = ["labelId", "isBuiltIn", "name", "type", "ids"] + + 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 LabelDetail 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 LabelDetail 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"), + "isBuiltIn": obj.get("isBuiltIn"), + "name": obj.get("name"), + "type": obj.get("type"), + "ids": obj.get("ids") + }) + return _obj + + diff --git a/labels_api/labels_api/models/label_request.py b/labels_api/labels_api/models/label_request.py new file mode 100644 index 00000000..90ce721d --- /dev/null +++ b/labels_api/labels_api/models/label_request.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 LabelRequest(BaseModel): + """ + LabelRequest + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the new label - this must be unique.") + ids: Optional[List[StrictStr]] = Field(default=None, description="Array of agent/test/dashboard ids the label should be assigned to, depending on the type of label") + __properties: ClassVar[List[str]] = ["name", "ids"] + + 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 LabelRequest 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 LabelRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "ids": obj.get("ids") + }) + return _obj + + diff --git a/labels_api/labels_api/models/label_type.py b/labels_api/labels_api/models/label_type.py new file mode 100644 index 00000000..ed64c37f --- /dev/null +++ b/labels_api/labels_api/models/label_type.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 LabelType(str, Enum): + """ + Either `test`, `agent`, `endpoint-test`, `endpoint-agent` or `dashboard`, indicates the type of label. + """ + + """ + allowed enum values + """ + AGENT = 'agent' + TEST = 'test' + ENDPOINT_MINUS_AGENT = 'endpoint-agent' + ENDPOINT_MINUS_TEST = 'endpoint-test' + DASHBOARD = 'dashboard' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of LabelType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/labels_api/labels_api/models/labels.py b/labels_api/labels_api/models/labels.py new file mode 100644 index 00000000..9c3ce818 --- /dev/null +++ b/labels_api/labels_api/models/labels.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_api.models.label import Label +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Labels(BaseModel): + """ + Labels + """ # noqa: E501 + labels: Optional[List[Label]] = None + __properties: ClassVar[List[str]] = ["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 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, + ) + # 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 Labels from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "labels": [Label.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None + }) + return _obj + + diff --git a/labels_api/labels_api/models/link.py b/labels_api/labels_api/models/link.py new file mode 100644 index 00000000..ac459527 --- /dev/null +++ b/labels_api/labels_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 + + diff --git a/labels_api/labels_api/models/self_links.py b/labels_api/labels_api/models/self_links.py new file mode 100644 index 00000000..12ade171 --- /dev/null +++ b/labels_api/labels_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_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 + + diff --git a/labels_api/labels_api/models/self_links_links.py b/labels_api/labels_api/models/self_links_links.py new file mode 100644 index 00000000..f9a09cd6 --- /dev/null +++ b/labels_api/labels_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_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 + + diff --git a/labels_api/labels_api/models/unauthorized_error.py b/labels_api/labels_api/models/unauthorized_error.py new file mode 100644 index 00000000..8a746b4d --- /dev/null +++ b/labels_api/labels_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 + + diff --git a/labels_api/labels_api/py.typed b/labels_api/labels_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/labels_api/labels_api/rest.py b/labels_api/labels_api/rest.py new file mode 100644 index 00000000..f76bc0cf --- /dev/null +++ b/labels_api/labels_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 labels_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) diff --git a/labels_api/pyproject.toml b/labels_api/pyproject.toml new file mode 100644 index 00000000..89bb3207 --- /dev/null +++ b/labels_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "labels_api" +version = "1.0.0" +description = "Labels API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Labels API"] +include = ["labels_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/labels_api/requirements.txt b/labels_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/labels_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/labels_api/setup.cfg b/labels_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/labels_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/labels_api/setup.py b/labels_api/setup.py new file mode 100644 index 00000000..1a4465c9 --- /dev/null +++ b/labels_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "labels-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Labels API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Labels API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + ### Overview This is API for the Labels API (formerly called groups). + """, # noqa: E501 + package_data={"labels_api": ["py.typed"]}, +) diff --git a/labels_api/test-requirements.txt b/labels_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/labels_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/labels_api/test/__init__.py b/labels_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/labels_api/test/test_agent_api.py b/labels_api/test/test_agent_api.py new file mode 100644 index 00000000..e7ee04e7 --- /dev/null +++ b/labels_api/test/test_agent_api.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest + +from labels_api.api.agent_api import AgentApi + + +class TestAgentApi(unittest.TestCase): + """AgentApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentApi() + + def tearDown(self) -> None: + pass + + def test_create_agent_label(self) -> None: + """Test case for create_agent_label + + Create a Label of type `agent` + """ + pass + + def test_delete_agent_label(self) -> None: + """Test case for delete_agent_label + + Delete a Label object of type `agent` + """ + pass + + def test_get_agent_label(self) -> None: + """Test case for get_agent_label + + Get a Label object of type `agent` + """ + pass + + def test_update_agent_label(self) -> None: + """Test case for update_agent_label + + Update a Label object of type `agent` + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_all_labels_api.py b/labels_api/test/test_all_labels_api.py new file mode 100644 index 00000000..a684556c --- /dev/null +++ b/labels_api/test/test_all_labels_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest + +from labels_api.api.all_labels_api import AllLabelsApi + + +class TestAllLabelsApi(unittest.TestCase): + """AllLabelsApi unit test stubs""" + + def setUp(self) -> None: + self.api = AllLabelsApi() + + def tearDown(self) -> None: + pass + + def test_get_labels(self) -> None: + """Test case for get_labels + + Get list of Labels + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_create_agent_label201_response.py b/labels_api/test/test_create_agent_label201_response.py new file mode 100644 index 00000000..19ff263b --- /dev/null +++ b/labels_api/test/test_create_agent_label201_response.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest +import datetime + +from labels_api.models.create_agent_label201_response import CreateAgentLabel201Response + +class TestCreateAgentLabel201Response(unittest.TestCase): + """CreateAgentLabel201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateAgentLabel201Response: + """Test CreateAgentLabel201Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateAgentLabel201Response` + """ + model = CreateAgentLabel201Response() + if include_optional: + return CreateAgentLabel201Response( + label_id = '961123', + is_built_in = True, + name = 'Label XYZ', + type = 'endpoint-test', + ids = [231286, 6317a3ca0d2bfc6ab882d6ce, 6317a3ca0d2bfc6ab882d6ca], + links = labels_api.models.self_links__links.SelfLinks__links( + self = labels_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return CreateAgentLabel201Response( + ) + """ + + def testCreateAgentLabel201Response(self): + """Test CreateAgentLabel201Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_dashboard_api.py b/labels_api/test/test_dashboard_api.py new file mode 100644 index 00000000..4be521f8 --- /dev/null +++ b/labels_api/test/test_dashboard_api.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest + +from labels_api.api.dashboard_api import DashboardApi + + +class TestDashboardApi(unittest.TestCase): + """DashboardApi unit test stubs""" + + def setUp(self) -> None: + self.api = DashboardApi() + + def tearDown(self) -> None: + pass + + def test_create_dashboard_label(self) -> None: + """Test case for create_dashboard_label + + Create a Label of type `dashboard` + """ + pass + + def test_delete_dashboard_label(self) -> None: + """Test case for delete_dashboard_label + + Delete a Label object of type `dashboard` + """ + pass + + def test_get_dashboard_label(self) -> None: + """Test case for get_dashboard_label + + Get a Label object of type `dashboard` + """ + pass + + def test_update_dashboard_label(self) -> None: + """Test case for update_dashboard_label + + Update a Label object of type `dashboard` + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_endpoint_test_api.py b/labels_api/test/test_endpoint_test_api.py new file mode 100644 index 00000000..03de0939 --- /dev/null +++ b/labels_api/test/test_endpoint_test_api.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest + +from labels_api.api.endpoint_test_api import EndpointTestApi + + +class TestEndpointTestApi(unittest.TestCase): + """EndpointTestApi unit test stubs""" + + def setUp(self) -> None: + self.api = EndpointTestApi() + + def tearDown(self) -> None: + pass + + def test_create_endpoint_tests_label(self) -> None: + """Test case for create_endpoint_tests_label + + Create a Label of type `endpoint-test` + """ + pass + + def test_delete_endpoint_test_label(self) -> None: + """Test case for delete_endpoint_test_label + + Delete a Label object of type `endpoint-test` + """ + pass + + def test_get_endpoint_test_label(self) -> None: + """Test case for get_endpoint_test_label + + Get a Label object of type `endpoint-test` + """ + pass + + def test_update_endpoint_test_label(self) -> None: + """Test case for update_endpoint_test_label + + Update a Label object of type `endpoint-test` + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_error.py b/labels_api/test/test_error.py new file mode 100644 index 00000000..d6483f97 --- /dev/null +++ b/labels_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest +import datetime + +from labels_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_get_labels200_response.py b/labels_api/test/test_get_labels200_response.py new file mode 100644 index 00000000..a546a6ab --- /dev/null +++ b/labels_api/test/test_get_labels200_response.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest +import datetime + +from labels_api.models.get_labels200_response import GetLabels200Response + +class TestGetLabels200Response(unittest.TestCase): + """GetLabels200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetLabels200Response: + """Test GetLabels200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetLabels200Response` + """ + model = GetLabels200Response() + if include_optional: + return GetLabels200Response( + labels = [ + labels_api.models.label.Label( + label_id = '961123', + is_built_in = True, + name = 'Label XYZ', + type = 'endpoint-test', ) + ], + links = labels_api.models.self_links__links.SelfLinks__links( + self = labels_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetLabels200Response( + ) + """ + + def testGetLabels200Response(self): + """Test GetLabels200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_label.py b/labels_api/test/test_label.py new file mode 100644 index 00000000..d3e50a8a --- /dev/null +++ b/labels_api/test/test_label.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest +import datetime + +from labels_api.models.label import Label + +class TestLabel(unittest.TestCase): + """Label unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Label: + """Test Label + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Label` + """ + model = Label() + if include_optional: + return Label( + label_id = '961123', + is_built_in = True, + name = 'Label XYZ', + type = 'endpoint-test' + ) + else: + return Label( + ) + """ + + def testLabel(self): + """Test Label""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_label_detail.py b/labels_api/test/test_label_detail.py new file mode 100644 index 00000000..adbe27f2 --- /dev/null +++ b/labels_api/test/test_label_detail.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest +import datetime + +from labels_api.models.label_detail import LabelDetail + +class TestLabelDetail(unittest.TestCase): + """LabelDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LabelDetail: + """Test LabelDetail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LabelDetail` + """ + model = LabelDetail() + if include_optional: + return LabelDetail( + label_id = '961123', + is_built_in = True, + name = 'Label XYZ', + type = 'endpoint-test', + ids = ["231286","6317a3ca0d2bfc6ab882d6ce","6317a3ca0d2bfc6ab882d6ca"] + ) + else: + return LabelDetail( + ) + """ + + def testLabelDetail(self): + """Test LabelDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_label_request.py b/labels_api/test/test_label_request.py new file mode 100644 index 00000000..254b2171 --- /dev/null +++ b/labels_api/test/test_label_request.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest +import datetime + +from labels_api.models.label_request import LabelRequest + +class TestLabelRequest(unittest.TestCase): + """LabelRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LabelRequest: + """Test LabelRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LabelRequest` + """ + model = LabelRequest() + if include_optional: + return LabelRequest( + name = 'My new label', + ids = ["5048","1234"] + ) + else: + return LabelRequest( + ) + """ + + def testLabelRequest(self): + """Test LabelRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_label_type.py b/labels_api/test/test_label_type.py new file mode 100644 index 00000000..ae35df07 --- /dev/null +++ b/labels_api/test/test_label_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest +import datetime + +from labels_api.models.label_type import LabelType + +class TestLabelType(unittest.TestCase): + """LabelType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testLabelType(self): + """Test LabelType""" + # inst = LabelType() + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_labels.py b/labels_api/test/test_labels.py new file mode 100644 index 00000000..501f802d --- /dev/null +++ b/labels_api/test/test_labels.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest +import datetime + +from labels_api.models.labels import Labels + +class TestLabels(unittest.TestCase): + """Labels unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Labels: + """Test Labels + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Labels` + """ + model = Labels() + if include_optional: + return Labels( + labels = [ + labels_api.models.label.Label( + label_id = '961123', + is_built_in = True, + name = 'Label XYZ', + type = 'endpoint-test', ) + ] + ) + else: + return Labels( + ) + """ + + def testLabels(self): + """Test Labels""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_link.py b/labels_api/test/test_link.py new file mode 100644 index 00000000..8740a9c9 --- /dev/null +++ b/labels_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest +import datetime + +from labels_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_self_links.py b/labels_api/test/test_self_links.py new file mode 100644 index 00000000..dce212ce --- /dev/null +++ b/labels_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest +import datetime + +from labels_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = labels_api.models.self_links__links.SelfLinks__links( + self = labels_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_self_links_links.py b/labels_api/test/test_self_links_links.py new file mode 100644 index 00000000..9eb03130 --- /dev/null +++ b/labels_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest +import datetime + +from labels_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = labels_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_test_api.py b/labels_api/test/test_test_api.py new file mode 100644 index 00000000..ea11dae3 --- /dev/null +++ b/labels_api/test/test_test_api.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest + +from labels_api.api.test_api import TestApi + + +class TestTestApi(unittest.TestCase): + """TestApi unit test stubs""" + + def setUp(self) -> None: + self.api = TestApi() + + def tearDown(self) -> None: + pass + + def test_create_test_label(self) -> None: + """Test case for create_test_label + + Create a Label of type `test` + """ + pass + + def test_delete_test_label(self) -> None: + """Test case for delete_test_label + + Delete a Label object of type `test` + """ + pass + + def test_get_test_label(self) -> None: + """Test case for get_test_label + + Get a Label object of type `test` + """ + pass + + def test_update_test_label(self) -> None: + """Test case for update_test_label + + Update a Label object of type `test` + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/test/test_unauthorized_error.py b/labels_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..a1bae7e0 --- /dev/null +++ b/labels_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Labels API + + ### Overview This is API for the Labels API (formerly called groups). + + 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 unittest +import datetime + +from labels_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/labels_api/tox.ini b/labels_api/tox.ini new file mode 100644 index 00000000..61ac7d6b --- /dev/null +++ b/labels_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=labels_api diff --git a/monitors_api/.github/workflows/python.yml b/monitors_api/.github/workflows/python.yml new file mode 100644 index 00000000..3bd32c89 --- /dev/null +++ b/monitors_api/.github/workflows/python.yml @@ -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: monitors_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 diff --git a/monitors_api/.gitignore b/monitors_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/monitors_api/.gitignore @@ -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 diff --git a/monitors_api/.gitlab-ci.yml b/monitors_api/.gitlab-ci.yml new file mode 100644 index 00000000..c9801ce8 --- /dev/null +++ b/monitors_api/.gitlab-ci.yml @@ -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=monitors_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 diff --git a/monitors_api/.openapi-generator-ignore b/monitors_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/monitors_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/monitors_api/.openapi-generator/FILES b/monitors_api/.openapi-generator/FILES new file mode 100644 index 00000000..d791d973 --- /dev/null +++ b/monitors_api/.openapi-generator/FILES @@ -0,0 +1,53 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/Error.md +docs/GetBGPMonitors200Response.md +docs/Link.md +docs/ListBGPMonitorsApi.md +docs/Monitor.md +docs/MonitorType.md +docs/Monitors.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/UnauthorizedError.md +git_push.sh +monitors_api/__init__.py +monitors_api/api/__init__.py +monitors_api/api/list_bgp_monitors_api.py +monitors_api/api_client.py +monitors_api/api_response.py +monitors_api/configuration.py +monitors_api/exceptions.py +monitors_api/models/__init__.py +monitors_api/models/error.py +monitors_api/models/get_bgp_monitors200_response.py +monitors_api/models/link.py +monitors_api/models/monitor.py +monitors_api/models/monitor_type.py +monitors_api/models/monitors.py +monitors_api/models/self_links.py +monitors_api/models/self_links_links.py +monitors_api/models/unauthorized_error.py +monitors_api/py.typed +monitors_api/rest.py +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_error.py +test/test_get_bgp_monitors200_response.py +test/test_link.py +test/test_list_bgp_monitors_api.py +test/test_monitor.py +test/test_monitor_type.py +test/test_monitors.py +test/test_self_links.py +test/test_self_links_links.py +test/test_unauthorized_error.py +tox.ini diff --git a/monitors_api/.openapi-generator/VERSION b/monitors_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/monitors_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/monitors_api/.travis.yml b/monitors_api/.travis.yml new file mode 100644 index 00000000..d4a06ca4 --- /dev/null +++ b/monitors_api/.travis.yml @@ -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=monitors_api diff --git a/monitors_api/README.md b/monitors_api/README.md new file mode 100644 index 00000000..b2f68709 --- /dev/null +++ b/monitors_api/README.md @@ -0,0 +1,130 @@ +# monitors-api + +## Overview +Retrieve information about BGP monitors available for ThousandEyes account. + +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 monitors_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 monitors_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 monitors_api +from monitors_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 = monitors_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 = monitors_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with monitors_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = monitors_api.ListBGPMonitorsApi(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 BGP monitors + api_response = api_instance.get_bgp_monitors(aid=aid) + print("The response of ListBGPMonitorsApi->get_bgp_monitors:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling ListBGPMonitorsApi->get_bgp_monitors: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ListBGPMonitorsApi* | [**get_bgp_monitors**](docs/ListBGPMonitorsApi.md#get_bgp_monitors) | **GET** /v7/monitors | List BGP monitors + + +## Documentation For Models + + - [Error](docs/Error.md) + - [GetBGPMonitors200Response](docs/GetBGPMonitors200Response.md) + - [Link](docs/Link.md) + - [Monitor](docs/Monitor.md) + - [MonitorType](docs/MonitorType.md) + - [Monitors](docs/Monitors.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/monitors_api/docs/Error.md b/monitors_api/docs/Error.md new file mode 100644 index 00000000..c6c3d209 --- /dev/null +++ b/monitors_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from monitors_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/monitors_api/docs/GetBGPMonitors200Response.md b/monitors_api/docs/GetBGPMonitors200Response.md new file mode 100644 index 00000000..4ef0ddac --- /dev/null +++ b/monitors_api/docs/GetBGPMonitors200Response.md @@ -0,0 +1,29 @@ +# GetBGPMonitors200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**monitors** | [**List[Monitor]**](Monitor.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from monitors_api.models.get_bgp_monitors200_response import GetBGPMonitors200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetBGPMonitors200Response from a JSON string +get_bgp_monitors200_response_instance = GetBGPMonitors200Response.from_json(json) +# print the JSON string representation of the object +print GetBGPMonitors200Response.to_json() + +# convert the object into a dict +get_bgp_monitors200_response_dict = get_bgp_monitors200_response_instance.to_dict() +# create an instance of GetBGPMonitors200Response from a dict +get_bgp_monitors200_response_form_dict = get_bgp_monitors200_response.from_dict(get_bgp_monitors200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/monitors_api/docs/Link.md b/monitors_api/docs/Link.md new file mode 100644 index 00000000..ac400d0e --- /dev/null +++ b/monitors_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from monitors_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/monitors_api/docs/ListBGPMonitorsApi.md b/monitors_api/docs/ListBGPMonitorsApi.md new file mode 100644 index 00000000..f9ff1c36 --- /dev/null +++ b/monitors_api/docs/ListBGPMonitorsApi.md @@ -0,0 +1,91 @@ +# monitors_api.ListBGPMonitorsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_bgp_monitors**](ListBGPMonitorsApi.md#get_bgp_monitors) | **GET** /v7/monitors | List BGP monitors + + +# **get_bgp_monitors** +> GetBGPMonitors200Response get_bgp_monitors(aid=aid) + +List BGP monitors + +Retrieves a list of BGP monitors available to your account in ThousandEyes, including public and private feeds. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import monitors_api +from monitors_api.models.get_bgp_monitors200_response import GetBGPMonitors200Response +from monitors_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 = monitors_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 = monitors_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with monitors_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = monitors_api.ListBGPMonitorsApi(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 BGP monitors + api_response = api_instance.get_bgp_monitors(aid=aid) + print("The response of ListBGPMonitorsApi->get_bgp_monitors:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ListBGPMonitorsApi->get_bgp_monitors: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetBGPMonitors200Response**](GetBGPMonitors200Response.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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/monitors_api/docs/Monitor.md b/monitors_api/docs/Monitor.md new file mode 100644 index 00000000..2c45b07c --- /dev/null +++ b/monitors_api/docs/Monitor.md @@ -0,0 +1,33 @@ +# Monitor + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country_id** | **str** | Country ID | [optional] [readonly] +**monitor_id** | **str** | BGP monitor ID | [optional] [readonly] +**ip_address** | **str** | IP address of the BGP monitor | [optional] +**network** | **str** | Name of the autonomous system in which the monitor is found | [optional] +**monitor_type** | [**MonitorType**](MonitorType.md) | | [optional] +**monitor_name** | **str** | Display name of the BGP monitor | [optional] + +## Example + +```python +from monitors_api.models.monitor import Monitor + +# TODO update the JSON string below +json = "{}" +# create an instance of Monitor from a JSON string +monitor_instance = Monitor.from_json(json) +# print the JSON string representation of the object +print Monitor.to_json() + +# convert the object into a dict +monitor_dict = monitor_instance.to_dict() +# create an instance of Monitor from a dict +monitor_form_dict = monitor.from_dict(monitor_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/monitors_api/docs/MonitorType.md b/monitors_api/docs/MonitorType.md new file mode 100644 index 00000000..30c9de8b --- /dev/null +++ b/monitors_api/docs/MonitorType.md @@ -0,0 +1,11 @@ +# MonitorType + +Type of monitor + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/monitors_api/docs/Monitors.md b/monitors_api/docs/Monitors.md new file mode 100644 index 00000000..895a0a03 --- /dev/null +++ b/monitors_api/docs/Monitors.md @@ -0,0 +1,28 @@ +# Monitors + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**monitors** | [**List[Monitor]**](Monitor.md) | | [optional] + +## Example + +```python +from monitors_api.models.monitors import Monitors + +# TODO update the JSON string below +json = "{}" +# create an instance of Monitors from a JSON string +monitors_instance = Monitors.from_json(json) +# print the JSON string representation of the object +print Monitors.to_json() + +# convert the object into a dict +monitors_dict = monitors_instance.to_dict() +# create an instance of Monitors from a dict +monitors_form_dict = monitors.from_dict(monitors_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/monitors_api/docs/SelfLinks.md b/monitors_api/docs/SelfLinks.md new file mode 100644 index 00000000..026e4447 --- /dev/null +++ b/monitors_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from monitors_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/monitors_api/docs/SelfLinksLinks.md b/monitors_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..df23ca1a --- /dev/null +++ b/monitors_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from monitors_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/monitors_api/docs/UnauthorizedError.md b/monitors_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..29ae35b3 --- /dev/null +++ b/monitors_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from monitors_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/monitors_api/git_push.sh b/monitors_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/monitors_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/monitors_api/monitors_api/__init__.py b/monitors_api/monitors_api/__init__.py new file mode 100644 index 00000000..7129c2bf --- /dev/null +++ b/monitors_api/monitors_api/__init__.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +# flake8: noqa + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 monitors_api.api.list_bgp_monitors_api import ListBGPMonitorsApi + +# import ApiClient +from monitors_api.api_response import ApiResponse +from monitors_api.api_client import ApiClient +from monitors_api.configuration import Configuration +from monitors_api.exceptions import OpenApiException +from monitors_api.exceptions import ApiTypeError +from monitors_api.exceptions import ApiValueError +from monitors_api.exceptions import ApiKeyError +from monitors_api.exceptions import ApiAttributeError +from monitors_api.exceptions import ApiException + +# import models into sdk package +from monitors_api.models.error import Error +from monitors_api.models.get_bgp_monitors200_response import GetBGPMonitors200Response +from monitors_api.models.link import Link +from monitors_api.models.monitor import Monitor +from monitors_api.models.monitor_type import MonitorType +from monitors_api.models.monitors import Monitors +from monitors_api.models.self_links import SelfLinks +from monitors_api.models.self_links_links import SelfLinksLinks +from monitors_api.models.unauthorized_error import UnauthorizedError diff --git a/monitors_api/monitors_api/api/__init__.py b/monitors_api/monitors_api/api/__init__.py new file mode 100644 index 00000000..ba4af859 --- /dev/null +++ b/monitors_api/monitors_api/api/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa + +# import apis into api package +from monitors_api.api.list_bgp_monitors_api import ListBGPMonitorsApi + diff --git a/monitors_api/monitors_api/api/list_bgp_monitors_api.py b/monitors_api/monitors_api/api/list_bgp_monitors_api.py new file mode 100644 index 00000000..bb2417b0 --- /dev/null +++ b/monitors_api/monitors_api/api/list_bgp_monitors_api.py @@ -0,0 +1,329 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 monitors_api.models.get_bgp_monitors200_response import GetBGPMonitors200Response + +from monitors_api.api_client import ApiClient +from monitors_api.api_response import ApiResponse +from monitors_api.rest import RESTResponseType + + +class ListBGPMonitorsApi: + """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_bgp_monitors( + 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, + ) -> GetBGPMonitors200Response: + """List BGP monitors + + Retrieves a list of BGP monitors available to your account in ThousandEyes, including public and private feeds. + + :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_bgp_monitors_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': "GetBGPMonitors200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_bgp_monitors_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[GetBGPMonitors200Response]: + """List BGP monitors + + Retrieves a list of BGP monitors available to your account in ThousandEyes, including public and private feeds. + + :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_bgp_monitors_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': "GetBGPMonitors200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_bgp_monitors_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 BGP monitors + + Retrieves a list of BGP monitors available to your account in ThousandEyes, including public and private feeds. + + :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_bgp_monitors_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': "GetBGPMonitors200Response", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_bgp_monitors_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/monitors', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/monitors_api/monitors_api/api_client.py b/monitors_api/monitors_api/api_client.py new file mode 100644 index 00000000..a75ffb65 --- /dev/null +++ b/monitors_api/monitors_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 monitors_api.configuration import Configuration +from monitors_api.api_response import ApiResponse +import monitors_api.models +from monitors_api import rest +from monitors_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(monitors_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) diff --git a/monitors_api/monitors_api/api_response.py b/monitors_api/monitors_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/monitors_api/monitors_api/api_response.py @@ -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 + } diff --git a/monitors_api/monitors_api/configuration.py b/monitors_api/monitors_api/configuration.py new file mode 100644 index 00000000..cf6c1052 --- /dev/null +++ b/monitors_api/monitors_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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("monitors_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 diff --git a/monitors_api/monitors_api/exceptions.py b/monitors_api/monitors_api/exceptions.py new file mode 100644 index 00000000..e4125d60 --- /dev/null +++ b/monitors_api/monitors_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 diff --git a/monitors_api/monitors_api/models/__init__.py b/monitors_api/monitors_api/models/__init__.py new file mode 100644 index 00000000..d71ec834 --- /dev/null +++ b/monitors_api/monitors_api/models/__init__.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +# flake8: noqa +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 monitors_api.models.error import Error +from monitors_api.models.get_bgp_monitors200_response import GetBGPMonitors200Response +from monitors_api.models.link import Link +from monitors_api.models.monitor import Monitor +from monitors_api.models.monitor_type import MonitorType +from monitors_api.models.monitors import Monitors +from monitors_api.models.self_links import SelfLinks +from monitors_api.models.self_links_links import SelfLinksLinks +from monitors_api.models.unauthorized_error import UnauthorizedError diff --git a/monitors_api/monitors_api/models/error.py b/monitors_api/monitors_api/models/error.py new file mode 100644 index 00000000..7fcb05fd --- /dev/null +++ b/monitors_api/monitors_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 + + diff --git a/monitors_api/monitors_api/models/get_bgp_monitors200_response.py b/monitors_api/monitors_api/models/get_bgp_monitors200_response.py new file mode 100644 index 00000000..20f2c6b8 --- /dev/null +++ b/monitors_api/monitors_api/models/get_bgp_monitors200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 monitors_api.models.monitor import Monitor +from monitors_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetBGPMonitors200Response(BaseModel): + """ + GetBGPMonitors200Response + """ # noqa: E501 + monitors: Optional[List[Monitor]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["monitors", "_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 GetBGPMonitors200Response 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 monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _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 GetBGPMonitors200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/monitors_api/monitors_api/models/link.py b/monitors_api/monitors_api/models/link.py new file mode 100644 index 00000000..e3baadd6 --- /dev/null +++ b/monitors_api/monitors_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 + + diff --git a/monitors_api/monitors_api/models/monitor.py b/monitors_api/monitors_api/models/monitor.py new file mode 100644 index 00000000..a010e78a --- /dev/null +++ b/monitors_api/monitors_api/models/monitor.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 monitors_api.models.monitor_type import MonitorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Monitor(BaseModel): + """ + Monitor + """ # noqa: E501 + country_id: Optional[StrictStr] = Field(default=None, description="Country ID", alias="countryId") + monitor_id: Optional[StrictStr] = Field(default=None, description="BGP monitor ID", alias="monitorId") + ip_address: Optional[StrictStr] = Field(default=None, description="IP address of the BGP monitor", alias="ipAddress") + network: Optional[StrictStr] = Field(default=None, description="Name of the autonomous system in which the monitor is found") + monitor_type: Optional[MonitorType] = Field(default=None, alias="monitorType") + monitor_name: Optional[StrictStr] = Field(default=None, description="Display name of the BGP monitor", alias="monitorName") + __properties: ClassVar[List[str]] = ["countryId", "monitorId", "ipAddress", "network", "monitorType", "monitorName"] + + 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 Monitor 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={ + "country_id", + "monitor_id", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Monitor from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "countryId": obj.get("countryId"), + "monitorId": obj.get("monitorId"), + "ipAddress": obj.get("ipAddress"), + "network": obj.get("network"), + "monitorType": obj.get("monitorType"), + "monitorName": obj.get("monitorName") + }) + return _obj + + diff --git a/monitors_api/monitors_api/models/monitor_type.py b/monitors_api/monitors_api/models/monitor_type.py new file mode 100644 index 00000000..d400c908 --- /dev/null +++ b/monitors_api/monitors_api/models/monitor_type.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 MonitorType(str, Enum): + """ + Type of monitor + """ + + """ + allowed enum values + """ + PUBLIC = 'public' + PRIVATE = 'private' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of MonitorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/monitors_api/monitors_api/models/monitors.py b/monitors_api/monitors_api/models/monitors.py new file mode 100644 index 00000000..1ea5a785 --- /dev/null +++ b/monitors_api/monitors_api/models/monitors.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 monitors_api.models.monitor import Monitor +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Monitors(BaseModel): + """ + Monitors + """ # noqa: E501 + monitors: Optional[List[Monitor]] = None + __properties: ClassVar[List[str]] = ["monitors"] + + 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 Monitors 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 monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Monitors from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None + }) + return _obj + + diff --git a/monitors_api/monitors_api/models/self_links.py b/monitors_api/monitors_api/models/self_links.py new file mode 100644 index 00000000..7963138b --- /dev/null +++ b/monitors_api/monitors_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 monitors_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 + + diff --git a/monitors_api/monitors_api/models/self_links_links.py b/monitors_api/monitors_api/models/self_links_links.py new file mode 100644 index 00000000..1747503d --- /dev/null +++ b/monitors_api/monitors_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 monitors_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 + + diff --git a/monitors_api/monitors_api/models/unauthorized_error.py b/monitors_api/monitors_api/models/unauthorized_error.py new file mode 100644 index 00000000..93a7c567 --- /dev/null +++ b/monitors_api/monitors_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 + + diff --git a/monitors_api/monitors_api/py.typed b/monitors_api/monitors_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/monitors_api/monitors_api/rest.py b/monitors_api/monitors_api/rest.py new file mode 100644 index 00000000..8edb8c48 --- /dev/null +++ b/monitors_api/monitors_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 monitors_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) diff --git a/monitors_api/pyproject.toml b/monitors_api/pyproject.toml new file mode 100644 index 00000000..11849271 --- /dev/null +++ b/monitors_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "monitors_api" +version = "1.0.0" +description = "BGP Monitors" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "BGP Monitors"] +include = ["monitors_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/monitors_api/requirements.txt b/monitors_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/monitors_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/monitors_api/setup.cfg b/monitors_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/monitors_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/monitors_api/setup.py b/monitors_api/setup.py new file mode 100644 index 00000000..a69b3016 --- /dev/null +++ b/monitors_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "monitors-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="BGP Monitors", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "BGP Monitors"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + """, # noqa: E501 + package_data={"monitors_api": ["py.typed"]}, +) diff --git a/monitors_api/test-requirements.txt b/monitors_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/monitors_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/monitors_api/test/__init__.py b/monitors_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/monitors_api/test/test_error.py b/monitors_api/test/test_error.py new file mode 100644 index 00000000..26ebcf70 --- /dev/null +++ b/monitors_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 unittest +import datetime + +from monitors_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/monitors_api/test/test_get_bgp_monitors200_response.py b/monitors_api/test/test_get_bgp_monitors200_response.py new file mode 100644 index 00000000..46b82092 --- /dev/null +++ b/monitors_api/test/test_get_bgp_monitors200_response.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 unittest +import datetime + +from monitors_api.models.get_bgp_monitors200_response import GetBGPMonitors200Response + +class TestGetBGPMonitors200Response(unittest.TestCase): + """GetBGPMonitors200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetBGPMonitors200Response: + """Test GetBGPMonitors200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetBGPMonitors200Response` + """ + model = GetBGPMonitors200Response() + if include_optional: + return GetBGPMonitors200Response( + monitors = [ + monitors_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ], + links = monitors_api.models.self_links__links.SelfLinks__links( + self = monitors_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetBGPMonitors200Response( + ) + """ + + def testGetBGPMonitors200Response(self): + """Test GetBGPMonitors200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/monitors_api/test/test_link.py b/monitors_api/test/test_link.py new file mode 100644 index 00000000..57be58e5 --- /dev/null +++ b/monitors_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 unittest +import datetime + +from monitors_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/monitors_api/test/test_list_bgp_monitors_api.py b/monitors_api/test/test_list_bgp_monitors_api.py new file mode 100644 index 00000000..d64407cb --- /dev/null +++ b/monitors_api/test/test_list_bgp_monitors_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 unittest + +from monitors_api.api.list_bgp_monitors_api import ListBGPMonitorsApi + + +class TestListBGPMonitorsApi(unittest.TestCase): + """ListBGPMonitorsApi unit test stubs""" + + def setUp(self) -> None: + self.api = ListBGPMonitorsApi() + + def tearDown(self) -> None: + pass + + def test_get_bgp_monitors(self) -> None: + """Test case for get_bgp_monitors + + List BGP monitors + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/monitors_api/test/test_monitor.py b/monitors_api/test/test_monitor.py new file mode 100644 index 00000000..0fc9c4bf --- /dev/null +++ b/monitors_api/test/test_monitor.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 unittest +import datetime + +from monitors_api.models.monitor import Monitor + +class TestMonitor(unittest.TestCase): + """Monitor unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Monitor: + """Test Monitor + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Monitor` + """ + model = Monitor() + if include_optional: + return Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA' + ) + else: + return Monitor( + ) + """ + + def testMonitor(self): + """Test Monitor""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/monitors_api/test/test_monitor_type.py b/monitors_api/test/test_monitor_type.py new file mode 100644 index 00000000..321e513c --- /dev/null +++ b/monitors_api/test/test_monitor_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 unittest +import datetime + +from monitors_api.models.monitor_type import MonitorType + +class TestMonitorType(unittest.TestCase): + """MonitorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMonitorType(self): + """Test MonitorType""" + # inst = MonitorType() + +if __name__ == '__main__': + unittest.main() diff --git a/monitors_api/test/test_monitors.py b/monitors_api/test/test_monitors.py new file mode 100644 index 00000000..140d7767 --- /dev/null +++ b/monitors_api/test/test_monitors.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 unittest +import datetime + +from monitors_api.models.monitors import Monitors + +class TestMonitors(unittest.TestCase): + """Monitors unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Monitors: + """Test Monitors + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Monitors` + """ + model = Monitors() + if include_optional: + return Monitors( + monitors = [ + monitors_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ] + ) + else: + return Monitors( + ) + """ + + def testMonitors(self): + """Test Monitors""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/monitors_api/test/test_self_links.py b/monitors_api/test/test_self_links.py new file mode 100644 index 00000000..fc919fdb --- /dev/null +++ b/monitors_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 unittest +import datetime + +from monitors_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = monitors_api.models.self_links__links.SelfLinks__links( + self = monitors_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/monitors_api/test/test_self_links_links.py b/monitors_api/test/test_self_links_links.py new file mode 100644 index 00000000..dea9f770 --- /dev/null +++ b/monitors_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 unittest +import datetime + +from monitors_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = monitors_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/monitors_api/test/test_unauthorized_error.py b/monitors_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..d4741840 --- /dev/null +++ b/monitors_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + BGP Monitors + + ## Overview Retrieve information about BGP monitors available for ThousandEyes account. + + 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 unittest +import datetime + +from monitors_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/monitors_api/tox.ini b/monitors_api/tox.ini new file mode 100644 index 00000000..0c7e9c9b --- /dev/null +++ b/monitors_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=monitors_api diff --git a/snapshots_api/.github/workflows/python.yml b/snapshots_api/.github/workflows/python.yml new file mode 100644 index 00000000..9c2426b9 --- /dev/null +++ b/snapshots_api/.github/workflows/python.yml @@ -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: snapshots_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 diff --git a/snapshots_api/.gitignore b/snapshots_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/snapshots_api/.gitignore @@ -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 diff --git a/snapshots_api/.gitlab-ci.yml b/snapshots_api/.gitlab-ci.yml new file mode 100644 index 00000000..ed7b05ff --- /dev/null +++ b/snapshots_api/.gitlab-ci.yml @@ -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=snapshots_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 diff --git a/snapshots_api/.openapi-generator-ignore b/snapshots_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/snapshots_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/snapshots_api/.openapi-generator/FILES b/snapshots_api/.openapi-generator/FILES new file mode 100644 index 00000000..584ba5c2 --- /dev/null +++ b/snapshots_api/.openapi-generator/FILES @@ -0,0 +1,80 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/AppLinks.md +docs/AppLinksLinks.md +docs/CreateTestSnapshotApi.md +docs/Error.md +docs/Link.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/SnapshotLinks.md +docs/SnapshotRequest.md +docs/SnapshotResponse.md +docs/SnapshotResponseAllOfTest.md +docs/TestInterval.md +docs/TestType.md +docs/UnauthorizedError.md +docs/UnexpandedInstantTest.md +docs/UnexpandedInstantTestLinks.md +docs/UnexpandedInstantTestLinksSelf.md +docs/UnexpandedInstantTestLinksTestResults.md +docs/UnexpandedTest.md +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +snapshots_api/__init__.py +snapshots_api/api/__init__.py +snapshots_api/api/create_test_snapshot_api.py +snapshots_api/api_client.py +snapshots_api/api_response.py +snapshots_api/configuration.py +snapshots_api/exceptions.py +snapshots_api/models/__init__.py +snapshots_api/models/app_links.py +snapshots_api/models/app_links_links.py +snapshots_api/models/error.py +snapshots_api/models/link.py +snapshots_api/models/self_links.py +snapshots_api/models/self_links_links.py +snapshots_api/models/snapshot_links.py +snapshots_api/models/snapshot_request.py +snapshots_api/models/snapshot_response.py +snapshots_api/models/snapshot_response_all_of_test.py +snapshots_api/models/test_interval.py +snapshots_api/models/test_type.py +snapshots_api/models/unauthorized_error.py +snapshots_api/models/unexpanded_instant_test.py +snapshots_api/models/unexpanded_instant_test_links.py +snapshots_api/models/unexpanded_instant_test_links_self.py +snapshots_api/models/unexpanded_instant_test_links_test_results.py +snapshots_api/models/unexpanded_test.py +snapshots_api/py.typed +snapshots_api/rest.py +test-requirements.txt +test/__init__.py +test/test_app_links.py +test/test_app_links_links.py +test/test_create_test_snapshot_api.py +test/test_error.py +test/test_link.py +test/test_self_links.py +test/test_self_links_links.py +test/test_snapshot_links.py +test/test_snapshot_request.py +test/test_snapshot_response.py +test/test_snapshot_response_all_of_test.py +test/test_test_interval.py +test/test_test_type.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 +tox.ini diff --git a/snapshots_api/.openapi-generator/VERSION b/snapshots_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/snapshots_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/snapshots_api/.travis.yml b/snapshots_api/.travis.yml new file mode 100644 index 00000000..f2c4068f --- /dev/null +++ b/snapshots_api/.travis.yml @@ -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=snapshots_api diff --git a/snapshots_api/README.md b/snapshots_api/README.md new file mode 100644 index 00000000..a9e34a85 --- /dev/null +++ b/snapshots_api/README.md @@ -0,0 +1,139 @@ +# snapshots-api +Creates a new test snapshot in ThousandEyes + +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 snapshots_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 snapshots_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 snapshots_api +from snapshots_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 = snapshots_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 = snapshots_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with snapshots_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = snapshots_api.CreateTestSnapshotApi(api_client) + test_id = '281474976710706' # str | Test ID. + snapshot_request = snapshots_api.SnapshotRequest() # SnapshotRequest | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create test snapshot + api_response = api_instance.create_test_snapshot(test_id, snapshot_request, aid=aid) + print("The response of CreateTestSnapshotApi->create_test_snapshot:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling CreateTestSnapshotApi->create_test_snapshot: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateTestSnapshotApi* | [**create_test_snapshot**](docs/CreateTestSnapshotApi.md#create_test_snapshot) | **POST** /v7/tests/{testId}/snapshot | Create test snapshot + + +## Documentation For Models + + - [AppLinks](docs/AppLinks.md) + - [AppLinksLinks](docs/AppLinksLinks.md) + - [Error](docs/Error.md) + - [Link](docs/Link.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [SnapshotLinks](docs/SnapshotLinks.md) + - [SnapshotRequest](docs/SnapshotRequest.md) + - [SnapshotResponse](docs/SnapshotResponse.md) + - [SnapshotResponseAllOfTest](docs/SnapshotResponseAllOfTest.md) + - [TestInterval](docs/TestInterval.md) + - [TestType](docs/TestType.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) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/snapshots_api/docs/AppLinks.md b/snapshots_api/docs/AppLinks.md new file mode 100644 index 00000000..852cd0ed --- /dev/null +++ b/snapshots_api/docs/AppLinks.md @@ -0,0 +1,28 @@ +# AppLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**AppLinksLinks**](AppLinksLinks.md) | | [optional] + +## Example + +```python +from snapshots_api.models.app_links import AppLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of AppLinks from a JSON string +app_links_instance = AppLinks.from_json(json) +# print the JSON string representation of the object +print AppLinks.to_json() + +# convert the object into a dict +app_links_dict = app_links_instance.to_dict() +# create an instance of AppLinks from a dict +app_links_form_dict = app_links.from_dict(app_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/AppLinksLinks.md b/snapshots_api/docs/AppLinksLinks.md new file mode 100644 index 00000000..6ec1adf0 --- /dev/null +++ b/snapshots_api/docs/AppLinksLinks.md @@ -0,0 +1,29 @@ +# AppLinksLinks + +A links object containing the ThousandEyes App link + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_link** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from snapshots_api.models.app_links_links import AppLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of AppLinksLinks from a JSON string +app_links_links_instance = AppLinksLinks.from_json(json) +# print the JSON string representation of the object +print AppLinksLinks.to_json() + +# convert the object into a dict +app_links_links_dict = app_links_links_instance.to_dict() +# create an instance of AppLinksLinks from a dict +app_links_links_form_dict = app_links_links.from_dict(app_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/CreateTestSnapshotApi.md b/snapshots_api/docs/CreateTestSnapshotApi.md new file mode 100644 index 00000000..54b18c12 --- /dev/null +++ b/snapshots_api/docs/CreateTestSnapshotApi.md @@ -0,0 +1,99 @@ +# snapshots_api.CreateTestSnapshotApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_test_snapshot**](CreateTestSnapshotApi.md#create_test_snapshot) | **POST** /v7/tests/{testId}/snapshot | Create test snapshot + + +# **create_test_snapshot** +> SnapshotResponse create_test_snapshot(test_id, snapshot_request, aid=aid) + +Create test snapshot + +This endpoint creates a test snapshot based on the properties provided in the POST data. * To use this endpoint, you need the `Create snapshot shares` permission. * You can create a maximum of 5 snapshots per organization within a 5-minute interval. * Snapshots generated through this endpoint have a 30-day expiration period. * The time range specified with the `from` and `to` parameters must adhere to one of the following intervals: 1, 2, 4, 6, 12, 24, or 48 hours. * The `endDate` field of the snapshot must be set to the present or a past date. **Note**: This endpoint does not support the creation of Endpoint Agent snapshots. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import snapshots_api +from snapshots_api.models.snapshot_request import SnapshotRequest +from snapshots_api.models.snapshot_response import SnapshotResponse +from snapshots_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 = snapshots_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 = snapshots_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with snapshots_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = snapshots_api.CreateTestSnapshotApi(api_client) + test_id = '281474976710706' # str | Test ID. + snapshot_request = snapshots_api.SnapshotRequest() # SnapshotRequest | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create test snapshot + api_response = api_instance.create_test_snapshot(test_id, snapshot_request, aid=aid) + print("The response of CreateTestSnapshotApi->create_test_snapshot:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CreateTestSnapshotApi->create_test_snapshot: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID. | + **snapshot_request** | [**SnapshotRequest**](SnapshotRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**SnapshotResponse**](SnapshotResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/snapshots_api/docs/Error.md b/snapshots_api/docs/Error.md new file mode 100644 index 00000000..a7e1b622 --- /dev/null +++ b/snapshots_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from snapshots_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/Link.md b/snapshots_api/docs/Link.md new file mode 100644 index 00000000..63efbc61 --- /dev/null +++ b/snapshots_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from snapshots_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/SelfLinks.md b/snapshots_api/docs/SelfLinks.md new file mode 100644 index 00000000..d0de20c5 --- /dev/null +++ b/snapshots_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from snapshots_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/SelfLinksLinks.md b/snapshots_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..d06e9041 --- /dev/null +++ b/snapshots_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from snapshots_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/SnapshotLinks.md b/snapshots_api/docs/SnapshotLinks.md new file mode 100644 index 00000000..9f986169 --- /dev/null +++ b/snapshots_api/docs/SnapshotLinks.md @@ -0,0 +1,28 @@ +# SnapshotLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | **object** | | [optional] + +## Example + +```python +from snapshots_api.models.snapshot_links import SnapshotLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SnapshotLinks from a JSON string +snapshot_links_instance = SnapshotLinks.from_json(json) +# print the JSON string representation of the object +print SnapshotLinks.to_json() + +# convert the object into a dict +snapshot_links_dict = snapshot_links_instance.to_dict() +# create an instance of SnapshotLinks from a dict +snapshot_links_form_dict = snapshot_links.from_dict(snapshot_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/SnapshotRequest.md b/snapshots_api/docs/SnapshotRequest.md new file mode 100644 index 00000000..a81fc2fd --- /dev/null +++ b/snapshots_api/docs/SnapshotRequest.md @@ -0,0 +1,31 @@ +# SnapshotRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**display_name** | **str** | Snapshot title. | +**start_date** | **datetime** | The start date for the snapshot in UTC time, formatted in ISO date-time. | +**end_date** | **datetime** | The end date for the snapshot in UTC time, formatted in ISO date-time. | +**is_public** | **bool** | Set to `true` for saved events and `false` for share links. Its default value is `false`. | [optional] + +## Example + +```python +from snapshots_api.models.snapshot_request import SnapshotRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of SnapshotRequest from a JSON string +snapshot_request_instance = SnapshotRequest.from_json(json) +# print the JSON string representation of the object +print SnapshotRequest.to_json() + +# convert the object into a dict +snapshot_request_dict = snapshot_request_instance.to_dict() +# create an instance of SnapshotRequest from a dict +snapshot_request_form_dict = snapshot_request.from_dict(snapshot_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) + + diff --git a/snapshots_api/docs/SnapshotResponse.md b/snapshots_api/docs/SnapshotResponse.md new file mode 100644 index 00000000..4936fcc4 --- /dev/null +++ b/snapshots_api/docs/SnapshotResponse.md @@ -0,0 +1,39 @@ +# SnapshotResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | **object** | | [optional] +**id** | **str** | Snapshot ID. | [optional] +**start_round_id** | **int** | The start time of the test snapshot, represented in epoch time format (in seconds). | [optional] [readonly] +**end_round_id** | **int** | The end time of the test snapshot, represented in epoch time format (in seconds). | [optional] [readonly] +**round_id** | **int** | The selected time of the test snapshot, represented in epoch time format (in seconds). | [optional] [readonly] +**share_date** | **datetime** | The date when the test snapshot was created in UTC time, formatted in ISO date-time. | [optional] +**source_test_id** | **str** | Snapshot test ID. | [optional] +**test_id** | **str** | Snapshot test ID. | [optional] +**uid** | **str** | User ID. | [optional] +**display_name** | **str** | Snapshot title. | [optional] +**extra_params** | **str** | Extra parameters. | [optional] +**test** | [**SnapshotResponseAllOfTest**](SnapshotResponseAllOfTest.md) | | [optional] + +## Example + +```python +from snapshots_api.models.snapshot_response import SnapshotResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SnapshotResponse from a JSON string +snapshot_response_instance = SnapshotResponse.from_json(json) +# print the JSON string representation of the object +print SnapshotResponse.to_json() + +# convert the object into a dict +snapshot_response_dict = snapshot_response_instance.to_dict() +# create an instance of SnapshotResponse from a dict +snapshot_response_form_dict = snapshot_response.from_dict(snapshot_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/SnapshotResponseAllOfTest.md b/snapshots_api/docs/SnapshotResponseAllOfTest.md new file mode 100644 index 00000000..1f75e3ac --- /dev/null +++ b/snapshots_api/docs/SnapshotResponseAllOfTest.md @@ -0,0 +1,41 @@ +# SnapshotResponseAllOfTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | [**TestType**](TestType.md) | | [optional] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] + +## Example + +```python +from snapshots_api.models.snapshot_response_all_of_test import SnapshotResponseAllOfTest + +# TODO update the JSON string below +json = "{}" +# create an instance of SnapshotResponseAllOfTest from a JSON string +snapshot_response_all_of_test_instance = SnapshotResponseAllOfTest.from_json(json) +# print the JSON string representation of the object +print SnapshotResponseAllOfTest.to_json() + +# convert the object into a dict +snapshot_response_all_of_test_dict = snapshot_response_all_of_test_instance.to_dict() +# create an instance of SnapshotResponseAllOfTest from a dict +snapshot_response_all_of_test_form_dict = snapshot_response_all_of_test.from_dict(snapshot_response_all_of_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/TestInterval.md b/snapshots_api/docs/TestInterval.md new file mode 100644 index 00000000..e0e57d69 --- /dev/null +++ b/snapshots_api/docs/TestInterval.md @@ -0,0 +1,11 @@ +# TestInterval + +Interval between test runs in seconds. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/TestType.md b/snapshots_api/docs/TestType.md new file mode 100644 index 00000000..ae5d924e --- /dev/null +++ b/snapshots_api/docs/TestType.md @@ -0,0 +1,11 @@ +# TestType + +This is a read only value, as test type is implicit in the test creation url. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/UnauthorizedError.md b/snapshots_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..06c5d70e --- /dev/null +++ b/snapshots_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from snapshots_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/UnexpandedInstantTest.md b/snapshots_api/docs/UnexpandedInstantTest.md new file mode 100644 index 00000000..73bffb5e --- /dev/null +++ b/snapshots_api/docs/UnexpandedInstantTest.md @@ -0,0 +1,38 @@ +# UnexpandedInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | [**TestType**](TestType.md) | | [optional] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] + +## Example + +```python +from snapshots_api.models.unexpanded_instant_test import UnexpandedInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTest from a JSON string +unexpanded_instant_test_instance = UnexpandedInstantTest.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTest.to_json() + +# convert the object into a dict +unexpanded_instant_test_dict = unexpanded_instant_test_instance.to_dict() +# create an instance of UnexpandedInstantTest from a dict +unexpanded_instant_test_form_dict = unexpanded_instant_test.from_dict(unexpanded_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/UnexpandedInstantTestLinks.md b/snapshots_api/docs/UnexpandedInstantTestLinks.md new file mode 100644 index 00000000..3f143a9e --- /dev/null +++ b/snapshots_api/docs/UnexpandedInstantTestLinks.md @@ -0,0 +1,30 @@ +# UnexpandedInstantTestLinks + +A list of links that can be accessed to get more information + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**UnexpandedInstantTestLinksSelf**](UnexpandedInstantTestLinksSelf.md) | | [optional] +**test_results** | [**UnexpandedInstantTestLinksTestResults**](UnexpandedInstantTestLinksTestResults.md) | | [optional] + +## Example + +```python +from snapshots_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinks from a JSON string +unexpanded_instant_test_links_instance = UnexpandedInstantTestLinks.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinks.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_dict = unexpanded_instant_test_links_instance.to_dict() +# create an instance of UnexpandedInstantTestLinks from a dict +unexpanded_instant_test_links_form_dict = unexpanded_instant_test_links.from_dict(unexpanded_instant_test_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/UnexpandedInstantTestLinksSelf.md b/snapshots_api/docs/UnexpandedInstantTestLinksSelf.md new file mode 100644 index 00000000..b8feeb83 --- /dev/null +++ b/snapshots_api/docs/UnexpandedInstantTestLinksSelf.md @@ -0,0 +1,35 @@ +# UnexpandedInstantTestLinksSelf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from snapshots_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinksSelf from a JSON string +unexpanded_instant_test_links_self_instance = UnexpandedInstantTestLinksSelf.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinksSelf.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_self_dict = unexpanded_instant_test_links_self_instance.to_dict() +# create an instance of UnexpandedInstantTestLinksSelf from a dict +unexpanded_instant_test_links_self_form_dict = unexpanded_instant_test_links_self.from_dict(unexpanded_instant_test_links_self_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/UnexpandedInstantTestLinksTestResults.md b/snapshots_api/docs/UnexpandedInstantTestLinksTestResults.md new file mode 100644 index 00000000..ea9ef068 --- /dev/null +++ b/snapshots_api/docs/UnexpandedInstantTestLinksTestResults.md @@ -0,0 +1,35 @@ +# UnexpandedInstantTestLinksTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from snapshots_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinksTestResults from a JSON string +unexpanded_instant_test_links_test_results_instance = UnexpandedInstantTestLinksTestResults.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinksTestResults.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_test_results_dict = unexpanded_instant_test_links_test_results_instance.to_dict() +# create an instance of UnexpandedInstantTestLinksTestResults from a dict +unexpanded_instant_test_links_test_results_form_dict = unexpanded_instant_test_links_test_results.from_dict(unexpanded_instant_test_links_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/docs/UnexpandedTest.md b/snapshots_api/docs/UnexpandedTest.md new file mode 100644 index 00000000..3382fe77 --- /dev/null +++ b/snapshots_api/docs/UnexpandedTest.md @@ -0,0 +1,30 @@ +# UnexpandedTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] + +## Example + +```python +from snapshots_api.models.unexpanded_test import UnexpandedTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedTest from a JSON string +unexpanded_test_instance = UnexpandedTest.from_json(json) +# print the JSON string representation of the object +print UnexpandedTest.to_json() + +# convert the object into a dict +unexpanded_test_dict = unexpanded_test_instance.to_dict() +# create an instance of UnexpandedTest from a dict +unexpanded_test_form_dict = unexpanded_test.from_dict(unexpanded_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/snapshots_api/git_push.sh b/snapshots_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/snapshots_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/snapshots_api/pyproject.toml b/snapshots_api/pyproject.toml new file mode 100644 index 00000000..ea16197a --- /dev/null +++ b/snapshots_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "snapshots_api" +version = "1.0.0" +description = "Test Snapshots API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Test Snapshots API"] +include = ["snapshots_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/snapshots_api/requirements.txt b/snapshots_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/snapshots_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/snapshots_api/setup.cfg b/snapshots_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/snapshots_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/snapshots_api/setup.py b/snapshots_api/setup.py new file mode 100644 index 00000000..d821361c --- /dev/null +++ b/snapshots_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "snapshots-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Test Snapshots API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Test Snapshots API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + Creates a new test snapshot in ThousandEyes + """, # noqa: E501 + package_data={"snapshots_api": ["py.typed"]}, +) diff --git a/snapshots_api/snapshots_api/__init__.py b/snapshots_api/snapshots_api/__init__.py new file mode 100644 index 00000000..c357f22d --- /dev/null +++ b/snapshots_api/snapshots_api/__init__.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_api.api.create_test_snapshot_api import CreateTestSnapshotApi + +# import ApiClient +from snapshots_api.api_response import ApiResponse +from snapshots_api.api_client import ApiClient +from snapshots_api.configuration import Configuration +from snapshots_api.exceptions import OpenApiException +from snapshots_api.exceptions import ApiTypeError +from snapshots_api.exceptions import ApiValueError +from snapshots_api.exceptions import ApiKeyError +from snapshots_api.exceptions import ApiAttributeError +from snapshots_api.exceptions import ApiException + +# import models into sdk package +from snapshots_api.models.app_links import AppLinks +from snapshots_api.models.app_links_links import AppLinksLinks +from snapshots_api.models.error import Error +from snapshots_api.models.link import Link +from snapshots_api.models.self_links import SelfLinks +from snapshots_api.models.self_links_links import SelfLinksLinks +from snapshots_api.models.snapshot_links import SnapshotLinks +from snapshots_api.models.snapshot_request import SnapshotRequest +from snapshots_api.models.snapshot_response import SnapshotResponse +from snapshots_api.models.snapshot_response_all_of_test import SnapshotResponseAllOfTest +from snapshots_api.models.test_interval import TestInterval +from snapshots_api.models.test_type import TestType +from snapshots_api.models.unauthorized_error import UnauthorizedError +from snapshots_api.models.unexpanded_instant_test import UnexpandedInstantTest +from snapshots_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +from snapshots_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf +from snapshots_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults +from snapshots_api.models.unexpanded_test import UnexpandedTest diff --git a/snapshots_api/snapshots_api/api/__init__.py b/snapshots_api/snapshots_api/api/__init__.py new file mode 100644 index 00000000..f21f668a --- /dev/null +++ b/snapshots_api/snapshots_api/api/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa + +# import apis into api package +from snapshots_api.api.create_test_snapshot_api import CreateTestSnapshotApi + diff --git a/snapshots_api/snapshots_api/api/create_test_snapshot_api.py b/snapshots_api/snapshots_api/api/create_test_snapshot_api.py new file mode 100644 index 00000000..c507df2d --- /dev/null +++ b/snapshots_api/snapshots_api/api/create_test_snapshot_api.py @@ -0,0 +1,382 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_api.models.snapshot_request import SnapshotRequest +from snapshots_api.models.snapshot_response import SnapshotResponse + +from snapshots_api.api_client import ApiClient +from snapshots_api.api_response import ApiResponse +from snapshots_api.rest import RESTResponseType + + +class CreateTestSnapshotApi: + """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 create_test_snapshot( + self, + test_id: Annotated[StrictStr, Field(description="Test ID.")], + snapshot_request: SnapshotRequest, + 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, + ) -> SnapshotResponse: + """Create test snapshot + + This endpoint creates a test snapshot based on the properties provided in the POST data. * To use this endpoint, you need the `Create snapshot shares` permission. * You can create a maximum of 5 snapshots per organization within a 5-minute interval. * Snapshots generated through this endpoint have a 30-day expiration period. * The time range specified with the `from` and `to` parameters must adhere to one of the following intervals: 1, 2, 4, 6, 12, 24, or 48 hours. * The `endDate` field of the snapshot must be set to the present or a past date. **Note**: This endpoint does not support the creation of Endpoint Agent snapshots. + + :param test_id: Test ID. (required) + :type test_id: str + :param snapshot_request: (required) + :type snapshot_request: SnapshotRequest + :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._create_test_snapshot_serialize( + test_id=test_id, + snapshot_request=snapshot_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SnapshotResponse", + '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 create_test_snapshot_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID.")], + snapshot_request: SnapshotRequest, + 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[SnapshotResponse]: + """Create test snapshot + + This endpoint creates a test snapshot based on the properties provided in the POST data. * To use this endpoint, you need the `Create snapshot shares` permission. * You can create a maximum of 5 snapshots per organization within a 5-minute interval. * Snapshots generated through this endpoint have a 30-day expiration period. * The time range specified with the `from` and `to` parameters must adhere to one of the following intervals: 1, 2, 4, 6, 12, 24, or 48 hours. * The `endDate` field of the snapshot must be set to the present or a past date. **Note**: This endpoint does not support the creation of Endpoint Agent snapshots. + + :param test_id: Test ID. (required) + :type test_id: str + :param snapshot_request: (required) + :type snapshot_request: SnapshotRequest + :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._create_test_snapshot_serialize( + test_id=test_id, + snapshot_request=snapshot_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SnapshotResponse", + '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 create_test_snapshot_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID.")], + snapshot_request: SnapshotRequest, + 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: + """Create test snapshot + + This endpoint creates a test snapshot based on the properties provided in the POST data. * To use this endpoint, you need the `Create snapshot shares` permission. * You can create a maximum of 5 snapshots per organization within a 5-minute interval. * Snapshots generated through this endpoint have a 30-day expiration period. * The time range specified with the `from` and `to` parameters must adhere to one of the following intervals: 1, 2, 4, 6, 12, 24, or 48 hours. * The `endDate` field of the snapshot must be set to the present or a past date. **Note**: This endpoint does not support the creation of Endpoint Agent snapshots. + + :param test_id: Test ID. (required) + :type test_id: str + :param snapshot_request: (required) + :type snapshot_request: SnapshotRequest + :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._create_test_snapshot_serialize( + test_id=test_id, + snapshot_request=snapshot_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SnapshotResponse", + '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 _create_test_snapshot_serialize( + self, + test_id, + snapshot_request, + 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 test_id is not None: + _path_params['testId'] = test_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 + if snapshot_request is not None: + _body_params = snapshot_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/tests/{testId}/snapshot', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/snapshots_api/snapshots_api/api_client.py b/snapshots_api/snapshots_api/api_client.py new file mode 100644 index 00000000..b954f189 --- /dev/null +++ b/snapshots_api/snapshots_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_api.configuration import Configuration +from snapshots_api.api_response import ApiResponse +import snapshots_api.models +from snapshots_api import rest +from snapshots_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(snapshots_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) diff --git a/snapshots_api/snapshots_api/api_response.py b/snapshots_api/snapshots_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/snapshots_api/snapshots_api/api_response.py @@ -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 + } diff --git a/snapshots_api/snapshots_api/configuration.py b/snapshots_api/snapshots_api/configuration.py new file mode 100644 index 00000000..743f6d27 --- /dev/null +++ b/snapshots_api/snapshots_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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("snapshots_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 diff --git a/snapshots_api/snapshots_api/exceptions.py b/snapshots_api/snapshots_api/exceptions.py new file mode 100644 index 00000000..5c02bf6f --- /dev/null +++ b/snapshots_api/snapshots_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 diff --git a/snapshots_api/snapshots_api/models/__init__.py b/snapshots_api/snapshots_api/models/__init__.py new file mode 100644 index 00000000..04c1e0a6 --- /dev/null +++ b/snapshots_api/snapshots_api/models/__init__.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +# flake8: noqa +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_api.models.app_links import AppLinks +from snapshots_api.models.app_links_links import AppLinksLinks +from snapshots_api.models.error import Error +from snapshots_api.models.link import Link +from snapshots_api.models.self_links import SelfLinks +from snapshots_api.models.self_links_links import SelfLinksLinks +from snapshots_api.models.snapshot_links import SnapshotLinks +from snapshots_api.models.snapshot_request import SnapshotRequest +from snapshots_api.models.snapshot_response import SnapshotResponse +from snapshots_api.models.snapshot_response_all_of_test import SnapshotResponseAllOfTest +from snapshots_api.models.test_interval import TestInterval +from snapshots_api.models.test_type import TestType +from snapshots_api.models.unauthorized_error import UnauthorizedError +from snapshots_api.models.unexpanded_instant_test import UnexpandedInstantTest +from snapshots_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +from snapshots_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf +from snapshots_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults +from snapshots_api.models.unexpanded_test import UnexpandedTest diff --git a/snapshots_api/snapshots_api/models/app_links.py b/snapshots_api/snapshots_api/models/app_links.py new file mode 100644 index 00000000..d82845f8 --- /dev/null +++ b/snapshots_api/snapshots_api/models/app_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_api.models.app_links_links import AppLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AppLinks(BaseModel): + """ + AppLinks + """ # noqa: E501 + links: Optional[AppLinksLinks] = 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 AppLinks 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 AppLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": AppLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/snapshots_api/snapshots_api/models/app_links_links.py b/snapshots_api/snapshots_api/models/app_links_links.py new file mode 100644 index 00000000..e2c47439 --- /dev/null +++ b/snapshots_api/snapshots_api/models/app_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_api.models.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AppLinksLinks(BaseModel): + """ + A links object containing the ThousandEyes App link + """ # noqa: E501 + app_link: Optional[Link] = Field(default=None, alias="appLink") + __properties: ClassVar[List[str]] = ["appLink"] + + 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 AppLinksLinks 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 app_link + if self.app_link: + _dict['appLink'] = self.app_link.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AppLinksLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "appLink": Link.from_dict(obj.get("appLink")) if obj.get("appLink") is not None else None + }) + return _obj + + diff --git a/snapshots_api/snapshots_api/models/error.py b/snapshots_api/snapshots_api/models/error.py new file mode 100644 index 00000000..ac48f134 --- /dev/null +++ b/snapshots_api/snapshots_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 + + diff --git a/snapshots_api/snapshots_api/models/link.py b/snapshots_api/snapshots_api/models/link.py new file mode 100644 index 00000000..d729116e --- /dev/null +++ b/snapshots_api/snapshots_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 + + diff --git a/snapshots_api/snapshots_api/models/self_links.py b/snapshots_api/snapshots_api/models/self_links.py new file mode 100644 index 00000000..32ab0e23 --- /dev/null +++ b/snapshots_api/snapshots_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_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 + + diff --git a/snapshots_api/snapshots_api/models/self_links_links.py b/snapshots_api/snapshots_api/models/self_links_links.py new file mode 100644 index 00000000..e077841e --- /dev/null +++ b/snapshots_api/snapshots_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_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 + + diff --git a/snapshots_api/snapshots_api/models/snapshot_links.py b/snapshots_api/snapshots_api/models/snapshot_links.py new file mode 100644 index 00000000..b7458747 --- /dev/null +++ b/snapshots_api/snapshots_api/models/snapshot_links.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SnapshotLinks(BaseModel): + """ + SnapshotLinks + """ # noqa: E501 + links: Optional[Any] = 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 SnapshotLinks 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, + ) + # set to None if links (nullable) is None + # and model_fields_set contains the field + if self.links is None and "links" in self.model_fields_set: + _dict['_links'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SnapshotLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": obj.get("_links") + }) + return _obj + + diff --git a/snapshots_api/snapshots_api/models/snapshot_request.py b/snapshots_api/snapshots_api/models/snapshot_request.py new file mode 100644 index 00000000..c1c50ed3 --- /dev/null +++ b/snapshots_api/snapshots_api/models/snapshot_request.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SnapshotRequest(BaseModel): + """ + SnapshotRequest + """ # noqa: E501 + display_name: StrictStr = Field(description="Snapshot title.", alias="displayName") + start_date: datetime = Field(description="The start date for the snapshot in UTC time, formatted in ISO date-time.", alias="startDate") + end_date: datetime = Field(description="The end date for the snapshot in UTC time, formatted in ISO date-time.", alias="endDate") + is_public: Optional[StrictBool] = Field(default=None, description="Set to `true` for saved events and `false` for share links. Its default value is `false`.", alias="isPublic") + __properties: ClassVar[List[str]] = ["displayName", "startDate", "endDate", "isPublic"] + + 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 SnapshotRequest 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 SnapshotRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "displayName": obj.get("displayName"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "isPublic": obj.get("isPublic") + }) + return _obj + + diff --git a/snapshots_api/snapshots_api/models/snapshot_response.py b/snapshots_api/snapshots_api/models/snapshot_response.py new file mode 100644 index 00000000..8e236db8 --- /dev/null +++ b/snapshots_api/snapshots_api/models/snapshot_response.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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, Union +from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import Field +from snapshots_api.models.snapshot_response_all_of_test import SnapshotResponseAllOfTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SnapshotResponse(BaseModel): + """ + SnapshotResponse + """ # noqa: E501 + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + id: Optional[StrictStr] = Field(default=None, description="Snapshot ID.") + start_round_id: Optional[StrictInt] = Field(default=None, description="The start time of the test snapshot, represented in epoch time format (in seconds).", alias="startRoundId") + end_round_id: Optional[StrictInt] = Field(default=None, description="The end time of the test snapshot, represented in epoch time format (in seconds).", alias="endRoundId") + round_id: Optional[StrictInt] = Field(default=None, description="The selected time of the test snapshot, represented in epoch time format (in seconds).", alias="roundId") + share_date: Optional[datetime] = Field(default=None, description="The date when the test snapshot was created in UTC time, formatted in ISO date-time.", alias="shareDate") + source_test_id: Optional[StrictStr] = Field(default=None, description="Snapshot test ID.", alias="sourceTestId") + test_id: Optional[StrictStr] = Field(default=None, description="Snapshot test ID.", alias="testId") + uid: Optional[StrictStr] = Field(default=None, description="User ID.") + display_name: Optional[StrictStr] = Field(default=None, description="Snapshot title.", alias="displayName") + extra_params: Optional[StrictStr] = Field(default=None, description="Extra parameters.", alias="extraParams") + test: Optional[SnapshotResponseAllOfTest] = None + __properties: ClassVar[List[str]] = ["_links", "id", "startRoundId", "endRoundId", "roundId", "shareDate", "sourceTestId", "testId", "uid", "displayName", "extraParams", "test"] + + 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 SnapshotResponse 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={ + "start_round_id", + "end_round_id", + "round_id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SnapshotResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": obj.get("_links"), + "id": obj.get("id"), + "startRoundId": obj.get("startRoundId"), + "endRoundId": obj.get("endRoundId"), + "roundId": obj.get("roundId"), + "shareDate": obj.get("shareDate"), + "sourceTestId": obj.get("sourceTestId"), + "testId": obj.get("testId"), + "uid": obj.get("uid"), + "displayName": obj.get("displayName"), + "extraParams": obj.get("extraParams"), + "test": SnapshotResponseAllOfTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/snapshots_api/snapshots_api/models/snapshot_response_all_of_test.py b/snapshots_api/snapshots_api/models/snapshot_response_all_of_test.py new file mode 100644 index 00000000..0bbcc7e1 --- /dev/null +++ b/snapshots_api/snapshots_api/models/snapshot_response_all_of_test.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_api.models.test_interval import TestInterval +from snapshots_api.models.test_type import TestType +from snapshots_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SnapshotResponseAllOfTest(BaseModel): + """ + SnapshotResponseAllOfTest + """ # 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 SnapshotResponseAllOfTest 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 SnapshotResponseAllOfTest 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 + + diff --git a/snapshots_api/snapshots_api/models/test_interval.py b/snapshots_api/snapshots_api/models/test_interval.py new file mode 100644 index 00000000..41c553e6 --- /dev/null +++ b/snapshots_api/snapshots_api/models/test_interval.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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)) + + diff --git a/snapshots_api/snapshots_api/models/test_type.py b/snapshots_api/snapshots_api/models/test_type.py new file mode 100644 index 00000000..fc784994 --- /dev/null +++ b/snapshots_api/snapshots_api/models/test_type.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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)) + + diff --git a/snapshots_api/snapshots_api/models/unauthorized_error.py b/snapshots_api/snapshots_api/models/unauthorized_error.py new file mode 100644 index 00000000..c64e02f0 --- /dev/null +++ b/snapshots_api/snapshots_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 + + diff --git a/snapshots_api/snapshots_api/models/unexpanded_instant_test.py b/snapshots_api/snapshots_api/models/unexpanded_instant_test.py new file mode 100644 index 00000000..c63b4f3c --- /dev/null +++ b/snapshots_api/snapshots_api/models/unexpanded_instant_test.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_api.models.test_type import TestType +from snapshots_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 + + diff --git a/snapshots_api/snapshots_api/models/unexpanded_instant_test_links.py b/snapshots_api/snapshots_api/models/unexpanded_instant_test_links.py new file mode 100644 index 00000000..6f8889d0 --- /dev/null +++ b/snapshots_api/snapshots_api/models/unexpanded_instant_test_links.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf +from snapshots_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 + + diff --git a/snapshots_api/snapshots_api/models/unexpanded_instant_test_links_self.py b/snapshots_api/snapshots_api/models/unexpanded_instant_test_links_self.py new file mode 100644 index 00000000..d4e440b8 --- /dev/null +++ b/snapshots_api/snapshots_api/models/unexpanded_instant_test_links_self.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 + + diff --git a/snapshots_api/snapshots_api/models/unexpanded_instant_test_links_test_results.py b/snapshots_api/snapshots_api/models/unexpanded_instant_test_links_test_results.py new file mode 100644 index 00000000..72b063e0 --- /dev/null +++ b/snapshots_api/snapshots_api/models/unexpanded_instant_test_links_test_results.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_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()) + + diff --git a/snapshots_api/snapshots_api/models/unexpanded_test.py b/snapshots_api/snapshots_api/models/unexpanded_test.py new file mode 100644 index 00000000..0d4042a5 --- /dev/null +++ b/snapshots_api/snapshots_api/models/unexpanded_test.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_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 + + diff --git a/snapshots_api/snapshots_api/py.typed b/snapshots_api/snapshots_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/snapshots_api/snapshots_api/rest.py b/snapshots_api/snapshots_api/rest.py new file mode 100644 index 00000000..87b5039f --- /dev/null +++ b/snapshots_api/snapshots_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 snapshots_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) diff --git a/snapshots_api/test-requirements.txt b/snapshots_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/snapshots_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/snapshots_api/test/__init__.py b/snapshots_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/snapshots_api/test/test_app_links.py b/snapshots_api/test/test_app_links.py new file mode 100644 index 00000000..4a5ae0ca --- /dev/null +++ b/snapshots_api/test/test_app_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.app_links import AppLinks + +class TestAppLinks(unittest.TestCase): + """AppLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AppLinks: + """Test AppLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AppLinks` + """ + model = AppLinks() + if include_optional: + return AppLinks( + links = snapshots_api.models.app_links__links.AppLinks__links( + app_link = snapshots_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return AppLinks( + ) + """ + + def testAppLinks(self): + """Test AppLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_app_links_links.py b/snapshots_api/test/test_app_links_links.py new file mode 100644 index 00000000..468d5b9d --- /dev/null +++ b/snapshots_api/test/test_app_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.app_links_links import AppLinksLinks + +class TestAppLinksLinks(unittest.TestCase): + """AppLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AppLinksLinks: + """Test AppLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AppLinksLinks` + """ + model = AppLinksLinks() + if include_optional: + return AppLinksLinks( + app_link = snapshots_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return AppLinksLinks( + ) + """ + + def testAppLinksLinks(self): + """Test AppLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_create_test_snapshot_api.py b/snapshots_api/test/test_create_test_snapshot_api.py new file mode 100644 index 00000000..4000593b --- /dev/null +++ b/snapshots_api/test/test_create_test_snapshot_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest + +from snapshots_api.api.create_test_snapshot_api import CreateTestSnapshotApi + + +class TestCreateTestSnapshotApi(unittest.TestCase): + """CreateTestSnapshotApi unit test stubs""" + + def setUp(self) -> None: + self.api = CreateTestSnapshotApi() + + def tearDown(self) -> None: + pass + + def test_create_test_snapshot(self) -> None: + """Test case for create_test_snapshot + + Create test snapshot + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_error.py b/snapshots_api/test/test_error.py new file mode 100644 index 00000000..0364ada0 --- /dev/null +++ b/snapshots_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_link.py b/snapshots_api/test/test_link.py new file mode 100644 index 00000000..7abc3acf --- /dev/null +++ b/snapshots_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_self_links.py b/snapshots_api/test/test_self_links.py new file mode 100644 index 00000000..82673010 --- /dev/null +++ b/snapshots_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = snapshots_api.models.self_links__links.SelfLinks__links( + self = snapshots_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_self_links_links.py b/snapshots_api/test/test_self_links_links.py new file mode 100644 index 00000000..eb9d5fc6 --- /dev/null +++ b/snapshots_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = snapshots_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_snapshot_links.py b/snapshots_api/test/test_snapshot_links.py new file mode 100644 index 00000000..f38e644e --- /dev/null +++ b/snapshots_api/test/test_snapshot_links.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.snapshot_links import SnapshotLinks + +class TestSnapshotLinks(unittest.TestCase): + """SnapshotLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SnapshotLinks: + """Test SnapshotLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SnapshotLinks` + """ + model = SnapshotLinks() + if include_optional: + return SnapshotLinks( + links = {"self":{"href":"http://api.thousandeyes.com/v7/tests/227103/snapshot"},"appLink":{"href":"https://app.stg.thousandeyes.com/view/tests/?testId=227103&__a=105"}} + ) + else: + return SnapshotLinks( + ) + """ + + def testSnapshotLinks(self): + """Test SnapshotLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_snapshot_request.py b/snapshots_api/test/test_snapshot_request.py new file mode 100644 index 00000000..c6d40b2a --- /dev/null +++ b/snapshots_api/test/test_snapshot_request.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.snapshot_request import SnapshotRequest + +class TestSnapshotRequest(unittest.TestCase): + """SnapshotRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SnapshotRequest: + """Test SnapshotRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SnapshotRequest` + """ + model = SnapshotRequest() + if include_optional: + return SnapshotRequest( + display_name = 'Snapshot created through API', + start_date = '2023-06-06T00:00Z', + end_date = '2023-06-06T01:00Z', + is_public = False + ) + else: + return SnapshotRequest( + display_name = 'Snapshot created through API', + start_date = '2023-06-06T00:00Z', + end_date = '2023-06-06T01:00Z', + ) + """ + + def testSnapshotRequest(self): + """Test SnapshotRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_snapshot_response.py b/snapshots_api/test/test_snapshot_response.py new file mode 100644 index 00000000..ed069ae5 --- /dev/null +++ b/snapshots_api/test/test_snapshot_response.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.snapshot_response import SnapshotResponse + +class TestSnapshotResponse(unittest.TestCase): + """SnapshotResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SnapshotResponse: + """Test SnapshotResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SnapshotResponse` + """ + model = SnapshotResponse() + if include_optional: + return SnapshotResponse( + links = {self={href=http://api.thousandeyes.com/v7/tests/227103/snapshot}, appLink={href=https://app.stg.thousandeyes.com/view/tests/?testId=227103&__a=105}}, + id = 'wdiac', + start_round_id = 1538784000, + end_round_id = 1538787600, + round_id = 1538784000, + share_date = '2023-06-06T00:00Z', + source_test_id = '281474976710706', + test_id = '281474976710801', + uid = '281474976810911', + display_name = 'Snapshot created through API', + extra_params = 'params', + test = None + ) + else: + return SnapshotResponse( + ) + """ + + def testSnapshotResponse(self): + """Test SnapshotResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_snapshot_response_all_of_test.py b/snapshots_api/test/test_snapshot_response_all_of_test.py new file mode 100644 index 00000000..1c0920d9 --- /dev/null +++ b/snapshots_api/test/test_snapshot_response_all_of_test.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.snapshot_response_all_of_test import SnapshotResponseAllOfTest + +class TestSnapshotResponseAllOfTest(unittest.TestCase): + """SnapshotResponseAllOfTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SnapshotResponseAllOfTest: + """Test SnapshotResponseAllOfTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SnapshotResponseAllOfTest` + """ + model = SnapshotResponseAllOfTest() + if include_optional: + return SnapshotResponseAllOfTest( + interval = 120, + alerts_enabled = True, + enabled = True, + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = snapshots_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ) + ) + else: + return SnapshotResponseAllOfTest( + ) + """ + + def testSnapshotResponseAllOfTest(self): + """Test SnapshotResponseAllOfTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_test_interval.py b/snapshots_api/test/test_test_interval.py new file mode 100644 index 00000000..87140c15 --- /dev/null +++ b/snapshots_api/test/test_test_interval.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.test_interval import TestInterval + +class TestTestInterval(unittest.TestCase): + """TestInterval unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestInterval(self): + """Test TestInterval""" + # inst = TestInterval() + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_test_type.py b/snapshots_api/test/test_test_type.py new file mode 100644 index 00000000..16b026e2 --- /dev/null +++ b/snapshots_api/test/test_test_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.test_type import TestType + +class TestTestType(unittest.TestCase): + """TestType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestType(self): + """Test TestType""" + # inst = TestType() + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_unauthorized_error.py b/snapshots_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..e9055bb4 --- /dev/null +++ b/snapshots_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_unexpanded_instant_test.py b/snapshots_api/test/test_unexpanded_instant_test.py new file mode 100644 index 00000000..0f8f66df --- /dev/null +++ b/snapshots_api/test/test_unexpanded_instant_test.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.unexpanded_instant_test import UnexpandedInstantTest + +class TestUnexpandedInstantTest(unittest.TestCase): + """UnexpandedInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTest: + """Test UnexpandedInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTest` + """ + model = UnexpandedInstantTest() + if include_optional: + return UnexpandedInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = snapshots_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ) + ) + else: + return UnexpandedInstantTest( + ) + """ + + def testUnexpandedInstantTest(self): + """Test UnexpandedInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_unexpanded_instant_test_links.py b/snapshots_api/test/test_unexpanded_instant_test_links.py new file mode 100644 index 00000000..e181529c --- /dev/null +++ b/snapshots_api/test/test_unexpanded_instant_test_links.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks + +class TestUnexpandedInstantTestLinks(unittest.TestCase): + """UnexpandedInstantTestLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinks: + """Test UnexpandedInstantTestLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinks` + """ + model = UnexpandedInstantTestLinks() + if include_optional: + return UnexpandedInstantTestLinks( + var_self = None, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}] + ) + else: + return UnexpandedInstantTestLinks( + ) + """ + + def testUnexpandedInstantTestLinks(self): + """Test UnexpandedInstantTestLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_unexpanded_instant_test_links_self.py b/snapshots_api/test/test_unexpanded_instant_test_links_self.py new file mode 100644 index 00000000..74099845 --- /dev/null +++ b/snapshots_api/test/test_unexpanded_instant_test_links_self.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf + +class TestUnexpandedInstantTestLinksSelf(unittest.TestCase): + """UnexpandedInstantTestLinksSelf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinksSelf: + """Test UnexpandedInstantTestLinksSelf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinksSelf` + """ + model = UnexpandedInstantTestLinksSelf() + if include_optional: + return UnexpandedInstantTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return UnexpandedInstantTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testUnexpandedInstantTestLinksSelf(self): + """Test UnexpandedInstantTestLinksSelf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_unexpanded_instant_test_links_test_results.py b/snapshots_api/test/test_unexpanded_instant_test_links_test_results.py new file mode 100644 index 00000000..9f5dfc67 --- /dev/null +++ b/snapshots_api/test/test_unexpanded_instant_test_links_test_results.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults + +class TestUnexpandedInstantTestLinksTestResults(unittest.TestCase): + """UnexpandedInstantTestLinksTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinksTestResults: + """Test UnexpandedInstantTestLinksTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinksTestResults` + """ + model = UnexpandedInstantTestLinksTestResults() + if include_optional: + return UnexpandedInstantTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return UnexpandedInstantTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testUnexpandedInstantTestLinksTestResults(self): + """Test UnexpandedInstantTestLinksTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/test/test_unexpanded_test.py b/snapshots_api/test/test_unexpanded_test.py new file mode 100644 index 00000000..afbb9591 --- /dev/null +++ b/snapshots_api/test/test_unexpanded_test.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes + + 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 unittest +import datetime + +from snapshots_api.models.unexpanded_test import UnexpandedTest + +class TestUnexpandedTest(unittest.TestCase): + """UnexpandedTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedTest: + """Test UnexpandedTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedTest` + """ + model = UnexpandedTest() + if include_optional: + return UnexpandedTest( + interval = 120, + alerts_enabled = True, + enabled = True + ) + else: + return UnexpandedTest( + ) + """ + + def testUnexpandedTest(self): + """Test UnexpandedTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/snapshots_api/tox.ini b/snapshots_api/tox.ini new file mode 100644 index 00000000..255d4160 --- /dev/null +++ b/snapshots_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=snapshots_api diff --git a/streaming_api/.github/workflows/python.yml b/streaming_api/.github/workflows/python.yml new file mode 100644 index 00000000..0362e529 --- /dev/null +++ b/streaming_api/.github/workflows/python.yml @@ -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: streaming_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 diff --git a/streaming_api/.gitignore b/streaming_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/streaming_api/.gitignore @@ -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 diff --git a/streaming_api/.gitlab-ci.yml b/streaming_api/.gitlab-ci.yml new file mode 100644 index 00000000..59089144 --- /dev/null +++ b/streaming_api/.gitlab-ci.yml @@ -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=streaming_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 diff --git a/streaming_api/.openapi-generator-ignore b/streaming_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/streaming_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/streaming_api/.openapi-generator/FILES b/streaming_api/.openapi-generator/FILES new file mode 100644 index 00000000..98e25e93 --- /dev/null +++ b/streaming_api/.openapi-generator/FILES @@ -0,0 +1,77 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/ApiError.md +docs/ApiErrorIntegrationLimits.md +docs/AuditOperation.md +docs/AuditOperationWithUpdate.md +docs/BadRequestError.md +docs/CreateStreamResponse.md +docs/EndpointType.md +docs/GetStreamResponse.md +docs/PutStream.md +docs/PutStreamTagMatchInner.md +docs/Stream.md +docs/StreamResponse.md +docs/StreamResponseLinks.md +docs/StreamResponseLinksSelf.md +docs/StreamType.md +docs/StreamingApi.md +docs/TagMatchObjectType.md +docs/UnauthorizedError.md +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +streaming_api/__init__.py +streaming_api/api/__init__.py +streaming_api/api/streaming_api.py +streaming_api/api_client.py +streaming_api/api_response.py +streaming_api/configuration.py +streaming_api/exceptions.py +streaming_api/models/__init__.py +streaming_api/models/api_error.py +streaming_api/models/api_error_integration_limits.py +streaming_api/models/audit_operation.py +streaming_api/models/audit_operation_with_update.py +streaming_api/models/bad_request_error.py +streaming_api/models/create_stream_response.py +streaming_api/models/endpoint_type.py +streaming_api/models/get_stream_response.py +streaming_api/models/put_stream.py +streaming_api/models/put_stream_tag_match_inner.py +streaming_api/models/stream.py +streaming_api/models/stream_response.py +streaming_api/models/stream_response_links.py +streaming_api/models/stream_response_links_self.py +streaming_api/models/stream_type.py +streaming_api/models/tag_match_object_type.py +streaming_api/models/unauthorized_error.py +streaming_api/py.typed +streaming_api/rest.py +test-requirements.txt +test/__init__.py +test/test_api_error.py +test/test_api_error_integration_limits.py +test/test_audit_operation.py +test/test_audit_operation_with_update.py +test/test_bad_request_error.py +test/test_create_stream_response.py +test/test_endpoint_type.py +test/test_get_stream_response.py +test/test_put_stream.py +test/test_put_stream_tag_match_inner.py +test/test_stream.py +test/test_stream_response.py +test/test_stream_response_links.py +test/test_stream_response_links_self.py +test/test_stream_type.py +test/test_streaming_api.py +test/test_tag_match_object_type.py +test/test_unauthorized_error.py +tox.ini diff --git a/streaming_api/.openapi-generator/VERSION b/streaming_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/streaming_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/streaming_api/.travis.yml b/streaming_api/.travis.yml new file mode 100644 index 00000000..55318d2a --- /dev/null +++ b/streaming_api/.travis.yml @@ -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=streaming_api diff --git a/streaming_api/README.md b/streaming_api/README.md new file mode 100644 index 00000000..5e84c9db --- /dev/null +++ b/streaming_api/README.md @@ -0,0 +1,143 @@ +# streaming-api + +Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + +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 streaming_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 streaming_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 streaming_api +from streaming_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 = streaming_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 = streaming_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with streaming_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = streaming_api.StreamingApi(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) + stream = streaming_api.Stream() # Stream | Stream to configure (optional) + + try: + # Create data stream + api_response = api_instance.create_stream(aid=aid, stream=stream) + print("The response of StreamingApi->create_stream:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling StreamingApi->create_stream: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*StreamingApi* | [**create_stream**](docs/StreamingApi.md#create_stream) | **POST** /v7/stream | Create data stream +*StreamingApi* | [**delete_stream**](docs/StreamingApi.md#delete_stream) | **DELETE** /v7/stream/{id} | Delete a data stream +*StreamingApi* | [**get_stream**](docs/StreamingApi.md#get_stream) | **GET** /v7/stream/{id} | Retrieve data stream +*StreamingApi* | [**get_streams**](docs/StreamingApi.md#get_streams) | **GET** /v7/stream | List data streams +*StreamingApi* | [**put_stream**](docs/StreamingApi.md#put_stream) | **PUT** /v7/stream/{id} | Update data stream + + +## Documentation For Models + + - [ApiError](docs/ApiError.md) + - [ApiErrorIntegrationLimits](docs/ApiErrorIntegrationLimits.md) + - [AuditOperation](docs/AuditOperation.md) + - [AuditOperationWithUpdate](docs/AuditOperationWithUpdate.md) + - [BadRequestError](docs/BadRequestError.md) + - [CreateStreamResponse](docs/CreateStreamResponse.md) + - [EndpointType](docs/EndpointType.md) + - [GetStreamResponse](docs/GetStreamResponse.md) + - [PutStream](docs/PutStream.md) + - [PutStreamTagMatchInner](docs/PutStreamTagMatchInner.md) + - [Stream](docs/Stream.md) + - [StreamResponse](docs/StreamResponse.md) + - [StreamResponseLinks](docs/StreamResponseLinks.md) + - [StreamResponseLinksSelf](docs/StreamResponseLinksSelf.md) + - [StreamType](docs/StreamType.md) + - [TagMatchObjectType](docs/TagMatchObjectType.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/streaming_api/docs/ApiError.md b/streaming_api/docs/ApiError.md new file mode 100644 index 00000000..d033866d --- /dev/null +++ b/streaming_api/docs/ApiError.md @@ -0,0 +1,31 @@ +# ApiError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | | [optional] +**status** | **int** | | [optional] +**errors** | **str** | | [optional] +**path** | **str** | | [optional] + +## Example + +```python +from streaming_api.models.api_error import ApiError + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiError from a JSON string +api_error_instance = ApiError.from_json(json) +# print the JSON string representation of the object +print ApiError.to_json() + +# convert the object into a dict +api_error_dict = api_error_instance.to_dict() +# create an instance of ApiError from a dict +api_error_form_dict = api_error.from_dict(api_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/ApiErrorIntegrationLimits.md b/streaming_api/docs/ApiErrorIntegrationLimits.md new file mode 100644 index 00000000..103f9efb --- /dev/null +++ b/streaming_api/docs/ApiErrorIntegrationLimits.md @@ -0,0 +1,31 @@ +# ApiErrorIntegrationLimits + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | | [optional] +**http_status** | **str** | | [optional] +**errors** | **List[str]** | | [optional] +**path** | **str** | | [optional] + +## Example + +```python +from streaming_api.models.api_error_integration_limits import ApiErrorIntegrationLimits + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiErrorIntegrationLimits from a JSON string +api_error_integration_limits_instance = ApiErrorIntegrationLimits.from_json(json) +# print the JSON string representation of the object +print ApiErrorIntegrationLimits.to_json() + +# convert the object into a dict +api_error_integration_limits_dict = api_error_integration_limits_instance.to_dict() +# create an instance of ApiErrorIntegrationLimits from a dict +api_error_integration_limits_form_dict = api_error_integration_limits.from_dict(api_error_integration_limits_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/AuditOperation.md b/streaming_api/docs/AuditOperation.md new file mode 100644 index 00000000..32e8d694 --- /dev/null +++ b/streaming_api/docs/AuditOperation.md @@ -0,0 +1,29 @@ +# AuditOperation + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **int** | ID of the user who created the integration | [optional] +**created_date** | **int** | Creation date of the integration | [optional] + +## Example + +```python +from streaming_api.models.audit_operation import AuditOperation + +# TODO update the JSON string below +json = "{}" +# create an instance of AuditOperation from a JSON string +audit_operation_instance = AuditOperation.from_json(json) +# print the JSON string representation of the object +print AuditOperation.to_json() + +# convert the object into a dict +audit_operation_dict = audit_operation_instance.to_dict() +# create an instance of AuditOperation from a dict +audit_operation_form_dict = audit_operation.from_dict(audit_operation_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/AuditOperationWithUpdate.md b/streaming_api/docs/AuditOperationWithUpdate.md new file mode 100644 index 00000000..22d59929 --- /dev/null +++ b/streaming_api/docs/AuditOperationWithUpdate.md @@ -0,0 +1,31 @@ +# AuditOperationWithUpdate + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **int** | ID of the user who created the integration | [optional] +**created_date** | **int** | Creation date of the integration | [optional] +**updated_by** | **int** | ID of the user who last updated the integration | [optional] +**updated_date** | **int** | Date of the last update to the integration | [optional] + +## Example + +```python +from streaming_api.models.audit_operation_with_update import AuditOperationWithUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of AuditOperationWithUpdate from a JSON string +audit_operation_with_update_instance = AuditOperationWithUpdate.from_json(json) +# print the JSON string representation of the object +print AuditOperationWithUpdate.to_json() + +# convert the object into a dict +audit_operation_with_update_dict = audit_operation_with_update_instance.to_dict() +# create an instance of AuditOperationWithUpdate from a dict +audit_operation_with_update_form_dict = audit_operation_with_update.from_dict(audit_operation_with_update_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/BadRequestError.md b/streaming_api/docs/BadRequestError.md new file mode 100644 index 00000000..4d38dc75 --- /dev/null +++ b/streaming_api/docs/BadRequestError.md @@ -0,0 +1,31 @@ +# BadRequestError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | | [optional] +**http_status** | **str** | | [optional] +**errors** | **List[str]** | | [optional] +**path** | **str** | | [optional] + +## Example + +```python +from streaming_api.models.bad_request_error import BadRequestError + +# TODO update the JSON string below +json = "{}" +# create an instance of BadRequestError from a JSON string +bad_request_error_instance = BadRequestError.from_json(json) +# print the JSON string representation of the object +print BadRequestError.to_json() + +# convert the object into a dict +bad_request_error_dict = bad_request_error_instance.to_dict() +# create an instance of BadRequestError from a dict +bad_request_error_form_dict = bad_request_error.from_dict(bad_request_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/CreateStreamResponse.md b/streaming_api/docs/CreateStreamResponse.md new file mode 100644 index 00000000..89f3bb09 --- /dev/null +++ b/streaming_api/docs/CreateStreamResponse.md @@ -0,0 +1,36 @@ +# CreateStreamResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The data stream ID | [optional] [readonly] +**enabled** | **bool** | Flag to enable or disable the stream integration. | [optional] +**links** | [**StreamResponseLinks**](StreamResponseLinks.md) | | [optional] +**type** | [**StreamType**](StreamType.md) | | [optional] +**endpoint_type** | [**EndpointType**](EndpointType.md) | | [optional] +**stream_endpoint_url** | **str** | The URL ThousandEyes sends data stream to. For a URL to be valid, it needs to: - Be syntactically correct. - Be reachable. - Use the HTTPS protocol. - When using the `grpc` endpointType, streamEndpointUrl cannot contain paths: - Valid . `grpc` - `https://example.com` - Invalid . `grpc` - `https://example.com/collector`. - Valid . `http` - `https://example.com/collector`. - When using the `http` endpointType, the endpoint must match the exact final full URL (including the path if there is one) to which the metrics will be sent. Examples below: - `https://api.honeycomb.io:443/v1/metrics` - `https://ingest.eu0.signalfx.com/v2/datapoint/otlp` | [optional] +**custom_headers** | **Dict[str, str]** | Custom headers | [optional] +**tag_match** | [**List[PutStreamTagMatchInner]**](PutStreamTagMatchInner.md) | A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics. | [optional] +**audit_operation** | [**AuditOperation**](AuditOperation.md) | | [optional] + +## Example + +```python +from streaming_api.models.create_stream_response import CreateStreamResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateStreamResponse from a JSON string +create_stream_response_instance = CreateStreamResponse.from_json(json) +# print the JSON string representation of the object +print CreateStreamResponse.to_json() + +# convert the object into a dict +create_stream_response_dict = create_stream_response_instance.to_dict() +# create an instance of CreateStreamResponse from a dict +create_stream_response_form_dict = create_stream_response.from_dict(create_stream_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/EndpointType.md b/streaming_api/docs/EndpointType.md new file mode 100644 index 00000000..339112bd --- /dev/null +++ b/streaming_api/docs/EndpointType.md @@ -0,0 +1,11 @@ +# EndpointType + +The type of connection used to send data to the endpoint. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/GetStreamResponse.md b/streaming_api/docs/GetStreamResponse.md new file mode 100644 index 00000000..7469d0c8 --- /dev/null +++ b/streaming_api/docs/GetStreamResponse.md @@ -0,0 +1,36 @@ +# GetStreamResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The data stream ID | [optional] [readonly] +**enabled** | **bool** | Flag to enable or disable the stream integration. | [optional] +**links** | [**StreamResponseLinks**](StreamResponseLinks.md) | | [optional] +**type** | [**StreamType**](StreamType.md) | | [optional] +**endpoint_type** | [**EndpointType**](EndpointType.md) | | [optional] +**stream_endpoint_url** | **str** | The URL ThousandEyes sends data stream to. For a URL to be valid, it needs to: - Be syntactically correct. - Be reachable. - Use the HTTPS protocol. - When using the `grpc` endpointType, streamEndpointUrl cannot contain paths: - Valid . `grpc` - `https://example.com` - Invalid . `grpc` - `https://example.com/collector`. - Valid . `http` - `https://example.com/collector`. - When using the `http` endpointType, the endpoint must match the exact final full URL (including the path if there is one) to which the metrics will be sent. Examples below: - `https://api.honeycomb.io:443/v1/metrics` - `https://ingest.eu0.signalfx.com/v2/datapoint/otlp` | [optional] +**custom_headers** | **Dict[str, str]** | Custom headers | [optional] +**tag_match** | [**List[PutStreamTagMatchInner]**](PutStreamTagMatchInner.md) | A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics. | [optional] +**audit_operation** | [**AuditOperationWithUpdate**](AuditOperationWithUpdate.md) | | [optional] + +## Example + +```python +from streaming_api.models.get_stream_response import GetStreamResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of GetStreamResponse from a JSON string +get_stream_response_instance = GetStreamResponse.from_json(json) +# print the JSON string representation of the object +print GetStreamResponse.to_json() + +# convert the object into a dict +get_stream_response_dict = get_stream_response_instance.to_dict() +# create an instance of GetStreamResponse from a dict +get_stream_response_form_dict = get_stream_response.from_dict(get_stream_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/PutStream.md b/streaming_api/docs/PutStream.md new file mode 100644 index 00000000..05870dd6 --- /dev/null +++ b/streaming_api/docs/PutStream.md @@ -0,0 +1,30 @@ +# PutStream + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_headers** | **Dict[str, str]** | Custom headers | [optional] +**tag_match** | [**List[PutStreamTagMatchInner]**](PutStreamTagMatchInner.md) | A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics. | [optional] +**enabled** | **bool** | Flag to enable or disable the stream integration. | [optional] + +## Example + +```python +from streaming_api.models.put_stream import PutStream + +# TODO update the JSON string below +json = "{}" +# create an instance of PutStream from a JSON string +put_stream_instance = PutStream.from_json(json) +# print the JSON string representation of the object +print PutStream.to_json() + +# convert the object into a dict +put_stream_dict = put_stream_instance.to_dict() +# create an instance of PutStream from a dict +put_stream_form_dict = put_stream.from_dict(put_stream_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/PutStreamTagMatchInner.md b/streaming_api/docs/PutStreamTagMatchInner.md new file mode 100644 index 00000000..2a38aa11 --- /dev/null +++ b/streaming_api/docs/PutStreamTagMatchInner.md @@ -0,0 +1,30 @@ +# PutStreamTagMatchInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object_type** | [**TagMatchObjectType**](TagMatchObjectType.md) | | [optional] +**key** | **str** | The name of the tag key to match | [optional] +**value** | **str** | The value of the tag to match | [optional] + +## Example + +```python +from streaming_api.models.put_stream_tag_match_inner import PutStreamTagMatchInner + +# TODO update the JSON string below +json = "{}" +# create an instance of PutStreamTagMatchInner from a JSON string +put_stream_tag_match_inner_instance = PutStreamTagMatchInner.from_json(json) +# print the JSON string representation of the object +print PutStreamTagMatchInner.to_json() + +# convert the object into a dict +put_stream_tag_match_inner_dict = put_stream_tag_match_inner_instance.to_dict() +# create an instance of PutStreamTagMatchInner from a dict +put_stream_tag_match_inner_form_dict = put_stream_tag_match_inner.from_dict(put_stream_tag_match_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/Stream.md b/streaming_api/docs/Stream.md new file mode 100644 index 00000000..77a1fe90 --- /dev/null +++ b/streaming_api/docs/Stream.md @@ -0,0 +1,33 @@ +# Stream + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_headers** | **Dict[str, str]** | Custom headers | [optional] +**tag_match** | [**List[PutStreamTagMatchInner]**](PutStreamTagMatchInner.md) | A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics. | [optional] +**enabled** | **bool** | Flag to enable or disable the stream integration. | [optional] +**type** | [**StreamType**](StreamType.md) | | [optional] +**endpoint_type** | [**EndpointType**](EndpointType.md) | | [optional] +**stream_endpoint_url** | **str** | The URL ThousandEyes sends data stream to. For a URL to be valid, it needs to: - Be syntactically correct. - Be reachable. - Use the HTTPS protocol. - When using the `grpc` endpointType, streamEndpointUrl cannot contain paths: - Valid . `grpc` - `https://example.com` - Invalid . `grpc` - `https://example.com/collector`. - Valid . `http` - `https://example.com/collector`. - When using the `http` endpointType, the endpoint must match the exact final full URL (including the path if there is one) to which the metrics will be sent. Examples below: - `https://api.honeycomb.io:443/v1/metrics` - `https://ingest.eu0.signalfx.com/v2/datapoint/otlp` | [optional] + +## Example + +```python +from streaming_api.models.stream import Stream + +# TODO update the JSON string below +json = "{}" +# create an instance of Stream from a JSON string +stream_instance = Stream.from_json(json) +# print the JSON string representation of the object +print Stream.to_json() + +# convert the object into a dict +stream_dict = stream_instance.to_dict() +# create an instance of Stream from a dict +stream_form_dict = stream.from_dict(stream_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/StreamResponse.md b/streaming_api/docs/StreamResponse.md new file mode 100644 index 00000000..80219a45 --- /dev/null +++ b/streaming_api/docs/StreamResponse.md @@ -0,0 +1,30 @@ +# StreamResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The data stream ID | [optional] [readonly] +**enabled** | **bool** | Flag to indicate if the stream integration is currently enabled. | [optional] [readonly] +**links** | [**StreamResponseLinks**](StreamResponseLinks.md) | | [optional] + +## Example + +```python +from streaming_api.models.stream_response import StreamResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of StreamResponse from a JSON string +stream_response_instance = StreamResponse.from_json(json) +# print the JSON string representation of the object +print StreamResponse.to_json() + +# convert the object into a dict +stream_response_dict = stream_response_instance.to_dict() +# create an instance of StreamResponse from a dict +stream_response_form_dict = stream_response.from_dict(stream_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/StreamResponseLinks.md b/streaming_api/docs/StreamResponseLinks.md new file mode 100644 index 00000000..d21f1b76 --- /dev/null +++ b/streaming_api/docs/StreamResponseLinks.md @@ -0,0 +1,28 @@ +# StreamResponseLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**StreamResponseLinksSelf**](StreamResponseLinksSelf.md) | | [optional] + +## Example + +```python +from streaming_api.models.stream_response_links import StreamResponseLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of StreamResponseLinks from a JSON string +stream_response_links_instance = StreamResponseLinks.from_json(json) +# print the JSON string representation of the object +print StreamResponseLinks.to_json() + +# convert the object into a dict +stream_response_links_dict = stream_response_links_instance.to_dict() +# create an instance of StreamResponseLinks from a dict +stream_response_links_form_dict = stream_response_links.from_dict(stream_response_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/StreamResponseLinksSelf.md b/streaming_api/docs/StreamResponseLinksSelf.md new file mode 100644 index 00000000..eb79e9aa --- /dev/null +++ b/streaming_api/docs/StreamResponseLinksSelf.md @@ -0,0 +1,28 @@ +# StreamResponseLinksSelf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] + +## Example + +```python +from streaming_api.models.stream_response_links_self import StreamResponseLinksSelf + +# TODO update the JSON string below +json = "{}" +# create an instance of StreamResponseLinksSelf from a JSON string +stream_response_links_self_instance = StreamResponseLinksSelf.from_json(json) +# print the JSON string representation of the object +print StreamResponseLinksSelf.to_json() + +# convert the object into a dict +stream_response_links_self_dict = stream_response_links_self_instance.to_dict() +# create an instance of StreamResponseLinksSelf from a dict +stream_response_links_self_form_dict = stream_response_links_self.from_dict(stream_response_links_self_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/StreamType.md b/streaming_api/docs/StreamType.md new file mode 100644 index 00000000..60572484 --- /dev/null +++ b/streaming_api/docs/StreamType.md @@ -0,0 +1,11 @@ +# StreamType + +The type of data stream to configure. Currently, only `opentelemetry` is supported. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/StreamingApi.md b/streaming_api/docs/StreamingApi.md new file mode 100644 index 00000000..450d9c34 --- /dev/null +++ b/streaming_api/docs/StreamingApi.md @@ -0,0 +1,441 @@ +# streaming_api.StreamingApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_stream**](StreamingApi.md#create_stream) | **POST** /v7/stream | Create data stream +[**delete_stream**](StreamingApi.md#delete_stream) | **DELETE** /v7/stream/{id} | Delete a data stream +[**get_stream**](StreamingApi.md#get_stream) | **GET** /v7/stream/{id} | Retrieve data stream +[**get_streams**](StreamingApi.md#get_streams) | **GET** /v7/stream | List data streams +[**put_stream**](StreamingApi.md#put_stream) | **PUT** /v7/stream/{id} | Update data stream + + +# **create_stream** +> CreateStreamResponse create_stream(aid=aid, stream=stream) + +Create data stream + +Creates a new data stream. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import streaming_api +from streaming_api.models.create_stream_response import CreateStreamResponse +from streaming_api.models.stream import Stream +from streaming_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 = streaming_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 = streaming_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with streaming_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = streaming_api.StreamingApi(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) + stream = streaming_api.Stream() # Stream | Stream to configure (optional) + + try: + # Create data stream + api_response = api_instance.create_stream(aid=aid, stream=stream) + print("The response of StreamingApi->create_stream:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling StreamingApi->create_stream: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **stream** | [**Stream**](Stream.md)| Stream to configure | [optional] + +### Return type + +[**CreateStreamResponse**](CreateStreamResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | item created | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**409** | An existing item already exists | - | +**412** | Reached limit on number of streams (maximum 1 data stream per account group) | - | +**500** | Internal Server Error | - | + +[[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) + +# **delete_stream** +> delete_stream(id, aid=aid) + +Delete a data stream + +Deletes a configured data stream using its ID. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import streaming_api +from streaming_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 = streaming_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 = streaming_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with streaming_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = streaming_api.StreamingApi(api_client) + id = 'id_example' # str | ID of stream to query + 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 a data stream + api_instance.delete_stream(id, aid=aid) + except Exception as e: + print("Exception when calling StreamingApi->delete_stream: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| ID of stream to query | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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** | Forbidden | - | +**404** | Not Found | - | +**429** | Too Many Requests | - | +**500** | Internal Server Error | - | + +[[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_stream** +> GetStreamResponse get_stream(id, aid=aid, type=type) + +Retrieve data stream + +Retrieves a configured data stream using its ID. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import streaming_api +from streaming_api.models.get_stream_response import GetStreamResponse +from streaming_api.models.stream_type import StreamType +from streaming_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 = streaming_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 = streaming_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with streaming_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = streaming_api.StreamingApi(api_client) + id = 'id_example' # str | ID of stream to query + 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) + type = streaming_api.StreamType() # StreamType | Optional filter on type of Stream; should match one of Stream `type` enum (optional) + + try: + # Retrieve data stream + api_response = api_instance.get_stream(id, aid=aid, type=type) + print("The response of StreamingApi->get_stream:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling StreamingApi->get_stream: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| ID of stream to query | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **type** | [**StreamType**](.md)| Optional filter on type of Stream; should match one of Stream `type` enum | [optional] + +### Return type + +[**GetStreamResponse**](GetStreamResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/problem+json, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**429** | Too Many Requests | - | +**500** | Internal Server Error | - | + +[[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_streams** +> List[GetStreamResponse] get_streams(aid=aid, type=type) + +List data streams + +Retrieves a list of configured data streams. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import streaming_api +from streaming_api.models.get_stream_response import GetStreamResponse +from streaming_api.models.stream_type import StreamType +from streaming_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 = streaming_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 = streaming_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with streaming_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = streaming_api.StreamingApi(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) + type = streaming_api.StreamType() # StreamType | Optional filter on type of Stream; should match one of Stream `type` enum (optional) + + try: + # List data streams + api_response = api_instance.get_streams(aid=aid, type=type) + print("The response of StreamingApi->get_streams:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling StreamingApi->get_streams: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **type** | [**StreamType**](.md)| Optional filter on type of Stream; should match one of Stream `type` enum | [optional] + +### Return type + +[**List[GetStreamResponse]**](GetStreamResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**429** | Too Many Requests | - | +**500** | Internal Server Error | - | + +[[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) + +# **put_stream** +> GetStreamResponse put_stream(id, aid=aid, put_stream=put_stream) + +Update data stream + +Updates a configured data stream using its ID. The fields are overwritten, not appended. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import streaming_api +from streaming_api.models.get_stream_response import GetStreamResponse +from streaming_api.models.put_stream import PutStream +from streaming_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 = streaming_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 = streaming_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with streaming_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = streaming_api.StreamingApi(api_client) + id = 'id_example' # str | ID of stream to query + 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) + put_stream = streaming_api.PutStream() # PutStream | (optional) + + try: + # Update data stream + api_response = api_instance.put_stream(id, aid=aid, put_stream=put_stream) + print("The response of StreamingApi->put_stream:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling StreamingApi->put_stream: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| ID of stream to query | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **put_stream** | [**PutStream**](PutStream.md)| | [optional] + +### Return type + +[**GetStreamResponse**](GetStreamResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Stream updated | - | +**204** | No content | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**429** | Too Many Requests | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/streaming_api/docs/TagMatchObjectType.md b/streaming_api/docs/TagMatchObjectType.md new file mode 100644 index 00000000..0d9ed32f --- /dev/null +++ b/streaming_api/docs/TagMatchObjectType.md @@ -0,0 +1,11 @@ +# TagMatchObjectType + +The object type of tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/docs/UnauthorizedError.md b/streaming_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..c9a5d6f2 --- /dev/null +++ b/streaming_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from streaming_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/streaming_api/git_push.sh b/streaming_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/streaming_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/streaming_api/pyproject.toml b/streaming_api/pyproject.toml new file mode 100644 index 00000000..695aec14 --- /dev/null +++ b/streaming_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "streaming_api" +version = "1.0.0" +description = "ThousandEyes for OpenTelemetry" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "ThousandEyes for OpenTelemetry"] +include = ["streaming_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/streaming_api/requirements.txt b/streaming_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/streaming_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/streaming_api/setup.cfg b/streaming_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/streaming_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/streaming_api/setup.py b/streaming_api/setup.py new file mode 100644 index 00000000..9e767347 --- /dev/null +++ b/streaming_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "streaming-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="ThousandEyes for OpenTelemetry", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "ThousandEyes for OpenTelemetry"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + """, # noqa: E501 + package_data={"streaming_api": ["py.typed"]}, +) diff --git a/streaming_api/streaming_api/__init__.py b/streaming_api/streaming_api/__init__.py new file mode 100644 index 00000000..48ec3a87 --- /dev/null +++ b/streaming_api/streaming_api/__init__.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +# flake8: noqa + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 streaming_api.api.streaming_api import StreamingApi + +# import ApiClient +from streaming_api.api_response import ApiResponse +from streaming_api.api_client import ApiClient +from streaming_api.configuration import Configuration +from streaming_api.exceptions import OpenApiException +from streaming_api.exceptions import ApiTypeError +from streaming_api.exceptions import ApiValueError +from streaming_api.exceptions import ApiKeyError +from streaming_api.exceptions import ApiAttributeError +from streaming_api.exceptions import ApiException + +# import models into sdk package +from streaming_api.models.api_error import ApiError +from streaming_api.models.api_error_integration_limits import ApiErrorIntegrationLimits +from streaming_api.models.audit_operation import AuditOperation +from streaming_api.models.audit_operation_with_update import AuditOperationWithUpdate +from streaming_api.models.bad_request_error import BadRequestError +from streaming_api.models.create_stream_response import CreateStreamResponse +from streaming_api.models.endpoint_type import EndpointType +from streaming_api.models.get_stream_response import GetStreamResponse +from streaming_api.models.put_stream import PutStream +from streaming_api.models.put_stream_tag_match_inner import PutStreamTagMatchInner +from streaming_api.models.stream import Stream +from streaming_api.models.stream_response import StreamResponse +from streaming_api.models.stream_response_links import StreamResponseLinks +from streaming_api.models.stream_response_links_self import StreamResponseLinksSelf +from streaming_api.models.stream_type import StreamType +from streaming_api.models.tag_match_object_type import TagMatchObjectType +from streaming_api.models.unauthorized_error import UnauthorizedError diff --git a/streaming_api/streaming_api/api/__init__.py b/streaming_api/streaming_api/api/__init__.py new file mode 100644 index 00000000..b1e18630 --- /dev/null +++ b/streaming_api/streaming_api/api/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa + +# import apis into api package +from streaming_api.api.streaming_api import StreamingApi + diff --git a/streaming_api/streaming_api/api/streaming_api.py b/streaming_api/streaming_api/api/streaming_api.py new file mode 100644 index 00000000..8d0b36c6 --- /dev/null +++ b/streaming_api/streaming_api/api/streaming_api.py @@ -0,0 +1,1583 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 streaming_api.models.create_stream_response import CreateStreamResponse +from streaming_api.models.get_stream_response import GetStreamResponse +from streaming_api.models.put_stream import PutStream +from streaming_api.models.stream import Stream +from streaming_api.models.stream_type import StreamType + +from streaming_api.api_client import ApiClient +from streaming_api.api_response import ApiResponse +from streaming_api.rest import RESTResponseType + + +class StreamingApi: + """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 create_stream( + 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, + stream: Annotated[Optional[Stream], Field(description="Stream to configure")] = 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, + ) -> CreateStreamResponse: + """Create data stream + + Creates a new data stream. + + :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 stream: Stream to configure + :type stream: Stream + :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._create_stream_serialize( + aid=aid, + stream=stream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateStreamResponse", + '400': "BadRequestError", + '401': "UnauthorizedError", + '409': None, + '412': "ApiErrorIntegrationLimits", + '500': "ApiError" + + } + 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 create_stream_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, + stream: Annotated[Optional[Stream], Field(description="Stream to configure")] = 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[CreateStreamResponse]: + """Create data stream + + Creates a new data stream. + + :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 stream: Stream to configure + :type stream: Stream + :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._create_stream_serialize( + aid=aid, + stream=stream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateStreamResponse", + '400': "BadRequestError", + '401': "UnauthorizedError", + '409': None, + '412': "ApiErrorIntegrationLimits", + '500': "ApiError" + + } + 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 create_stream_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, + stream: Annotated[Optional[Stream], Field(description="Stream to configure")] = 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: + """Create data stream + + Creates a new data stream. + + :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 stream: Stream to configure + :type stream: Stream + :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._create_stream_serialize( + aid=aid, + stream=stream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateStreamResponse", + '400': "BadRequestError", + '401': "UnauthorizedError", + '409': None, + '412': "ApiErrorIntegrationLimits", + '500': "ApiError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_stream_serialize( + self, + aid, + stream, + _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 + if stream is not None: + _body_params = stream + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/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/stream', + 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 delete_stream( + self, + id: Annotated[StrictStr, Field(description="ID of stream to query")], + 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, + ) -> None: + """Delete a data stream + + Deletes a configured data stream using its ID. + + :param id: ID of stream to query (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_stream_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_stream_with_http_info( + self, + id: Annotated[StrictStr, Field(description="ID of stream to query")], + 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[None]: + """Delete a data stream + + Deletes a configured data stream using its ID. + + :param id: ID of stream to query (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_stream_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_stream_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="ID of stream to query")], + 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: + """Delete a data stream + + Deletes a configured data stream using its ID. + + :param id: ID of stream to query (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_stream_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_stream_serialize( + self, + 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 id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/stream/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_stream( + self, + id: Annotated[StrictStr, Field(description="ID of stream to query")], + 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, + type: Annotated[Optional[StreamType], Field(description="Optional filter on type of Stream; should match one of Stream `type` enum")] = 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, + ) -> GetStreamResponse: + """Retrieve data stream + + Retrieves a configured data stream using its ID. + + :param id: ID of stream to query (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param type: Optional filter on type of Stream; should match one of Stream `type` enum + :type type: StreamType + :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_stream_serialize( + id=id, + aid=aid, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetStreamResponse", + '401': "UnauthorizedError", + '403': None, + '404': None, + '429': None, + '500': "ApiError" + + } + 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_stream_with_http_info( + self, + id: Annotated[StrictStr, Field(description="ID of stream to query")], + 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, + type: Annotated[Optional[StreamType], Field(description="Optional filter on type of Stream; should match one of Stream `type` enum")] = 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[GetStreamResponse]: + """Retrieve data stream + + Retrieves a configured data stream using its ID. + + :param id: ID of stream to query (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param type: Optional filter on type of Stream; should match one of Stream `type` enum + :type type: StreamType + :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_stream_serialize( + id=id, + aid=aid, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetStreamResponse", + '401': "UnauthorizedError", + '403': None, + '404': None, + '429': None, + '500': "ApiError" + + } + 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_stream_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="ID of stream to query")], + 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, + type: Annotated[Optional[StreamType], Field(description="Optional filter on type of Stream; should match one of Stream `type` enum")] = 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 data stream + + Retrieves a configured data stream using its ID. + + :param id: ID of stream to query (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param type: Optional filter on type of Stream; should match one of Stream `type` enum + :type type: StreamType + :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_stream_serialize( + id=id, + aid=aid, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetStreamResponse", + '401': "UnauthorizedError", + '403': None, + '404': None, + '429': None, + '500': "ApiError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_stream_serialize( + self, + id, + aid, + type, + _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 id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if type is not None: + + _query_params.append(('type', type.value)) + + # 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', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/stream/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_streams( + 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, + type: Annotated[Optional[StreamType], Field(description="Optional filter on type of Stream; should match one of Stream `type` enum")] = 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, + ) -> List[GetStreamResponse]: + """List data streams + + Retrieves a list of configured data streams. + + :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 type: Optional filter on type of Stream; should match one of Stream `type` enum + :type type: StreamType + :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_streams_serialize( + aid=aid, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GetStreamResponse]", + '400': "BadRequestError", + '401': "UnauthorizedError", + '403': None, + '404': None, + '429': None, + '500': "ApiError" + + } + 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_streams_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, + type: Annotated[Optional[StreamType], Field(description="Optional filter on type of Stream; should match one of Stream `type` enum")] = 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[List[GetStreamResponse]]: + """List data streams + + Retrieves a list of configured data streams. + + :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 type: Optional filter on type of Stream; should match one of Stream `type` enum + :type type: StreamType + :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_streams_serialize( + aid=aid, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GetStreamResponse]", + '400': "BadRequestError", + '401': "UnauthorizedError", + '403': None, + '404': None, + '429': None, + '500': "ApiError" + + } + 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_streams_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, + type: Annotated[Optional[StreamType], Field(description="Optional filter on type of Stream; should match one of Stream `type` enum")] = 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 data streams + + Retrieves a list of configured data streams. + + :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 type: Optional filter on type of Stream; should match one of Stream `type` enum + :type type: StreamType + :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_streams_serialize( + aid=aid, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GetStreamResponse]", + '400': "BadRequestError", + '401': "UnauthorizedError", + '403': None, + '404': None, + '429': None, + '500': "ApiError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_streams_serialize( + self, + aid, + type, + _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)) + + if type is not None: + + _query_params.append(('type', type.value)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/stream', + 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 put_stream( + self, + id: Annotated[StrictStr, Field(description="ID of stream to query")], + 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, + put_stream: Optional[PutStream] = 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, + ) -> GetStreamResponse: + """Update data stream + + Updates a configured data stream using its ID. The fields are overwritten, not appended. + + :param id: ID of stream to query (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param put_stream: + :type put_stream: PutStream + :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._put_stream_serialize( + id=id, + aid=aid, + put_stream=put_stream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetStreamResponse", + '204': None, + '400': "BadRequestError", + '401': "UnauthorizedError", + '403': None, + '404': None, + '429': None, + '500': "ApiError" + + } + 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 put_stream_with_http_info( + self, + id: Annotated[StrictStr, Field(description="ID of stream to query")], + 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, + put_stream: Optional[PutStream] = 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[GetStreamResponse]: + """Update data stream + + Updates a configured data stream using its ID. The fields are overwritten, not appended. + + :param id: ID of stream to query (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param put_stream: + :type put_stream: PutStream + :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._put_stream_serialize( + id=id, + aid=aid, + put_stream=put_stream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetStreamResponse", + '204': None, + '400': "BadRequestError", + '401': "UnauthorizedError", + '403': None, + '404': None, + '429': None, + '500': "ApiError" + + } + 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 put_stream_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="ID of stream to query")], + 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, + put_stream: Optional[PutStream] = 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: + """Update data stream + + Updates a configured data stream using its ID. The fields are overwritten, not appended. + + :param id: ID of stream to query (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param put_stream: + :type put_stream: PutStream + :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._put_stream_serialize( + id=id, + aid=aid, + put_stream=put_stream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetStreamResponse", + '204': None, + '400': "BadRequestError", + '401': "UnauthorizedError", + '403': None, + '404': None, + '429': None, + '500': "ApiError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _put_stream_serialize( + self, + id, + aid, + put_stream, + _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 id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if put_stream is not None: + _body_params = put_stream + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/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='PUT', + resource_path='/v7/stream/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/streaming_api/streaming_api/api_client.py b/streaming_api/streaming_api/api_client.py new file mode 100644 index 00000000..a8e128a3 --- /dev/null +++ b/streaming_api/streaming_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 streaming_api.configuration import Configuration +from streaming_api.api_response import ApiResponse +import streaming_api.models +from streaming_api import rest +from streaming_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(streaming_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) diff --git a/streaming_api/streaming_api/api_response.py b/streaming_api/streaming_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/streaming_api/streaming_api/api_response.py @@ -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 + } diff --git a/streaming_api/streaming_api/configuration.py b/streaming_api/streaming_api/configuration.py new file mode 100644 index 00000000..899f330c --- /dev/null +++ b/streaming_api/streaming_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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("streaming_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 diff --git a/streaming_api/streaming_api/exceptions.py b/streaming_api/streaming_api/exceptions.py new file mode 100644 index 00000000..ca37dd17 --- /dev/null +++ b/streaming_api/streaming_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 diff --git a/streaming_api/streaming_api/models/__init__.py b/streaming_api/streaming_api/models/__init__.py new file mode 100644 index 00000000..04234b8f --- /dev/null +++ b/streaming_api/streaming_api/models/__init__.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +# flake8: noqa +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 streaming_api.models.api_error import ApiError +from streaming_api.models.api_error_integration_limits import ApiErrorIntegrationLimits +from streaming_api.models.audit_operation import AuditOperation +from streaming_api.models.audit_operation_with_update import AuditOperationWithUpdate +from streaming_api.models.bad_request_error import BadRequestError +from streaming_api.models.create_stream_response import CreateStreamResponse +from streaming_api.models.endpoint_type import EndpointType +from streaming_api.models.get_stream_response import GetStreamResponse +from streaming_api.models.put_stream import PutStream +from streaming_api.models.put_stream_tag_match_inner import PutStreamTagMatchInner +from streaming_api.models.stream import Stream +from streaming_api.models.stream_response import StreamResponse +from streaming_api.models.stream_response_links import StreamResponseLinks +from streaming_api.models.stream_response_links_self import StreamResponseLinksSelf +from streaming_api.models.stream_type import StreamType +from streaming_api.models.tag_match_object_type import TagMatchObjectType +from streaming_api.models.unauthorized_error import UnauthorizedError diff --git a/streaming_api/streaming_api/models/api_error.py b/streaming_api/streaming_api/models/api_error.py new file mode 100644 index 00000000..7aced5f7 --- /dev/null +++ b/streaming_api/streaming_api/models/api_error.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ApiError(BaseModel): + """ + ApiError + """ # noqa: E501 + timestamp: Optional[StrictInt] = None + status: Optional[StrictInt] = None + errors: Optional[StrictStr] = None + path: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["timestamp", "status", "errors", "path"] + + 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 ApiError 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 ApiError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "status": obj.get("status"), + "errors": obj.get("errors"), + "path": obj.get("path") + }) + return _obj + + diff --git a/streaming_api/streaming_api/models/api_error_integration_limits.py b/streaming_api/streaming_api/models/api_error_integration_limits.py new file mode 100644 index 00000000..3b480461 --- /dev/null +++ b/streaming_api/streaming_api/models/api_error_integration_limits.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 ApiErrorIntegrationLimits(BaseModel): + """ + ApiErrorIntegrationLimits + """ # noqa: E501 + timestamp: Optional[StrictInt] = None + http_status: Optional[StrictStr] = Field(default=None, alias="httpStatus") + errors: Optional[List[StrictStr]] = None + path: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["timestamp", "httpStatus", "errors", "path"] + + 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 ApiErrorIntegrationLimits 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 ApiErrorIntegrationLimits from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "httpStatus": obj.get("httpStatus"), + "errors": obj.get("errors"), + "path": obj.get("path") + }) + return _obj + + diff --git a/streaming_api/streaming_api/models/audit_operation.py b/streaming_api/streaming_api/models/audit_operation.py new file mode 100644 index 00000000..fe13f41b --- /dev/null +++ b/streaming_api/streaming_api/models/audit_operation.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AuditOperation(BaseModel): + """ + AuditOperation + """ # noqa: E501 + created_by: Optional[StrictInt] = Field(default=None, description="ID of the user who created the integration", alias="createdBy") + created_date: Optional[StrictInt] = Field(default=None, description="Creation date of the integration", alias="createdDate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate"] + + 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 AuditOperation 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 AuditOperation 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") + }) + return _obj + + diff --git a/streaming_api/streaming_api/models/audit_operation_with_update.py b/streaming_api/streaming_api/models/audit_operation_with_update.py new file mode 100644 index 00000000..c4c04114 --- /dev/null +++ b/streaming_api/streaming_api/models/audit_operation_with_update.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AuditOperationWithUpdate(BaseModel): + """ + AuditOperationWithUpdate + """ # noqa: E501 + created_by: Optional[StrictInt] = Field(default=None, description="ID of the user who created the integration", alias="createdBy") + created_date: Optional[StrictInt] = Field(default=None, description="Creation date of the integration", alias="createdDate") + updated_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated the integration", alias="updatedBy") + updated_date: Optional[StrictInt] = Field(default=None, description="Date of the last update to the integration", alias="updatedDate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "updatedBy", "updatedDate"] + + 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 AuditOperationWithUpdate 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, + ) + # set to None if updated_by (nullable) is None + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: + _dict['updatedBy'] = None + + # set to None if updated_date (nullable) is None + # and model_fields_set contains the field + if self.updated_date is None and "updated_date" in self.model_fields_set: + _dict['updatedDate'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AuditOperationWithUpdate 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"), + "updatedBy": obj.get("updatedBy"), + "updatedDate": obj.get("updatedDate") + }) + return _obj + + diff --git a/streaming_api/streaming_api/models/bad_request_error.py b/streaming_api/streaming_api/models/bad_request_error.py new file mode 100644 index 00000000..cb3ac7c0 --- /dev/null +++ b/streaming_api/streaming_api/models/bad_request_error.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 BadRequestError(BaseModel): + """ + BadRequestError + """ # noqa: E501 + timestamp: Optional[StrictInt] = None + http_status: Optional[StrictStr] = Field(default=None, alias="httpStatus") + errors: Optional[List[StrictStr]] = None + path: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["timestamp", "httpStatus", "errors", "path"] + + 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 BadRequestError 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 BadRequestError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "httpStatus": obj.get("httpStatus"), + "errors": obj.get("errors"), + "path": obj.get("path") + }) + return _obj + + diff --git a/streaming_api/streaming_api/models/create_stream_response.py b/streaming_api/streaming_api/models/create_stream_response.py new file mode 100644 index 00000000..91a3887f --- /dev/null +++ b/streaming_api/streaming_api/models/create_stream_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 streaming_api.models.audit_operation import AuditOperation +from streaming_api.models.endpoint_type import EndpointType +from streaming_api.models.put_stream_tag_match_inner import PutStreamTagMatchInner +from streaming_api.models.stream_response_links import StreamResponseLinks +from streaming_api.models.stream_type import StreamType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class CreateStreamResponse(BaseModel): + """ + CreateStreamResponse + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The data stream ID") + enabled: Optional[StrictBool] = Field(default=None, description="Flag to enable or disable the stream integration.") + links: Optional[StreamResponseLinks] = Field(default=None, alias="_links") + type: Optional[StreamType] = None + endpoint_type: Optional[EndpointType] = Field(default=None, alias="endpointType") + stream_endpoint_url: Optional[StrictStr] = Field(default=None, description="The URL ThousandEyes sends data stream to. For a URL to be valid, it needs to: - Be syntactically correct. - Be reachable. - Use the HTTPS protocol. - When using the `grpc` endpointType, streamEndpointUrl cannot contain paths: - Valid . `grpc` - `https://example.com` - Invalid . `grpc` - `https://example.com/collector`. - Valid . `http` - `https://example.com/collector`. - When using the `http` endpointType, the endpoint must match the exact final full URL (including the path if there is one) to which the metrics will be sent. Examples below: - `https://api.honeycomb.io:443/v1/metrics` - `https://ingest.eu0.signalfx.com/v2/datapoint/otlp`", alias="streamEndpointUrl") + custom_headers: Optional[Dict[str, StrictStr]] = Field(default=None, description="Custom headers", alias="customHeaders") + tag_match: Optional[List[PutStreamTagMatchInner]] = Field(default=None, description="A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics.", alias="tagMatch") + audit_operation: Optional[AuditOperation] = Field(default=None, alias="auditOperation") + __properties: ClassVar[List[str]] = ["id", "enabled", "_links", "type", "endpointType", "streamEndpointUrl", "customHeaders", "tagMatch", "auditOperation"] + + 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 CreateStreamResponse 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={ + "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() + # override the default output from pydantic by calling `to_dict()` of each item in tag_match (list) + _items = [] + if self.tag_match: + for _item in self.tag_match: + if _item: + _items.append(_item.to_dict()) + _dict['tagMatch'] = _items + # override the default output from pydantic by calling `to_dict()` of audit_operation + if self.audit_operation: + _dict['auditOperation'] = self.audit_operation.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of CreateStreamResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "enabled": obj.get("enabled"), + "_links": StreamResponseLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "type": obj.get("type"), + "endpointType": obj.get("endpointType"), + "streamEndpointUrl": obj.get("streamEndpointUrl"), + "customHeaders": obj.get("customHeaders"), + "tagMatch": [PutStreamTagMatchInner.from_dict(_item) for _item in obj.get("tagMatch")] if obj.get("tagMatch") is not None else None, + "auditOperation": AuditOperation.from_dict(obj.get("auditOperation")) if obj.get("auditOperation") is not None else None + }) + return _obj + + diff --git a/streaming_api/streaming_api/models/endpoint_type.py b/streaming_api/streaming_api/models/endpoint_type.py new file mode 100644 index 00000000..9fbb402b --- /dev/null +++ b/streaming_api/streaming_api/models/endpoint_type.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 EndpointType(str, Enum): + """ + The type of connection used to send data to the endpoint. + """ + + """ + allowed enum values + """ + GRPC = 'grpc' + HTTP = 'http' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/streaming_api/streaming_api/models/get_stream_response.py b/streaming_api/streaming_api/models/get_stream_response.py new file mode 100644 index 00000000..4d22d0a6 --- /dev/null +++ b/streaming_api/streaming_api/models/get_stream_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 streaming_api.models.audit_operation_with_update import AuditOperationWithUpdate +from streaming_api.models.endpoint_type import EndpointType +from streaming_api.models.put_stream_tag_match_inner import PutStreamTagMatchInner +from streaming_api.models.stream_response_links import StreamResponseLinks +from streaming_api.models.stream_type import StreamType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetStreamResponse(BaseModel): + """ + GetStreamResponse + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The data stream ID") + enabled: Optional[StrictBool] = Field(default=None, description="Flag to enable or disable the stream integration.") + links: Optional[StreamResponseLinks] = Field(default=None, alias="_links") + type: Optional[StreamType] = None + endpoint_type: Optional[EndpointType] = Field(default=None, alias="endpointType") + stream_endpoint_url: Optional[StrictStr] = Field(default=None, description="The URL ThousandEyes sends data stream to. For a URL to be valid, it needs to: - Be syntactically correct. - Be reachable. - Use the HTTPS protocol. - When using the `grpc` endpointType, streamEndpointUrl cannot contain paths: - Valid . `grpc` - `https://example.com` - Invalid . `grpc` - `https://example.com/collector`. - Valid . `http` - `https://example.com/collector`. - When using the `http` endpointType, the endpoint must match the exact final full URL (including the path if there is one) to which the metrics will be sent. Examples below: - `https://api.honeycomb.io:443/v1/metrics` - `https://ingest.eu0.signalfx.com/v2/datapoint/otlp`", alias="streamEndpointUrl") + custom_headers: Optional[Dict[str, StrictStr]] = Field(default=None, description="Custom headers", alias="customHeaders") + tag_match: Optional[List[PutStreamTagMatchInner]] = Field(default=None, description="A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics.", alias="tagMatch") + audit_operation: Optional[AuditOperationWithUpdate] = Field(default=None, alias="auditOperation") + __properties: ClassVar[List[str]] = ["id", "enabled", "_links", "type", "endpointType", "streamEndpointUrl", "customHeaders", "tagMatch", "auditOperation"] + + 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 GetStreamResponse 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={ + "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() + # override the default output from pydantic by calling `to_dict()` of each item in tag_match (list) + _items = [] + if self.tag_match: + for _item in self.tag_match: + if _item: + _items.append(_item.to_dict()) + _dict['tagMatch'] = _items + # override the default output from pydantic by calling `to_dict()` of audit_operation + if self.audit_operation: + _dict['auditOperation'] = self.audit_operation.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetStreamResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "enabled": obj.get("enabled"), + "_links": StreamResponseLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "type": obj.get("type"), + "endpointType": obj.get("endpointType"), + "streamEndpointUrl": obj.get("streamEndpointUrl"), + "customHeaders": obj.get("customHeaders"), + "tagMatch": [PutStreamTagMatchInner.from_dict(_item) for _item in obj.get("tagMatch")] if obj.get("tagMatch") is not None else None, + "auditOperation": AuditOperationWithUpdate.from_dict(obj.get("auditOperation")) if obj.get("auditOperation") is not None else None + }) + return _obj + + diff --git a/streaming_api/streaming_api/models/put_stream.py b/streaming_api/streaming_api/models/put_stream.py new file mode 100644 index 00000000..6b13ff43 --- /dev/null +++ b/streaming_api/streaming_api/models/put_stream.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 streaming_api.models.put_stream_tag_match_inner import PutStreamTagMatchInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PutStream(BaseModel): + """ + PutStream + """ # noqa: E501 + custom_headers: Optional[Dict[str, StrictStr]] = Field(default=None, description="Custom headers", alias="customHeaders") + tag_match: Optional[List[PutStreamTagMatchInner]] = Field(default=None, description="A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics.", alias="tagMatch") + enabled: Optional[StrictBool] = Field(default=None, description="Flag to enable or disable the stream integration.") + __properties: ClassVar[List[str]] = ["customHeaders", "tagMatch", "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 PutStream 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 tag_match (list) + _items = [] + if self.tag_match: + for _item in self.tag_match: + if _item: + _items.append(_item.to_dict()) + _dict['tagMatch'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PutStream from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "customHeaders": obj.get("customHeaders"), + "tagMatch": [PutStreamTagMatchInner.from_dict(_item) for _item in obj.get("tagMatch")] if obj.get("tagMatch") is not None else None, + "enabled": obj.get("enabled") + }) + return _obj + + diff --git a/streaming_api/streaming_api/models/put_stream_tag_match_inner.py b/streaming_api/streaming_api/models/put_stream_tag_match_inner.py new file mode 100644 index 00000000..cc693d60 --- /dev/null +++ b/streaming_api/streaming_api/models/put_stream_tag_match_inner.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 streaming_api.models.tag_match_object_type import TagMatchObjectType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PutStreamTagMatchInner(BaseModel): + """ + PutStreamTagMatchInner + """ # noqa: E501 + object_type: Optional[TagMatchObjectType] = Field(default=None, alias="objectType") + key: Optional[StrictStr] = Field(default=None, description="The name of the tag key to match") + value: Optional[StrictStr] = Field(default=None, description="The value of the tag to match") + __properties: ClassVar[List[str]] = ["objectType", "key", "value"] + + 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 PutStreamTagMatchInner 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 PutStreamTagMatchInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "objectType": obj.get("objectType"), + "key": obj.get("key"), + "value": obj.get("value") + }) + return _obj + + diff --git a/streaming_api/streaming_api/models/stream.py b/streaming_api/streaming_api/models/stream.py new file mode 100644 index 00000000..9cafedc5 --- /dev/null +++ b/streaming_api/streaming_api/models/stream.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 streaming_api.models.endpoint_type import EndpointType +from streaming_api.models.put_stream_tag_match_inner import PutStreamTagMatchInner +from streaming_api.models.stream_type import StreamType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Stream(BaseModel): + """ + Stream + """ # noqa: E501 + custom_headers: Optional[Dict[str, StrictStr]] = Field(default=None, description="Custom headers", alias="customHeaders") + tag_match: Optional[List[PutStreamTagMatchInner]] = Field(default=None, description="A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics.", alias="tagMatch") + enabled: Optional[StrictBool] = Field(default=None, description="Flag to enable or disable the stream integration.") + type: Optional[StreamType] = None + endpoint_type: Optional[EndpointType] = Field(default=None, alias="endpointType") + stream_endpoint_url: Optional[StrictStr] = Field(default=None, description="The URL ThousandEyes sends data stream to. For a URL to be valid, it needs to: - Be syntactically correct. - Be reachable. - Use the HTTPS protocol. - When using the `grpc` endpointType, streamEndpointUrl cannot contain paths: - Valid . `grpc` - `https://example.com` - Invalid . `grpc` - `https://example.com/collector`. - Valid . `http` - `https://example.com/collector`. - When using the `http` endpointType, the endpoint must match the exact final full URL (including the path if there is one) to which the metrics will be sent. Examples below: - `https://api.honeycomb.io:443/v1/metrics` - `https://ingest.eu0.signalfx.com/v2/datapoint/otlp`", alias="streamEndpointUrl") + __properties: ClassVar[List[str]] = ["customHeaders", "tagMatch", "enabled", "type", "endpointType", "streamEndpointUrl"] + + 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 Stream 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 tag_match (list) + _items = [] + if self.tag_match: + for _item in self.tag_match: + if _item: + _items.append(_item.to_dict()) + _dict['tagMatch'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Stream from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "customHeaders": obj.get("customHeaders"), + "tagMatch": [PutStreamTagMatchInner.from_dict(_item) for _item in obj.get("tagMatch")] if obj.get("tagMatch") is not None else None, + "enabled": obj.get("enabled"), + "type": obj.get("type"), + "endpointType": obj.get("endpointType"), + "streamEndpointUrl": obj.get("streamEndpointUrl") + }) + return _obj + + diff --git a/streaming_api/streaming_api/models/stream_response.py b/streaming_api/streaming_api/models/stream_response.py new file mode 100644 index 00000000..1f2256ce --- /dev/null +++ b/streaming_api/streaming_api/models/stream_response.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 streaming_api.models.stream_response_links import StreamResponseLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class StreamResponse(BaseModel): + """ + StreamResponse + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The data stream ID") + enabled: Optional[StrictBool] = Field(default=None, description="Flag to indicate if the stream integration is currently enabled.") + links: Optional[StreamResponseLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["id", "enabled", "_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 StreamResponse 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={ + "id", + "enabled", + }, + 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 StreamResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "enabled": obj.get("enabled"), + "_links": StreamResponseLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/streaming_api/streaming_api/models/stream_response_links.py b/streaming_api/streaming_api/models/stream_response_links.py new file mode 100644 index 00000000..c5a6991e --- /dev/null +++ b/streaming_api/streaming_api/models/stream_response_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 streaming_api.models.stream_response_links_self import StreamResponseLinksSelf +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class StreamResponseLinks(BaseModel): + """ + StreamResponseLinks + """ # noqa: E501 + var_self: Optional[StreamResponseLinksSelf] = 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 StreamResponseLinks 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 StreamResponseLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": StreamResponseLinksSelf.from_dict(obj.get("self")) if obj.get("self") is not None else None + }) + return _obj + + diff --git a/streaming_api/streaming_api/models/stream_response_links_self.py b/streaming_api/streaming_api/models/stream_response_links_self.py new file mode 100644 index 00000000..d23ca613 --- /dev/null +++ b/streaming_api/streaming_api/models/stream_response_links_self.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 StreamResponseLinksSelf(BaseModel): + """ + StreamResponseLinksSelf + """ # noqa: E501 + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href"] + + 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 StreamResponseLinksSelf 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 StreamResponseLinksSelf 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") + }) + return _obj + + diff --git a/streaming_api/streaming_api/models/stream_type.py b/streaming_api/streaming_api/models/stream_type.py new file mode 100644 index 00000000..86baa968 --- /dev/null +++ b/streaming_api/streaming_api/models/stream_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 StreamType(str, Enum): + """ + The type of data stream to configure. Currently, only `opentelemetry` is supported. + """ + + """ + allowed enum values + """ + OPENTELEMETRY = 'opentelemetry' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of StreamType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/streaming_api/streaming_api/models/tag_match_object_type.py b/streaming_api/streaming_api/models/tag_match_object_type.py new file mode 100644 index 00000000..a7706f59 --- /dev/null +++ b/streaming_api/streaming_api/models/tag_match_object_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 TagMatchObjectType(str, Enum): + """ + The object type of tag + """ + + """ + allowed enum values + """ + TEST = 'test' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TagMatchObjectType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/streaming_api/streaming_api/models/unauthorized_error.py b/streaming_api/streaming_api/models/unauthorized_error.py new file mode 100644 index 00000000..9c743909 --- /dev/null +++ b/streaming_api/streaming_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 + + diff --git a/streaming_api/streaming_api/py.typed b/streaming_api/streaming_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/streaming_api/streaming_api/rest.py b/streaming_api/streaming_api/rest.py new file mode 100644 index 00000000..d3964315 --- /dev/null +++ b/streaming_api/streaming_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 streaming_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) diff --git a/streaming_api/test-requirements.txt b/streaming_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/streaming_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/streaming_api/test/__init__.py b/streaming_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/streaming_api/test/test_api_error.py b/streaming_api/test/test_api_error.py new file mode 100644 index 00000000..c9b83ff3 --- /dev/null +++ b/streaming_api/test/test_api_error.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.api_error import ApiError + +class TestApiError(unittest.TestCase): + """ApiError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiError: + """Test ApiError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiError` + """ + model = ApiError() + if include_optional: + return ApiError( + timestamp = 1679677853573, + status = 500, + errors = 'Internal Server Error', + path = 'https://api.thousandeyes.com/v7/stream' + ) + else: + return ApiError( + ) + """ + + def testApiError(self): + """Test ApiError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_api_error_integration_limits.py b/streaming_api/test/test_api_error_integration_limits.py new file mode 100644 index 00000000..817c0eec --- /dev/null +++ b/streaming_api/test/test_api_error_integration_limits.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.api_error_integration_limits import ApiErrorIntegrationLimits + +class TestApiErrorIntegrationLimits(unittest.TestCase): + """ApiErrorIntegrationLimits unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiErrorIntegrationLimits: + """Test ApiErrorIntegrationLimits + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiErrorIntegrationLimits` + """ + model = ApiErrorIntegrationLimits() + if include_optional: + return ApiErrorIntegrationLimits( + timestamp = 1679677853573, + http_status = 'PRECONDITION_FAILED', + errors = [ + 'User cannot create more than 5 integrations' + ], + path = 'https://api.thousandeyes.com/v7/stream' + ) + else: + return ApiErrorIntegrationLimits( + ) + """ + + def testApiErrorIntegrationLimits(self): + """Test ApiErrorIntegrationLimits""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_audit_operation.py b/streaming_api/test/test_audit_operation.py new file mode 100644 index 00000000..ec0c73ae --- /dev/null +++ b/streaming_api/test/test_audit_operation.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.audit_operation import AuditOperation + +class TestAuditOperation(unittest.TestCase): + """AuditOperation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AuditOperation: + """Test AuditOperation + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AuditOperation` + """ + model = AuditOperation() + if include_optional: + return AuditOperation( + created_by = 3962, + created_date = 1679677853573 + ) + else: + return AuditOperation( + ) + """ + + def testAuditOperation(self): + """Test AuditOperation""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_audit_operation_with_update.py b/streaming_api/test/test_audit_operation_with_update.py new file mode 100644 index 00000000..f15aa5af --- /dev/null +++ b/streaming_api/test/test_audit_operation_with_update.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.audit_operation_with_update import AuditOperationWithUpdate + +class TestAuditOperationWithUpdate(unittest.TestCase): + """AuditOperationWithUpdate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AuditOperationWithUpdate: + """Test AuditOperationWithUpdate + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AuditOperationWithUpdate` + """ + model = AuditOperationWithUpdate() + if include_optional: + return AuditOperationWithUpdate( + created_by = 3962, + created_date = 1679677853573, + updated_by = 3962, + updated_date = 1679677853573 + ) + else: + return AuditOperationWithUpdate( + ) + """ + + def testAuditOperationWithUpdate(self): + """Test AuditOperationWithUpdate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_bad_request_error.py b/streaming_api/test/test_bad_request_error.py new file mode 100644 index 00000000..083c9c9b --- /dev/null +++ b/streaming_api/test/test_bad_request_error.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.bad_request_error import BadRequestError + +class TestBadRequestError(unittest.TestCase): + """BadRequestError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BadRequestError: + """Test BadRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BadRequestError` + """ + model = BadRequestError() + if include_optional: + return BadRequestError( + timestamp = 1679677853573, + http_status = 'BAD_REQUEST', + errors = [ + 'JSON parse error: invalid type' + ], + path = 'https://api.thousandeyes.com/v7/stream' + ) + else: + return BadRequestError( + ) + """ + + def testBadRequestError(self): + """Test BadRequestError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_create_stream_response.py b/streaming_api/test/test_create_stream_response.py new file mode 100644 index 00000000..86878ffb --- /dev/null +++ b/streaming_api/test/test_create_stream_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.create_stream_response import CreateStreamResponse + +class TestCreateStreamResponse(unittest.TestCase): + """CreateStreamResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateStreamResponse: + """Test CreateStreamResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateStreamResponse` + """ + model = CreateStreamResponse() + if include_optional: + return CreateStreamResponse( + id = '342ieu09', + enabled = False, + links = streaming_api.models.stream_response__links.StreamResponse__links( + self = streaming_api.models.stream_response__links_self.StreamResponse__links_self( + href = 'https://api.thousandeyes.com/v7/streams/575766da-9664-4e85-94fe-facbe1154799', ), ), + type = 'opentelemetry', + endpoint_type = 'grpc', + stream_endpoint_url = 'https://api.thousandeyes.otel-collector', + custom_headers = {Authorization=*****, Content-Type=*****}, + tag_match = [{objectType=test, key=keyA, value=valueA}, {objectType=test, key=keyB, value=valueB}], + audit_operation = streaming_api.models.audit_operation.AuditOperation( + created_by = 3962, + created_date = 1679677853573, ) + ) + else: + return CreateStreamResponse( + ) + """ + + def testCreateStreamResponse(self): + """Test CreateStreamResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_endpoint_type.py b/streaming_api/test/test_endpoint_type.py new file mode 100644 index 00000000..34024358 --- /dev/null +++ b/streaming_api/test/test_endpoint_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.endpoint_type import EndpointType + +class TestEndpointType(unittest.TestCase): + """EndpointType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointType(self): + """Test EndpointType""" + # inst = EndpointType() + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_get_stream_response.py b/streaming_api/test/test_get_stream_response.py new file mode 100644 index 00000000..bfc33e7f --- /dev/null +++ b/streaming_api/test/test_get_stream_response.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.get_stream_response import GetStreamResponse + +class TestGetStreamResponse(unittest.TestCase): + """GetStreamResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetStreamResponse: + """Test GetStreamResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetStreamResponse` + """ + model = GetStreamResponse() + if include_optional: + return GetStreamResponse( + id = '342ieu09', + enabled = False, + links = streaming_api.models.stream_response__links.StreamResponse__links( + self = streaming_api.models.stream_response__links_self.StreamResponse__links_self( + href = 'https://api.thousandeyes.com/v7/streams/575766da-9664-4e85-94fe-facbe1154799', ), ), + type = 'opentelemetry', + endpoint_type = 'grpc', + stream_endpoint_url = 'https://api.thousandeyes.otel-collector', + custom_headers = {Authorization=*****, Content-Type=*****}, + tag_match = [{objectType=test, key=keyA, value=valueA}, {objectType=test, key=keyB, value=valueB}], + audit_operation = None + ) + else: + return GetStreamResponse( + ) + """ + + def testGetStreamResponse(self): + """Test GetStreamResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_put_stream.py b/streaming_api/test/test_put_stream.py new file mode 100644 index 00000000..a8c78046 --- /dev/null +++ b/streaming_api/test/test_put_stream.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.put_stream import PutStream + +class TestPutStream(unittest.TestCase): + """PutStream unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PutStream: + """Test PutStream + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PutStream` + """ + model = PutStream() + if include_optional: + return PutStream( + custom_headers = {"Authorization":"*****","Content-Type":"*****"}, + tag_match = [{"objectType":"test","key":"keyA","value":"valueA"},{"objectType":"test","key":"keyB","value":"valueB"}], + enabled = False + ) + else: + return PutStream( + ) + """ + + def testPutStream(self): + """Test PutStream""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_put_stream_tag_match_inner.py b/streaming_api/test/test_put_stream_tag_match_inner.py new file mode 100644 index 00000000..c8fb0b11 --- /dev/null +++ b/streaming_api/test/test_put_stream_tag_match_inner.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.put_stream_tag_match_inner import PutStreamTagMatchInner + +class TestPutStreamTagMatchInner(unittest.TestCase): + """PutStreamTagMatchInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PutStreamTagMatchInner: + """Test PutStreamTagMatchInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PutStreamTagMatchInner` + """ + model = PutStreamTagMatchInner() + if include_optional: + return PutStreamTagMatchInner( + object_type = 'test', + key = 'keyA', + value = 'valueA' + ) + else: + return PutStreamTagMatchInner( + ) + """ + + def testPutStreamTagMatchInner(self): + """Test PutStreamTagMatchInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_stream.py b/streaming_api/test/test_stream.py new file mode 100644 index 00000000..058d1356 --- /dev/null +++ b/streaming_api/test/test_stream.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.stream import Stream + +class TestStream(unittest.TestCase): + """Stream unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Stream: + """Test Stream + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Stream` + """ + model = Stream() + if include_optional: + return Stream( + custom_headers = {Authorization=*****, Content-Type=*****}, + tag_match = [{objectType=test, key=keyA, value=valueA}, {objectType=test, key=keyB, value=valueB}], + enabled = False, + type = 'opentelemetry', + endpoint_type = 'grpc', + stream_endpoint_url = 'https://api.thousandeyes.otel-collector' + ) + else: + return Stream( + ) + """ + + def testStream(self): + """Test Stream""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_stream_response.py b/streaming_api/test/test_stream_response.py new file mode 100644 index 00000000..ba56e19b --- /dev/null +++ b/streaming_api/test/test_stream_response.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.stream_response import StreamResponse + +class TestStreamResponse(unittest.TestCase): + """StreamResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StreamResponse: + """Test StreamResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `StreamResponse` + """ + model = StreamResponse() + if include_optional: + return StreamResponse( + id = '342ieu09', + enabled = False, + links = streaming_api.models.stream_response__links.StreamResponse__links( + self = streaming_api.models.stream_response__links_self.StreamResponse__links_self( + href = 'https://api.thousandeyes.com/v7/streams/575766da-9664-4e85-94fe-facbe1154799', ), ) + ) + else: + return StreamResponse( + ) + """ + + def testStreamResponse(self): + """Test StreamResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_stream_response_links.py b/streaming_api/test/test_stream_response_links.py new file mode 100644 index 00000000..1418ab07 --- /dev/null +++ b/streaming_api/test/test_stream_response_links.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.stream_response_links import StreamResponseLinks + +class TestStreamResponseLinks(unittest.TestCase): + """StreamResponseLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StreamResponseLinks: + """Test StreamResponseLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `StreamResponseLinks` + """ + model = StreamResponseLinks() + if include_optional: + return StreamResponseLinks( + var_self = streaming_api.models.stream_response__links_self.StreamResponse__links_self( + href = 'https://api.thousandeyes.com/v7/streams/575766da-9664-4e85-94fe-facbe1154799', ) + ) + else: + return StreamResponseLinks( + ) + """ + + def testStreamResponseLinks(self): + """Test StreamResponseLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_stream_response_links_self.py b/streaming_api/test/test_stream_response_links_self.py new file mode 100644 index 00000000..2af38e39 --- /dev/null +++ b/streaming_api/test/test_stream_response_links_self.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.stream_response_links_self import StreamResponseLinksSelf + +class TestStreamResponseLinksSelf(unittest.TestCase): + """StreamResponseLinksSelf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StreamResponseLinksSelf: + """Test StreamResponseLinksSelf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `StreamResponseLinksSelf` + """ + model = StreamResponseLinksSelf() + if include_optional: + return StreamResponseLinksSelf( + href = 'https://api.thousandeyes.com/v7/streams/575766da-9664-4e85-94fe-facbe1154799' + ) + else: + return StreamResponseLinksSelf( + ) + """ + + def testStreamResponseLinksSelf(self): + """Test StreamResponseLinksSelf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_stream_type.py b/streaming_api/test/test_stream_type.py new file mode 100644 index 00000000..bf89b092 --- /dev/null +++ b/streaming_api/test/test_stream_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.stream_type import StreamType + +class TestStreamType(unittest.TestCase): + """StreamType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStreamType(self): + """Test StreamType""" + # inst = StreamType() + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_streaming_api.py b/streaming_api/test/test_streaming_api.py new file mode 100644 index 00000000..563e1b3c --- /dev/null +++ b/streaming_api/test/test_streaming_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest + +from streaming_api.api.streaming_api import StreamingApi + + +class TestStreamingApi(unittest.TestCase): + """StreamingApi unit test stubs""" + + def setUp(self) -> None: + self.api = StreamingApi() + + def tearDown(self) -> None: + pass + + def test_create_stream(self) -> None: + """Test case for create_stream + + Create data stream + """ + pass + + def test_delete_stream(self) -> None: + """Test case for delete_stream + + Delete a data stream + """ + pass + + def test_get_stream(self) -> None: + """Test case for get_stream + + Retrieve data stream + """ + pass + + def test_get_streams(self) -> None: + """Test case for get_streams + + List data streams + """ + pass + + def test_put_stream(self) -> None: + """Test case for put_stream + + Update data stream + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_tag_match_object_type.py b/streaming_api/test/test_tag_match_object_type.py new file mode 100644 index 00000000..e9b79f0d --- /dev/null +++ b/streaming_api/test/test_tag_match_object_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.tag_match_object_type import TagMatchObjectType + +class TestTagMatchObjectType(unittest.TestCase): + """TagMatchObjectType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTagMatchObjectType(self): + """Test TagMatchObjectType""" + # inst = TagMatchObjectType() + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/test/test_unauthorized_error.py b/streaming_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..23af6b05 --- /dev/null +++ b/streaming_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry + + Configure ThousandEyes to stream or push test data to a OpenTelemetry compliant endpoint with the ThousandEyes for OpenTelemetry API. + + 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 unittest +import datetime + +from streaming_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/streaming_api/tox.ini b/streaming_api/tox.ini new file mode 100644 index 00000000..f0261f8b --- /dev/null +++ b/streaming_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=streaming_api diff --git a/test_results_api/.github/workflows/python.yml b/test_results_api/.github/workflows/python.yml new file mode 100644 index 00000000..f2ad1718 --- /dev/null +++ b/test_results_api/.github/workflows/python.yml @@ -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: test_results_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 diff --git a/test_results_api/.gitignore b/test_results_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/test_results_api/.gitignore @@ -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 diff --git a/test_results_api/.gitlab-ci.yml b/test_results_api/.gitlab-ci.yml new file mode 100644 index 00000000..90ae7365 --- /dev/null +++ b/test_results_api/.gitlab-ci.yml @@ -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=test_results_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 diff --git a/test_results_api/.openapi-generator-ignore b/test_results_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/test_results_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/test_results_api/.openapi-generator/FILES b/test_results_api/.openapi-generator/FILES new file mode 100644 index 00000000..64d2ff35 --- /dev/null +++ b/test_results_api/.openapi-generator/FILES @@ -0,0 +1,317 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/Agent.md +docs/AppLinks.md +docs/AppLinksLinks.md +docs/BgpBasicTestResult.md +docs/BgpHop.md +docs/BgpTestResult.md +docs/BgpTestResults.md +docs/BgpTestRouteInformationResult.md +docs/BgpTestRouteInformationResults.md +docs/DNSSECTestMetricsApi.md +docs/DNSServerTestMetricsApi.md +docs/DNSTraceTestMetricsApi.md +docs/DnsServerTestResult.md +docs/DnsServerTestResults.md +docs/DnsTraceTestResult.md +docs/DnsTraceTestResults.md +docs/DnssecTestResult.md +docs/DnssecTestResults.md +docs/EpochTimeWindow.md +docs/Error.md +docs/Expand.md +docs/FtpServerTestResult.md +docs/FtpServerTestResults.md +docs/GetTestPathvisAgentRound200Response.md +docs/GetTestResultDnsServer200Response.md +docs/GetTestResultDnsTrace200Response.md +docs/GetTestResultDnssec200Response.md +docs/GetTestResultFtpServer200Response.md +docs/GetTestResultHttpServer200Response.md +docs/GetTestResultMetrics200Response.md +docs/GetTestResultNetworkPathvis200Response.md +docs/GetTestResultPageLoad200Response.md +docs/GetTestResultPageLoadComponentDetail200Response.md +docs/GetTestResultRtpStream200Response.md +docs/GetTestResultSipServer200Response.md +docs/GetTestResultWebTransactions200Response.md +docs/GetTestResultWebTransactionsComponentDetail200Response.md +docs/GetTestResultWebTransactionsComponentPageDetail200Response.md +docs/GetTestResultsBgp200Response.md +docs/GetTestResultsBgpPrefix200Response.md +docs/HttpTestResult.md +docs/HttpTestResultHeaders.md +docs/HttpTestResults.md +docs/Link.md +docs/Marker.md +docs/Monitor.md +docs/NetworkBGPTestMetricsApi.md +docs/NetworkTestMetricsApi.md +docs/NetworkTestResult.md +docs/NetworkTestResults.md +docs/Page.md +docs/PageLoadDetailTestResult.md +docs/PageLoadDetailTestResults.md +docs/PageLoadTestResult.md +docs/PageLoadTestResults.md +docs/PaginationLinks.md +docs/PaginationLinksLinks.md +docs/PathVisBaseTestResult.md +docs/PathVisDetailTestResult.md +docs/PathVisDetailTestResults.md +docs/PathVisEndpoint.md +docs/PathVisHop.md +docs/PathVisRoute.md +docs/PathVisTestResult.md +docs/PathVisTestResults.md +docs/QueryWindow.md +docs/RtpStreamTestResult.md +docs/RtpStreamTestResults.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/SimpleTest.md +docs/SipServerErrorType.md +docs/SipServerTestResult.md +docs/SipServerTestResults.md +docs/SslCert.md +docs/TestDirection.md +docs/TestInterval.md +docs/TestResult.md +docs/TestResultAppLinks.md +docs/TestType.md +docs/UnauthorizedError.md +docs/UnexpandedInstantTest.md +docs/UnexpandedInstantTestLinks.md +docs/UnexpandedInstantTestLinksSelf.md +docs/UnexpandedInstantTestLinksTestResults.md +docs/UnexpandedTest.md +docs/VoiceRTPServerTestMetricsApi.md +docs/VoiceSIPServerTestMetricsApi.md +docs/WebFTPServerTestMetricsApi.md +docs/WebHTTPServerTestMetricsApi.md +docs/WebPageLoadTestMetricsApi.md +docs/WebTransactionDetailTestResult.md +docs/WebTransactionDetailTestResults.md +docs/WebTransactionPageDetailTestResult.md +docs/WebTransactionPageDetailTestResults.md +docs/WebTransactionTestResult.md +docs/WebTransactionTestResults.md +docs/WebTransactionsTestMetricsApi.md +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_agent.py +test/test_app_links.py +test/test_app_links_links.py +test/test_bgp_basic_test_result.py +test/test_bgp_hop.py +test/test_bgp_test_result.py +test/test_bgp_test_results.py +test/test_bgp_test_route_information_result.py +test/test_bgp_test_route_information_results.py +test/test_dns_server_test_metrics_api.py +test/test_dns_server_test_result.py +test/test_dns_server_test_results.py +test/test_dns_trace_test_metrics_api.py +test/test_dns_trace_test_result.py +test/test_dns_trace_test_results.py +test/test_dnssec_test_metrics_api.py +test/test_dnssec_test_result.py +test/test_dnssec_test_results.py +test/test_epoch_time_window.py +test/test_error.py +test/test_expand.py +test/test_ftp_server_test_result.py +test/test_ftp_server_test_results.py +test/test_get_test_pathvis_agent_round200_response.py +test/test_get_test_result_dns_server200_response.py +test/test_get_test_result_dns_trace200_response.py +test/test_get_test_result_dnssec200_response.py +test/test_get_test_result_ftp_server200_response.py +test/test_get_test_result_http_server200_response.py +test/test_get_test_result_metrics200_response.py +test/test_get_test_result_network_pathvis200_response.py +test/test_get_test_result_page_load200_response.py +test/test_get_test_result_page_load_component_detail200_response.py +test/test_get_test_result_rtp_stream200_response.py +test/test_get_test_result_sip_server200_response.py +test/test_get_test_result_web_transactions200_response.py +test/test_get_test_result_web_transactions_component_detail200_response.py +test/test_get_test_result_web_transactions_component_page_detail200_response.py +test/test_get_test_results_bgp200_response.py +test/test_get_test_results_bgp_prefix200_response.py +test/test_http_test_result.py +test/test_http_test_result_headers.py +test/test_http_test_results.py +test/test_link.py +test/test_marker.py +test/test_monitor.py +test/test_network_bgp_test_metrics_api.py +test/test_network_test_metrics_api.py +test/test_network_test_result.py +test/test_network_test_results.py +test/test_page.py +test/test_page_load_detail_test_result.py +test/test_page_load_detail_test_results.py +test/test_page_load_test_result.py +test/test_page_load_test_results.py +test/test_pagination_links.py +test/test_pagination_links_links.py +test/test_path_vis_base_test_result.py +test/test_path_vis_detail_test_result.py +test/test_path_vis_detail_test_results.py +test/test_path_vis_endpoint.py +test/test_path_vis_hop.py +test/test_path_vis_route.py +test/test_path_vis_test_result.py +test/test_path_vis_test_results.py +test/test_query_window.py +test/test_rtp_stream_test_result.py +test/test_rtp_stream_test_results.py +test/test_self_links.py +test/test_self_links_links.py +test/test_simple_test.py +test/test_sip_server_error_type.py +test/test_sip_server_test_result.py +test/test_sip_server_test_results.py +test/test_ssl_cert.py +test/test_test_direction.py +test/test_test_interval.py +test/test_test_result.py +test/test_test_result_app_links.py +test/test_test_type.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_voice_rtp_server_test_metrics_api.py +test/test_voice_sip_server_test_metrics_api.py +test/test_web_ftp_server_test_metrics_api.py +test/test_web_http_server_test_metrics_api.py +test/test_web_page_load_test_metrics_api.py +test/test_web_transaction_detail_test_result.py +test/test_web_transaction_detail_test_results.py +test/test_web_transaction_page_detail_test_result.py +test/test_web_transaction_page_detail_test_results.py +test/test_web_transaction_test_result.py +test/test_web_transaction_test_results.py +test/test_web_transactions_test_metrics_api.py +test_results_api/__init__.py +test_results_api/api/__init__.py +test_results_api/api/dns_server_test_metrics_api.py +test_results_api/api/dns_trace_test_metrics_api.py +test_results_api/api/dnssec_test_metrics_api.py +test_results_api/api/network_bgp_test_metrics_api.py +test_results_api/api/network_test_metrics_api.py +test_results_api/api/voice_rtp_server_test_metrics_api.py +test_results_api/api/voice_sip_server_test_metrics_api.py +test_results_api/api/web_ftp_server_test_metrics_api.py +test_results_api/api/web_http_server_test_metrics_api.py +test_results_api/api/web_page_load_test_metrics_api.py +test_results_api/api/web_transactions_test_metrics_api.py +test_results_api/api_client.py +test_results_api/api_response.py +test_results_api/configuration.py +test_results_api/exceptions.py +test_results_api/models/__init__.py +test_results_api/models/agent.py +test_results_api/models/app_links.py +test_results_api/models/app_links_links.py +test_results_api/models/bgp_basic_test_result.py +test_results_api/models/bgp_hop.py +test_results_api/models/bgp_test_result.py +test_results_api/models/bgp_test_results.py +test_results_api/models/bgp_test_route_information_result.py +test_results_api/models/bgp_test_route_information_results.py +test_results_api/models/dns_server_test_result.py +test_results_api/models/dns_server_test_results.py +test_results_api/models/dns_trace_test_result.py +test_results_api/models/dns_trace_test_results.py +test_results_api/models/dnssec_test_result.py +test_results_api/models/dnssec_test_results.py +test_results_api/models/epoch_time_window.py +test_results_api/models/error.py +test_results_api/models/expand.py +test_results_api/models/ftp_server_test_result.py +test_results_api/models/ftp_server_test_results.py +test_results_api/models/get_test_pathvis_agent_round200_response.py +test_results_api/models/get_test_result_dns_server200_response.py +test_results_api/models/get_test_result_dns_trace200_response.py +test_results_api/models/get_test_result_dnssec200_response.py +test_results_api/models/get_test_result_ftp_server200_response.py +test_results_api/models/get_test_result_http_server200_response.py +test_results_api/models/get_test_result_metrics200_response.py +test_results_api/models/get_test_result_network_pathvis200_response.py +test_results_api/models/get_test_result_page_load200_response.py +test_results_api/models/get_test_result_page_load_component_detail200_response.py +test_results_api/models/get_test_result_rtp_stream200_response.py +test_results_api/models/get_test_result_sip_server200_response.py +test_results_api/models/get_test_result_web_transactions200_response.py +test_results_api/models/get_test_result_web_transactions_component_detail200_response.py +test_results_api/models/get_test_result_web_transactions_component_page_detail200_response.py +test_results_api/models/get_test_results_bgp200_response.py +test_results_api/models/get_test_results_bgp_prefix200_response.py +test_results_api/models/http_test_result.py +test_results_api/models/http_test_result_headers.py +test_results_api/models/http_test_results.py +test_results_api/models/link.py +test_results_api/models/marker.py +test_results_api/models/monitor.py +test_results_api/models/network_test_result.py +test_results_api/models/network_test_results.py +test_results_api/models/page.py +test_results_api/models/page_load_detail_test_result.py +test_results_api/models/page_load_detail_test_results.py +test_results_api/models/page_load_test_result.py +test_results_api/models/page_load_test_results.py +test_results_api/models/pagination_links.py +test_results_api/models/pagination_links_links.py +test_results_api/models/path_vis_base_test_result.py +test_results_api/models/path_vis_detail_test_result.py +test_results_api/models/path_vis_detail_test_results.py +test_results_api/models/path_vis_endpoint.py +test_results_api/models/path_vis_hop.py +test_results_api/models/path_vis_route.py +test_results_api/models/path_vis_test_result.py +test_results_api/models/path_vis_test_results.py +test_results_api/models/query_window.py +test_results_api/models/rtp_stream_test_result.py +test_results_api/models/rtp_stream_test_results.py +test_results_api/models/self_links.py +test_results_api/models/self_links_links.py +test_results_api/models/simple_test.py +test_results_api/models/sip_server_error_type.py +test_results_api/models/sip_server_test_result.py +test_results_api/models/sip_server_test_results.py +test_results_api/models/ssl_cert.py +test_results_api/models/test_direction.py +test_results_api/models/test_interval.py +test_results_api/models/test_result.py +test_results_api/models/test_result_app_links.py +test_results_api/models/test_type.py +test_results_api/models/unauthorized_error.py +test_results_api/models/unexpanded_instant_test.py +test_results_api/models/unexpanded_instant_test_links.py +test_results_api/models/unexpanded_instant_test_links_self.py +test_results_api/models/unexpanded_instant_test_links_test_results.py +test_results_api/models/unexpanded_test.py +test_results_api/models/web_transaction_detail_test_result.py +test_results_api/models/web_transaction_detail_test_results.py +test_results_api/models/web_transaction_page_detail_test_result.py +test_results_api/models/web_transaction_page_detail_test_results.py +test_results_api/models/web_transaction_test_result.py +test_results_api/models/web_transaction_test_results.py +test_results_api/py.typed +test_results_api/rest.py +tox.ini diff --git a/test_results_api/.openapi-generator/VERSION b/test_results_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/test_results_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/test_results_api/.travis.yml b/test_results_api/.travis.yml new file mode 100644 index 00000000..bebf5aee --- /dev/null +++ b/test_results_api/.travis.yml @@ -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=test_results_api diff --git a/test_results_api/README.md b/test_results_api/README.md new file mode 100644 index 00000000..f9596588 --- /dev/null +++ b/test_results_api/README.md @@ -0,0 +1,228 @@ +# test-results-api +Get test result metrics for Cloud and Enterprise Agent tests. + +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 test_results_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 test_results_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 test_results_api +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.DNSSECTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # Get DNSSEC test results + api_response = api_instance.get_test_result_dnssec(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of DNSSECTestMetricsApi->get_test_result_dnssec:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling DNSSECTestMetricsApi->get_test_result_dnssec: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DNSSECTestMetricsApi* | [**get_test_result_dnssec**](docs/DNSSECTestMetricsApi.md#get_test_result_dnssec) | **GET** /v7/test-results/{testId}/dnssec | Get DNSSEC test results +*DNSServerTestMetricsApi* | [**get_test_result_dns_server**](docs/DNSServerTestMetricsApi.md#get_test_result_dns_server) | **GET** /v7/test-results/{testId}/dns-server/{serverId} | Get DNS server test results by server +*DNSServerTestMetricsApi* | [**get_test_result_dns_servers**](docs/DNSServerTestMetricsApi.md#get_test_result_dns_servers) | **GET** /v7/test-results/{testId}/dns-server | Get DNS server test results +*DNSTraceTestMetricsApi* | [**get_test_result_dns_trace**](docs/DNSTraceTestMetricsApi.md#get_test_result_dns_trace) | **GET** /v7/test-results/{testId}/dns-trace | Get DNS trace test results +*NetworkBGPTestMetricsApi* | [**get_test_results_bgp**](docs/NetworkBGPTestMetricsApi.md#get_test_results_bgp) | **GET** /v7/test-results/{testId}/bgp | Get BGP test results +*NetworkBGPTestMetricsApi* | [**get_test_results_bgp_prefix**](docs/NetworkBGPTestMetricsApi.md#get_test_results_bgp_prefix) | **GET** /v7/test-results/{testId}/bgp/routes/prefix/{prefixId}/round/{roundId} | Get BGP route test results by prefix +*NetworkTestMetricsApi* | [**get_test_pathvis_agent_round**](docs/NetworkTestMetricsApi.md#get_test_pathvis_agent_round) | **GET** /v7/test-results/{testId}/pathvis/agent/{agentId}/round/{roundId} | Get pathvis test results by agent and round +*NetworkTestMetricsApi* | [**get_test_result_metrics**](docs/NetworkTestMetricsApi.md#get_test_result_metrics) | **GET** /v7/test-results/{testId}/network | Get network test results +*NetworkTestMetricsApi* | [**get_test_result_network_pathvis**](docs/NetworkTestMetricsApi.md#get_test_result_network_pathvis) | **GET** /v7/test-results/{testId}/pathvis | Get pathvis network test results +*VoiceRTPServerTestMetricsApi* | [**get_test_result_rtp_stream**](docs/VoiceRTPServerTestMetricsApi.md#get_test_result_rtp_stream) | **GET** /v7/test-results/{testId}/rtp-server | Retrieve RTP server test metrics +*VoiceSIPServerTestMetricsApi* | [**get_test_result_sip_server**](docs/VoiceSIPServerTestMetricsApi.md#get_test_result_sip_server) | **GET** /v7/test-results/{testId}/sip-server | Get SIP server test results +*WebFTPServerTestMetricsApi* | [**get_test_result_ftp_server**](docs/WebFTPServerTestMetricsApi.md#get_test_result_ftp_server) | **GET** /v7/test-results/{testId}/ftp-server | Get FTP server test results +*WebHTTPServerTestMetricsApi* | [**get_test_result_http_server**](docs/WebHTTPServerTestMetricsApi.md#get_test_result_http_server) | **GET** /v7/test-results/{testId}/http-server | Get HTTP server test results +*WebPageLoadTestMetricsApi* | [**get_test_result_page_load**](docs/WebPageLoadTestMetricsApi.md#get_test_result_page_load) | **GET** /v7/test-results/{testId}/page-load | Get page load server test results +*WebPageLoadTestMetricsApi* | [**get_test_result_page_load_component_detail**](docs/WebPageLoadTestMetricsApi.md#get_test_result_page_load_component_detail) | **GET** /v7/test-results/{testId}/page-load/agent/{agentId}/round/{roundId} | Get page load server test results by agent and round +*WebTransactionsTestMetricsApi* | [**get_test_result_web_transactions**](docs/WebTransactionsTestMetricsApi.md#get_test_result_web_transactions) | **GET** /v7/test-results/{testId}/web-transactions | Get web transactions test results +*WebTransactionsTestMetricsApi* | [**get_test_result_web_transactions_component_detail**](docs/WebTransactionsTestMetricsApi.md#get_test_result_web_transactions_component_detail) | **GET** /v7/test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId} | Get web transactions test results by agent and round +*WebTransactionsTestMetricsApi* | [**get_test_result_web_transactions_component_page_detail**](docs/WebTransactionsTestMetricsApi.md#get_test_result_web_transactions_component_page_detail) | **GET** /v7/test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId}/page/{pageId} | Get detailed web transactions test result by agent, round, and page + + +## Documentation For Models + + - [Agent](docs/Agent.md) + - [AppLinks](docs/AppLinks.md) + - [AppLinksLinks](docs/AppLinksLinks.md) + - [BgpBasicTestResult](docs/BgpBasicTestResult.md) + - [BgpHop](docs/BgpHop.md) + - [BgpTestResult](docs/BgpTestResult.md) + - [BgpTestResults](docs/BgpTestResults.md) + - [BgpTestRouteInformationResult](docs/BgpTestRouteInformationResult.md) + - [BgpTestRouteInformationResults](docs/BgpTestRouteInformationResults.md) + - [DnsServerTestResult](docs/DnsServerTestResult.md) + - [DnsServerTestResults](docs/DnsServerTestResults.md) + - [DnsTraceTestResult](docs/DnsTraceTestResult.md) + - [DnsTraceTestResults](docs/DnsTraceTestResults.md) + - [DnssecTestResult](docs/DnssecTestResult.md) + - [DnssecTestResults](docs/DnssecTestResults.md) + - [EpochTimeWindow](docs/EpochTimeWindow.md) + - [Error](docs/Error.md) + - [Expand](docs/Expand.md) + - [FtpServerTestResult](docs/FtpServerTestResult.md) + - [FtpServerTestResults](docs/FtpServerTestResults.md) + - [GetTestPathvisAgentRound200Response](docs/GetTestPathvisAgentRound200Response.md) + - [GetTestResultDnsServer200Response](docs/GetTestResultDnsServer200Response.md) + - [GetTestResultDnsTrace200Response](docs/GetTestResultDnsTrace200Response.md) + - [GetTestResultDnssec200Response](docs/GetTestResultDnssec200Response.md) + - [GetTestResultFtpServer200Response](docs/GetTestResultFtpServer200Response.md) + - [GetTestResultHttpServer200Response](docs/GetTestResultHttpServer200Response.md) + - [GetTestResultMetrics200Response](docs/GetTestResultMetrics200Response.md) + - [GetTestResultNetworkPathvis200Response](docs/GetTestResultNetworkPathvis200Response.md) + - [GetTestResultPageLoad200Response](docs/GetTestResultPageLoad200Response.md) + - [GetTestResultPageLoadComponentDetail200Response](docs/GetTestResultPageLoadComponentDetail200Response.md) + - [GetTestResultRtpStream200Response](docs/GetTestResultRtpStream200Response.md) + - [GetTestResultSipServer200Response](docs/GetTestResultSipServer200Response.md) + - [GetTestResultWebTransactions200Response](docs/GetTestResultWebTransactions200Response.md) + - [GetTestResultWebTransactionsComponentDetail200Response](docs/GetTestResultWebTransactionsComponentDetail200Response.md) + - [GetTestResultWebTransactionsComponentPageDetail200Response](docs/GetTestResultWebTransactionsComponentPageDetail200Response.md) + - [GetTestResultsBgp200Response](docs/GetTestResultsBgp200Response.md) + - [GetTestResultsBgpPrefix200Response](docs/GetTestResultsBgpPrefix200Response.md) + - [HttpTestResult](docs/HttpTestResult.md) + - [HttpTestResultHeaders](docs/HttpTestResultHeaders.md) + - [HttpTestResults](docs/HttpTestResults.md) + - [Link](docs/Link.md) + - [Marker](docs/Marker.md) + - [Monitor](docs/Monitor.md) + - [NetworkTestResult](docs/NetworkTestResult.md) + - [NetworkTestResults](docs/NetworkTestResults.md) + - [Page](docs/Page.md) + - [PageLoadDetailTestResult](docs/PageLoadDetailTestResult.md) + - [PageLoadDetailTestResults](docs/PageLoadDetailTestResults.md) + - [PageLoadTestResult](docs/PageLoadTestResult.md) + - [PageLoadTestResults](docs/PageLoadTestResults.md) + - [PaginationLinks](docs/PaginationLinks.md) + - [PaginationLinksLinks](docs/PaginationLinksLinks.md) + - [PathVisBaseTestResult](docs/PathVisBaseTestResult.md) + - [PathVisDetailTestResult](docs/PathVisDetailTestResult.md) + - [PathVisDetailTestResults](docs/PathVisDetailTestResults.md) + - [PathVisEndpoint](docs/PathVisEndpoint.md) + - [PathVisHop](docs/PathVisHop.md) + - [PathVisRoute](docs/PathVisRoute.md) + - [PathVisTestResult](docs/PathVisTestResult.md) + - [PathVisTestResults](docs/PathVisTestResults.md) + - [QueryWindow](docs/QueryWindow.md) + - [RtpStreamTestResult](docs/RtpStreamTestResult.md) + - [RtpStreamTestResults](docs/RtpStreamTestResults.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [SimpleTest](docs/SimpleTest.md) + - [SipServerErrorType](docs/SipServerErrorType.md) + - [SipServerTestResult](docs/SipServerTestResult.md) + - [SipServerTestResults](docs/SipServerTestResults.md) + - [SslCert](docs/SslCert.md) + - [TestDirection](docs/TestDirection.md) + - [TestInterval](docs/TestInterval.md) + - [TestResult](docs/TestResult.md) + - [TestResultAppLinks](docs/TestResultAppLinks.md) + - [TestType](docs/TestType.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) + - [WebTransactionDetailTestResult](docs/WebTransactionDetailTestResult.md) + - [WebTransactionDetailTestResults](docs/WebTransactionDetailTestResults.md) + - [WebTransactionPageDetailTestResult](docs/WebTransactionPageDetailTestResult.md) + - [WebTransactionPageDetailTestResults](docs/WebTransactionPageDetailTestResults.md) + - [WebTransactionTestResult](docs/WebTransactionTestResult.md) + - [WebTransactionTestResults](docs/WebTransactionTestResults.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/test_results_api/docs/Agent.md b/test_results_api/docs/Agent.md new file mode 100644 index 00000000..7ab7062c --- /dev/null +++ b/test_results_api/docs/Agent.md @@ -0,0 +1,30 @@ +# Agent + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique agent ID | [optional] [readonly] +**agent_name** | **str** | Agent name | [optional] [readonly] +**country_id** | **str** | 2-digit ISO country code | [optional] [readonly] + +## Example + +```python +from test_results_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) + + diff --git a/test_results_api/docs/AppLinks.md b/test_results_api/docs/AppLinks.md new file mode 100644 index 00000000..d50c44fe --- /dev/null +++ b/test_results_api/docs/AppLinks.md @@ -0,0 +1,28 @@ +# AppLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**AppLinksLinks**](AppLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.app_links import AppLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of AppLinks from a JSON string +app_links_instance = AppLinks.from_json(json) +# print the JSON string representation of the object +print AppLinks.to_json() + +# convert the object into a dict +app_links_dict = app_links_instance.to_dict() +# create an instance of AppLinks from a dict +app_links_form_dict = app_links.from_dict(app_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/AppLinksLinks.md b/test_results_api/docs/AppLinksLinks.md new file mode 100644 index 00000000..1b5c1ea1 --- /dev/null +++ b/test_results_api/docs/AppLinksLinks.md @@ -0,0 +1,29 @@ +# AppLinksLinks + +A links object containing the ThousandEyes App link + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_link** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from test_results_api.models.app_links_links import AppLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of AppLinksLinks from a JSON string +app_links_links_instance = AppLinksLinks.from_json(json) +# print the JSON string representation of the object +print AppLinksLinks.to_json() + +# convert the object into a dict +app_links_links_dict = app_links_links_instance.to_dict() +# create an instance of AppLinksLinks from a dict +app_links_links_form_dict = app_links_links.from_dict(app_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/BgpBasicTestResult.md b/test_results_api/docs/BgpBasicTestResult.md new file mode 100644 index 00000000..90df2132 --- /dev/null +++ b/test_results_api/docs/BgpBasicTestResult.md @@ -0,0 +1,33 @@ +# BgpBasicTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**monitor** | [**Monitor**](Monitor.md) | | [optional] +**prefix_id** | **str** | Internally tracked prefix ID. | [optional] +**prefix** | **str** | Prefix being tracked. | [optional] + +## Example + +```python +from test_results_api.models.bgp_basic_test_result import BgpBasicTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpBasicTestResult from a JSON string +bgp_basic_test_result_instance = BgpBasicTestResult.from_json(json) +# print the JSON string representation of the object +print BgpBasicTestResult.to_json() + +# convert the object into a dict +bgp_basic_test_result_dict = bgp_basic_test_result_instance.to_dict() +# create an instance of BgpBasicTestResult from a dict +bgp_basic_test_result_form_dict = bgp_basic_test_result.from_dict(bgp_basic_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/BgpHop.md b/test_results_api/docs/BgpHop.md new file mode 100644 index 00000000..05f9958f --- /dev/null +++ b/test_results_api/docs/BgpHop.md @@ -0,0 +1,29 @@ +# BgpHop + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asn** | **float** | ASN of transit autonomous system | [optional] [readonly] +**as_name** | **str** | Name of autonomous system. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.bgp_hop import BgpHop + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpHop from a JSON string +bgp_hop_instance = BgpHop.from_json(json) +# print the JSON string representation of the object +print BgpHop.to_json() + +# convert the object into a dict +bgp_hop_dict = bgp_hop_instance.to_dict() +# create an instance of BgpHop from a dict +bgp_hop_form_dict = bgp_hop.from_dict(bgp_hop_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/BgpTestResult.md b/test_results_api/docs/BgpTestResult.md new file mode 100644 index 00000000..e539950f --- /dev/null +++ b/test_results_api/docs/BgpTestResult.md @@ -0,0 +1,36 @@ +# BgpTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**monitor** | [**Monitor**](Monitor.md) | | [optional] +**prefix_id** | **str** | Internally tracked prefix ID. | [optional] +**prefix** | **str** | Prefix being tracked. | [optional] +**updates** | **float** | Number of updates tracked against this prefix by this monitor. | [optional] +**path_changes** | **float** | Number of path changes tracked against this prefix by this monitor. | [optional] +**reachability** | **float** | Percentage reachability | [optional] + +## Example + +```python +from test_results_api.models.bgp_test_result import BgpTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpTestResult from a JSON string +bgp_test_result_instance = BgpTestResult.from_json(json) +# print the JSON string representation of the object +print BgpTestResult.to_json() + +# convert the object into a dict +bgp_test_result_dict = bgp_test_result_instance.to_dict() +# create an instance of BgpTestResult from a dict +bgp_test_result_form_dict = bgp_test_result.from_dict(bgp_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/BgpTestResults.md b/test_results_api/docs/BgpTestResults.md new file mode 100644 index 00000000..dff20462 --- /dev/null +++ b/test_results_api/docs/BgpTestResults.md @@ -0,0 +1,29 @@ +# BgpTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[BgpTestResult]**](BgpTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.bgp_test_results import BgpTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpTestResults from a JSON string +bgp_test_results_instance = BgpTestResults.from_json(json) +# print the JSON string representation of the object +print BgpTestResults.to_json() + +# convert the object into a dict +bgp_test_results_dict = bgp_test_results_instance.to_dict() +# create an instance of BgpTestResults from a dict +bgp_test_results_form_dict = bgp_test_results.from_dict(bgp_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/BgpTestRouteInformationResult.md b/test_results_api/docs/BgpTestRouteInformationResult.md new file mode 100644 index 00000000..c6fe3cde --- /dev/null +++ b/test_results_api/docs/BgpTestRouteInformationResult.md @@ -0,0 +1,35 @@ +# BgpTestRouteInformationResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**monitor** | [**Monitor**](Monitor.md) | | [optional] +**prefix_id** | **str** | Internally tracked prefix ID. | [optional] +**prefix** | **str** | Prefix being tracked. | [optional] +**is_active** | **bool** | Represents whether the route is active or inactive. An inactive route was an active route in the previous test round and is now superseded by another active (preferred) route. When requesting data for the test round in which a route change happened, both routes (active and inactive one) are included in the response. | [optional] +**hops** | [**List[BgpHop]**](BgpHop.md) | | [optional] + +## Example + +```python +from test_results_api.models.bgp_test_route_information_result import BgpTestRouteInformationResult + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpTestRouteInformationResult from a JSON string +bgp_test_route_information_result_instance = BgpTestRouteInformationResult.from_json(json) +# print the JSON string representation of the object +print BgpTestRouteInformationResult.to_json() + +# convert the object into a dict +bgp_test_route_information_result_dict = bgp_test_route_information_result_instance.to_dict() +# create an instance of BgpTestRouteInformationResult from a dict +bgp_test_route_information_result_form_dict = bgp_test_route_information_result.from_dict(bgp_test_route_information_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/BgpTestRouteInformationResults.md b/test_results_api/docs/BgpTestRouteInformationResults.md new file mode 100644 index 00000000..b5959ebe --- /dev/null +++ b/test_results_api/docs/BgpTestRouteInformationResults.md @@ -0,0 +1,29 @@ +# BgpTestRouteInformationResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[BgpTestRouteInformationResult]**](BgpTestRouteInformationResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.bgp_test_route_information_results import BgpTestRouteInformationResults + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpTestRouteInformationResults from a JSON string +bgp_test_route_information_results_instance = BgpTestRouteInformationResults.from_json(json) +# print the JSON string representation of the object +print BgpTestRouteInformationResults.to_json() + +# convert the object into a dict +bgp_test_route_information_results_dict = bgp_test_route_information_results_instance.to_dict() +# create an instance of BgpTestRouteInformationResults from a dict +bgp_test_route_information_results_form_dict = bgp_test_route_information_results.from_dict(bgp_test_route_information_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/DNSSECTestMetricsApi.md b/test_results_api/docs/DNSSECTestMetricsApi.md new file mode 100644 index 00000000..c244700c --- /dev/null +++ b/test_results_api/docs/DNSSECTestMetricsApi.md @@ -0,0 +1,104 @@ +# test_results_api.DNSSECTestMetricsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_result_dnssec**](DNSSECTestMetricsApi.md#get_test_result_dnssec) | **GET** /v7/test-results/{testId}/dnssec | Get DNSSEC test results + + +# **get_test_result_dnssec** +> GetTestResultDnssec200Response get_test_result_dnssec(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get DNSSEC test results + +Returns the keychain validity for a record on a domain secured using DNSSEC extensions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_dnssec200_response import GetTestResultDnssec200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.DNSSECTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # Get DNSSEC test results + api_response = api_instance.get_test_result_dnssec(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of DNSSECTestMetricsApi->get_test_result_dnssec:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSSECTestMetricsApi->get_test_result_dnssec: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**GetTestResultDnssec200Response**](GetTestResultDnssec200Response.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/test_results_api/docs/DNSServerTestMetricsApi.md b/test_results_api/docs/DNSServerTestMetricsApi.md new file mode 100644 index 00000000..86d7dcb6 --- /dev/null +++ b/test_results_api/docs/DNSServerTestMetricsApi.md @@ -0,0 +1,202 @@ +# test_results_api.DNSServerTestMetricsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_result_dns_server**](DNSServerTestMetricsApi.md#get_test_result_dns_server) | **GET** /v7/test-results/{testId}/dns-server/{serverId} | Get DNS server test results by server +[**get_test_result_dns_servers**](DNSServerTestMetricsApi.md#get_test_result_dns_servers) | **GET** /v7/test-results/{testId}/dns-server | Get DNS server test results + + +# **get_test_result_dns_server** +> GetTestResultDnsServer200Response get_test_result_dns_server(test_id, server_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get DNS server test results by server + +Returns mappings for a DNS record and resolution time to the specified server, measured from the requesting agent's point of view. This is similar to dig @server. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_dns_server200_response import GetTestResultDnsServer200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.DNSServerTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + server_id = '281474976710706' # str | DNS server ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # Get DNS server test results by server + api_response = api_instance.get_test_result_dns_server(test_id, server_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of DNSServerTestMetricsApi->get_test_result_dns_server:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerTestMetricsApi->get_test_result_dns_server: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **server_id** | **str**| DNS server ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**GetTestResultDnsServer200Response**](GetTestResultDnsServer200Response.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 | - | +**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) + +# **get_test_result_dns_servers** +> GetTestResultDnsServer200Response get_test_result_dns_servers(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get DNS server test results + +Returns the mappings for a DNS record, along with the resolution time to each authoritative server, measured from the agent's point of view. Similar to dig @server. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_dns_server200_response import GetTestResultDnsServer200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.DNSServerTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # Get DNS server test results + api_response = api_instance.get_test_result_dns_servers(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of DNSServerTestMetricsApi->get_test_result_dns_servers:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerTestMetricsApi->get_test_result_dns_servers: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**GetTestResultDnsServer200Response**](GetTestResultDnsServer200Response.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/test_results_api/docs/DNSTraceTestMetricsApi.md b/test_results_api/docs/DNSTraceTestMetricsApi.md new file mode 100644 index 00000000..d84be5ef --- /dev/null +++ b/test_results_api/docs/DNSTraceTestMetricsApi.md @@ -0,0 +1,104 @@ +# test_results_api.DNSTraceTestMetricsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_result_dns_trace**](DNSTraceTestMetricsApi.md#get_test_result_dns_trace) | **GET** /v7/test-results/{testId}/dns-trace | Get DNS trace test results + + +# **get_test_result_dns_trace** +> GetTestResultDnsTrace200Response get_test_result_dns_trace(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get DNS trace test results + +Returns a DNS record from the requesting agent's point of view. This is similar to dig +trace. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_dns_trace200_response import GetTestResultDnsTrace200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.DNSTraceTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # Get DNS trace test results + api_response = api_instance.get_test_result_dns_trace(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of DNSTraceTestMetricsApi->get_test_result_dns_trace:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSTraceTestMetricsApi->get_test_result_dns_trace: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**GetTestResultDnsTrace200Response**](GetTestResultDnsTrace200Response.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/test_results_api/docs/DnsServerTestResult.md b/test_results_api/docs/DnsServerTestResult.md new file mode 100644 index 00000000..05a2db89 --- /dev/null +++ b/test_results_api/docs/DnsServerTestResult.md @@ -0,0 +1,38 @@ +# DnsServerTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] +**agent** | [**Agent**](Agent.md) | | [optional] +**server_id** | **str** | Internal ID of DNS server being tested | [optional] [readonly] +**server** | **str** | Canonical name of server being tested | [optional] [readonly] +**resolution_time** | **int** | How long it took to run the query against the serverow long it took to run the query against the server | [optional] [readonly] +**error_details** | **str** | Error details, if an error were encountered | [optional] [readonly] +**mappings** | **str** | Final mappings returned from the request | [optional] [readonly] + +## Example + +```python +from test_results_api.models.dns_server_test_result import DnsServerTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsServerTestResult from a JSON string +dns_server_test_result_instance = DnsServerTestResult.from_json(json) +# print the JSON string representation of the object +print DnsServerTestResult.to_json() + +# convert the object into a dict +dns_server_test_result_dict = dns_server_test_result_instance.to_dict() +# create an instance of DnsServerTestResult from a dict +dns_server_test_result_form_dict = dns_server_test_result.from_dict(dns_server_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/DnsServerTestResults.md b/test_results_api/docs/DnsServerTestResults.md new file mode 100644 index 00000000..403f6427 --- /dev/null +++ b/test_results_api/docs/DnsServerTestResults.md @@ -0,0 +1,29 @@ +# DnsServerTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[DnsServerTestResult]**](DnsServerTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.dns_server_test_results import DnsServerTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsServerTestResults from a JSON string +dns_server_test_results_instance = DnsServerTestResults.from_json(json) +# print the JSON string representation of the object +print DnsServerTestResults.to_json() + +# convert the object into a dict +dns_server_test_results_dict = dns_server_test_results_instance.to_dict() +# create an instance of DnsServerTestResults from a dict +dns_server_test_results_form_dict = dns_server_test_results.from_dict(dns_server_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/DnsTraceTestResult.md b/test_results_api/docs/DnsTraceTestResult.md new file mode 100644 index 00000000..149de133 --- /dev/null +++ b/test_results_api/docs/DnsTraceTestResult.md @@ -0,0 +1,40 @@ +# DnsTraceTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] +**agent** | [**Agent**](Agent.md) | | [optional] +**output** | **str** | Verbose output from the trace request | [optional] [readonly] +**error_details** | **str** | Error details, if an error were encountered | [optional] [readonly] +**queries** | **int** | How many queries were required to get to the requested result | [optional] [readonly] +**failed_queries** | **int** | How many queries failed while getting to the requested result | [optional] [readonly] +**final_server_queried** | **str** | DNS server that provided the final result | [optional] [readonly] +**final_query_time** | **int** | How long the final query took to return a response | [optional] [readonly] +**mappings** | **str** | Final mappings returned from the request | [optional] [readonly] + +## Example + +```python +from test_results_api.models.dns_trace_test_result import DnsTraceTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsTraceTestResult from a JSON string +dns_trace_test_result_instance = DnsTraceTestResult.from_json(json) +# print the JSON string representation of the object +print DnsTraceTestResult.to_json() + +# convert the object into a dict +dns_trace_test_result_dict = dns_trace_test_result_instance.to_dict() +# create an instance of DnsTraceTestResult from a dict +dns_trace_test_result_form_dict = dns_trace_test_result.from_dict(dns_trace_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/DnsTraceTestResults.md b/test_results_api/docs/DnsTraceTestResults.md new file mode 100644 index 00000000..41348f81 --- /dev/null +++ b/test_results_api/docs/DnsTraceTestResults.md @@ -0,0 +1,29 @@ +# DnsTraceTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[DnsTraceTestResult]**](DnsTraceTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.dns_trace_test_results import DnsTraceTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsTraceTestResults from a JSON string +dns_trace_test_results_instance = DnsTraceTestResults.from_json(json) +# print the JSON string representation of the object +print DnsTraceTestResults.to_json() + +# convert the object into a dict +dns_trace_test_results_dict = dns_trace_test_results_instance.to_dict() +# create an instance of DnsTraceTestResults from a dict +dns_trace_test_results_form_dict = dns_trace_test_results.from_dict(dns_trace_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/DnssecTestResult.md b/test_results_api/docs/DnssecTestResult.md new file mode 100644 index 00000000..1a76345d --- /dev/null +++ b/test_results_api/docs/DnssecTestResult.md @@ -0,0 +1,35 @@ +# DnssecTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] +**agent** | [**Agent**](Agent.md) | | [optional] +**is_valid** | **bool** | Indicates if keychain is valid (if false see errorDetails field) | [optional] [readonly] +**error_details** | **str** | Error details, if an error were encountered | [optional] [readonly] + +## Example + +```python +from test_results_api.models.dnssec_test_result import DnssecTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of DnssecTestResult from a JSON string +dnssec_test_result_instance = DnssecTestResult.from_json(json) +# print the JSON string representation of the object +print DnssecTestResult.to_json() + +# convert the object into a dict +dnssec_test_result_dict = dnssec_test_result_instance.to_dict() +# create an instance of DnssecTestResult from a dict +dnssec_test_result_form_dict = dnssec_test_result.from_dict(dnssec_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/DnssecTestResults.md b/test_results_api/docs/DnssecTestResults.md new file mode 100644 index 00000000..d5ff2480 --- /dev/null +++ b/test_results_api/docs/DnssecTestResults.md @@ -0,0 +1,29 @@ +# DnssecTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[DnssecTestResult]**](DnssecTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.dnssec_test_results import DnssecTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of DnssecTestResults from a JSON string +dnssec_test_results_instance = DnssecTestResults.from_json(json) +# print the JSON string representation of the object +print DnssecTestResults.to_json() + +# convert the object into a dict +dnssec_test_results_dict = dnssec_test_results_instance.to_dict() +# create an instance of DnssecTestResults from a dict +dnssec_test_results_form_dict = dnssec_test_results.from_dict(dnssec_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/EpochTimeWindow.md b/test_results_api/docs/EpochTimeWindow.md new file mode 100644 index 00000000..b039290c --- /dev/null +++ b/test_results_api/docs/EpochTimeWindow.md @@ -0,0 +1,29 @@ +# EpochTimeWindow + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] + +## Example + +```python +from test_results_api.models.epoch_time_window import EpochTimeWindow + +# TODO update the JSON string below +json = "{}" +# create an instance of EpochTimeWindow from a JSON string +epoch_time_window_instance = EpochTimeWindow.from_json(json) +# print the JSON string representation of the object +print EpochTimeWindow.to_json() + +# convert the object into a dict +epoch_time_window_dict = epoch_time_window_instance.to_dict() +# create an instance of EpochTimeWindow from a dict +epoch_time_window_form_dict = epoch_time_window.from_dict(epoch_time_window_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/Error.md b/test_results_api/docs/Error.md new file mode 100644 index 00000000..192750be --- /dev/null +++ b/test_results_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from test_results_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/Expand.md b/test_results_api/docs/Expand.md new file mode 100644 index 00000000..5d5b5ca2 --- /dev/null +++ b/test_results_api/docs/Expand.md @@ -0,0 +1,10 @@ +# Expand + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/FtpServerTestResult.md b/test_results_api/docs/FtpServerTestResult.md new file mode 100644 index 00000000..90efea59 --- /dev/null +++ b/test_results_api/docs/FtpServerTestResult.md @@ -0,0 +1,44 @@ +# FtpServerTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**agent** | [**Agent**](Agent.md) | | [optional] +**server_ip** | **str** | IP address of destination server | [optional] [readonly] +**response_code** | **int** | FTP response code | [optional] [readonly] +**dns_time** | **float** | Time required to resolve DNS in milliseconds | [optional] [readonly] +**connect_time** | **float** | Time required to establish a TCP connection to the server in milliseconds | [optional] [readonly] +**negotiation_time** | **float** | Time negotiate the connection and authenticate with the destination server in milliseconds | [optional] [readonly] +**wait_time** | **float** | Time elapsed between completion of request and first byte of response in milliseconds | [optional] [readonly] +**response_time** | **float** | Sum of DNS, connect, negotiation and wait times in milliseconds | [optional] [readonly] +**transfer_time** | **float** | Elapsed time between first and last byte of the transfer in milliseconds | [optional] [readonly] +**wire_size** | **float** | Size of content in bytes | [optional] [readonly] +**total_time** | **float** | Sum of response + transfer time in milliseconds | [optional] [readonly] +**error_type** | **str** | Type of error encountered; corresponds to phase of connection | [optional] [readonly] +**error_details** | **str** | Error details, if an error were encountered | [optional] [readonly] +**throughput** | **float** | WireSize divided by receiveTime in byter per second | [optional] [readonly] + +## Example + +```python +from test_results_api.models.ftp_server_test_result import FtpServerTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of FtpServerTestResult from a JSON string +ftp_server_test_result_instance = FtpServerTestResult.from_json(json) +# print the JSON string representation of the object +print FtpServerTestResult.to_json() + +# convert the object into a dict +ftp_server_test_result_dict = ftp_server_test_result_instance.to_dict() +# create an instance of FtpServerTestResult from a dict +ftp_server_test_result_form_dict = ftp_server_test_result.from_dict(ftp_server_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/FtpServerTestResults.md b/test_results_api/docs/FtpServerTestResults.md new file mode 100644 index 00000000..4466818e --- /dev/null +++ b/test_results_api/docs/FtpServerTestResults.md @@ -0,0 +1,29 @@ +# FtpServerTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[FtpServerTestResult]**](FtpServerTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.ftp_server_test_results import FtpServerTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of FtpServerTestResults from a JSON string +ftp_server_test_results_instance = FtpServerTestResults.from_json(json) +# print the JSON string representation of the object +print FtpServerTestResults.to_json() + +# convert the object into a dict +ftp_server_test_results_dict = ftp_server_test_results_instance.to_dict() +# create an instance of FtpServerTestResults from a dict +ftp_server_test_results_form_dict = ftp_server_test_results.from_dict(ftp_server_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestPathvisAgentRound200Response.md b/test_results_api/docs/GetTestPathvisAgentRound200Response.md new file mode 100644 index 00000000..2fd4b711 --- /dev/null +++ b/test_results_api/docs/GetTestPathvisAgentRound200Response.md @@ -0,0 +1,30 @@ +# GetTestPathvisAgentRound200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisDetailTestResult]**](PathVisDetailTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_pathvis_agent_round200_response import GetTestPathvisAgentRound200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestPathvisAgentRound200Response from a JSON string +get_test_pathvis_agent_round200_response_instance = GetTestPathvisAgentRound200Response.from_json(json) +# print the JSON string representation of the object +print GetTestPathvisAgentRound200Response.to_json() + +# convert the object into a dict +get_test_pathvis_agent_round200_response_dict = get_test_pathvis_agent_round200_response_instance.to_dict() +# create an instance of GetTestPathvisAgentRound200Response from a dict +get_test_pathvis_agent_round200_response_form_dict = get_test_pathvis_agent_round200_response.from_dict(get_test_pathvis_agent_round200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultDnsServer200Response.md b/test_results_api/docs/GetTestResultDnsServer200Response.md new file mode 100644 index 00000000..1bb02098 --- /dev/null +++ b/test_results_api/docs/GetTestResultDnsServer200Response.md @@ -0,0 +1,32 @@ +# GetTestResultDnsServer200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[DnsServerTestResult]**](DnsServerTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_dns_server200_response import GetTestResultDnsServer200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultDnsServer200Response from a JSON string +get_test_result_dns_server200_response_instance = GetTestResultDnsServer200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultDnsServer200Response.to_json() + +# convert the object into a dict +get_test_result_dns_server200_response_dict = get_test_result_dns_server200_response_instance.to_dict() +# create an instance of GetTestResultDnsServer200Response from a dict +get_test_result_dns_server200_response_form_dict = get_test_result_dns_server200_response.from_dict(get_test_result_dns_server200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultDnsTrace200Response.md b/test_results_api/docs/GetTestResultDnsTrace200Response.md new file mode 100644 index 00000000..7323e7cd --- /dev/null +++ b/test_results_api/docs/GetTestResultDnsTrace200Response.md @@ -0,0 +1,32 @@ +# GetTestResultDnsTrace200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[DnsTraceTestResult]**](DnsTraceTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_dns_trace200_response import GetTestResultDnsTrace200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultDnsTrace200Response from a JSON string +get_test_result_dns_trace200_response_instance = GetTestResultDnsTrace200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultDnsTrace200Response.to_json() + +# convert the object into a dict +get_test_result_dns_trace200_response_dict = get_test_result_dns_trace200_response_instance.to_dict() +# create an instance of GetTestResultDnsTrace200Response from a dict +get_test_result_dns_trace200_response_form_dict = get_test_result_dns_trace200_response.from_dict(get_test_result_dns_trace200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultDnssec200Response.md b/test_results_api/docs/GetTestResultDnssec200Response.md new file mode 100644 index 00000000..34b981d2 --- /dev/null +++ b/test_results_api/docs/GetTestResultDnssec200Response.md @@ -0,0 +1,32 @@ +# GetTestResultDnssec200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[DnssecTestResult]**](DnssecTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_dnssec200_response import GetTestResultDnssec200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultDnssec200Response from a JSON string +get_test_result_dnssec200_response_instance = GetTestResultDnssec200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultDnssec200Response.to_json() + +# convert the object into a dict +get_test_result_dnssec200_response_dict = get_test_result_dnssec200_response_instance.to_dict() +# create an instance of GetTestResultDnssec200Response from a dict +get_test_result_dnssec200_response_form_dict = get_test_result_dnssec200_response.from_dict(get_test_result_dnssec200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultFtpServer200Response.md b/test_results_api/docs/GetTestResultFtpServer200Response.md new file mode 100644 index 00000000..5a3637ca --- /dev/null +++ b/test_results_api/docs/GetTestResultFtpServer200Response.md @@ -0,0 +1,32 @@ +# GetTestResultFtpServer200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[FtpServerTestResult]**](FtpServerTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_ftp_server200_response import GetTestResultFtpServer200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultFtpServer200Response from a JSON string +get_test_result_ftp_server200_response_instance = GetTestResultFtpServer200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultFtpServer200Response.to_json() + +# convert the object into a dict +get_test_result_ftp_server200_response_dict = get_test_result_ftp_server200_response_instance.to_dict() +# create an instance of GetTestResultFtpServer200Response from a dict +get_test_result_ftp_server200_response_form_dict = get_test_result_ftp_server200_response.from_dict(get_test_result_ftp_server200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultHttpServer200Response.md b/test_results_api/docs/GetTestResultHttpServer200Response.md new file mode 100644 index 00000000..0539832e --- /dev/null +++ b/test_results_api/docs/GetTestResultHttpServer200Response.md @@ -0,0 +1,32 @@ +# GetTestResultHttpServer200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[HttpTestResult]**](HttpTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_http_server200_response import GetTestResultHttpServer200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultHttpServer200Response from a JSON string +get_test_result_http_server200_response_instance = GetTestResultHttpServer200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultHttpServer200Response.to_json() + +# convert the object into a dict +get_test_result_http_server200_response_dict = get_test_result_http_server200_response_instance.to_dict() +# create an instance of GetTestResultHttpServer200Response from a dict +get_test_result_http_server200_response_form_dict = get_test_result_http_server200_response.from_dict(get_test_result_http_server200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultMetrics200Response.md b/test_results_api/docs/GetTestResultMetrics200Response.md new file mode 100644 index 00000000..a16cdf0b --- /dev/null +++ b/test_results_api/docs/GetTestResultMetrics200Response.md @@ -0,0 +1,32 @@ +# GetTestResultMetrics200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[NetworkTestResult]**](NetworkTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_metrics200_response import GetTestResultMetrics200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultMetrics200Response from a JSON string +get_test_result_metrics200_response_instance = GetTestResultMetrics200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultMetrics200Response.to_json() + +# convert the object into a dict +get_test_result_metrics200_response_dict = get_test_result_metrics200_response_instance.to_dict() +# create an instance of GetTestResultMetrics200Response from a dict +get_test_result_metrics200_response_form_dict = get_test_result_metrics200_response.from_dict(get_test_result_metrics200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultNetworkPathvis200Response.md b/test_results_api/docs/GetTestResultNetworkPathvis200Response.md new file mode 100644 index 00000000..488e8466 --- /dev/null +++ b/test_results_api/docs/GetTestResultNetworkPathvis200Response.md @@ -0,0 +1,32 @@ +# GetTestResultNetworkPathvis200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[PathVisTestResult]**](PathVisTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_network_pathvis200_response import GetTestResultNetworkPathvis200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultNetworkPathvis200Response from a JSON string +get_test_result_network_pathvis200_response_instance = GetTestResultNetworkPathvis200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultNetworkPathvis200Response.to_json() + +# convert the object into a dict +get_test_result_network_pathvis200_response_dict = get_test_result_network_pathvis200_response_instance.to_dict() +# create an instance of GetTestResultNetworkPathvis200Response from a dict +get_test_result_network_pathvis200_response_form_dict = get_test_result_network_pathvis200_response.from_dict(get_test_result_network_pathvis200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultPageLoad200Response.md b/test_results_api/docs/GetTestResultPageLoad200Response.md new file mode 100644 index 00000000..bd22e172 --- /dev/null +++ b/test_results_api/docs/GetTestResultPageLoad200Response.md @@ -0,0 +1,32 @@ +# GetTestResultPageLoad200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[PageLoadTestResult]**](PageLoadTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_page_load200_response import GetTestResultPageLoad200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultPageLoad200Response from a JSON string +get_test_result_page_load200_response_instance = GetTestResultPageLoad200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultPageLoad200Response.to_json() + +# convert the object into a dict +get_test_result_page_load200_response_dict = get_test_result_page_load200_response_instance.to_dict() +# create an instance of GetTestResultPageLoad200Response from a dict +get_test_result_page_load200_response_form_dict = get_test_result_page_load200_response.from_dict(get_test_result_page_load200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultPageLoadComponentDetail200Response.md b/test_results_api/docs/GetTestResultPageLoadComponentDetail200Response.md new file mode 100644 index 00000000..43317c33 --- /dev/null +++ b/test_results_api/docs/GetTestResultPageLoadComponentDetail200Response.md @@ -0,0 +1,30 @@ +# GetTestResultPageLoadComponentDetail200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PageLoadDetailTestResult]**](PageLoadDetailTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_page_load_component_detail200_response import GetTestResultPageLoadComponentDetail200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultPageLoadComponentDetail200Response from a JSON string +get_test_result_page_load_component_detail200_response_instance = GetTestResultPageLoadComponentDetail200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultPageLoadComponentDetail200Response.to_json() + +# convert the object into a dict +get_test_result_page_load_component_detail200_response_dict = get_test_result_page_load_component_detail200_response_instance.to_dict() +# create an instance of GetTestResultPageLoadComponentDetail200Response from a dict +get_test_result_page_load_component_detail200_response_form_dict = get_test_result_page_load_component_detail200_response.from_dict(get_test_result_page_load_component_detail200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultRtpStream200Response.md b/test_results_api/docs/GetTestResultRtpStream200Response.md new file mode 100644 index 00000000..f63ee4fd --- /dev/null +++ b/test_results_api/docs/GetTestResultRtpStream200Response.md @@ -0,0 +1,32 @@ +# GetTestResultRtpStream200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[RtpStreamTestResult]**](RtpStreamTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_rtp_stream200_response import GetTestResultRtpStream200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultRtpStream200Response from a JSON string +get_test_result_rtp_stream200_response_instance = GetTestResultRtpStream200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultRtpStream200Response.to_json() + +# convert the object into a dict +get_test_result_rtp_stream200_response_dict = get_test_result_rtp_stream200_response_instance.to_dict() +# create an instance of GetTestResultRtpStream200Response from a dict +get_test_result_rtp_stream200_response_form_dict = get_test_result_rtp_stream200_response.from_dict(get_test_result_rtp_stream200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultSipServer200Response.md b/test_results_api/docs/GetTestResultSipServer200Response.md new file mode 100644 index 00000000..d2df77c1 --- /dev/null +++ b/test_results_api/docs/GetTestResultSipServer200Response.md @@ -0,0 +1,32 @@ +# GetTestResultSipServer200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[SipServerTestResult]**](SipServerTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_sip_server200_response import GetTestResultSipServer200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultSipServer200Response from a JSON string +get_test_result_sip_server200_response_instance = GetTestResultSipServer200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultSipServer200Response.to_json() + +# convert the object into a dict +get_test_result_sip_server200_response_dict = get_test_result_sip_server200_response_instance.to_dict() +# create an instance of GetTestResultSipServer200Response from a dict +get_test_result_sip_server200_response_form_dict = get_test_result_sip_server200_response.from_dict(get_test_result_sip_server200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultWebTransactions200Response.md b/test_results_api/docs/GetTestResultWebTransactions200Response.md new file mode 100644 index 00000000..19bbc11d --- /dev/null +++ b/test_results_api/docs/GetTestResultWebTransactions200Response.md @@ -0,0 +1,32 @@ +# GetTestResultWebTransactions200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**results** | [**List[WebTransactionTestResult]**](WebTransactionTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_web_transactions200_response import GetTestResultWebTransactions200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultWebTransactions200Response from a JSON string +get_test_result_web_transactions200_response_instance = GetTestResultWebTransactions200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultWebTransactions200Response.to_json() + +# convert the object into a dict +get_test_result_web_transactions200_response_dict = get_test_result_web_transactions200_response_instance.to_dict() +# create an instance of GetTestResultWebTransactions200Response from a dict +get_test_result_web_transactions200_response_form_dict = get_test_result_web_transactions200_response.from_dict(get_test_result_web_transactions200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultWebTransactionsComponentDetail200Response.md b/test_results_api/docs/GetTestResultWebTransactionsComponentDetail200Response.md new file mode 100644 index 00000000..c7ebd739 --- /dev/null +++ b/test_results_api/docs/GetTestResultWebTransactionsComponentDetail200Response.md @@ -0,0 +1,30 @@ +# GetTestResultWebTransactionsComponentDetail200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[WebTransactionDetailTestResult]**](WebTransactionDetailTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_web_transactions_component_detail200_response import GetTestResultWebTransactionsComponentDetail200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultWebTransactionsComponentDetail200Response from a JSON string +get_test_result_web_transactions_component_detail200_response_instance = GetTestResultWebTransactionsComponentDetail200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultWebTransactionsComponentDetail200Response.to_json() + +# convert the object into a dict +get_test_result_web_transactions_component_detail200_response_dict = get_test_result_web_transactions_component_detail200_response_instance.to_dict() +# create an instance of GetTestResultWebTransactionsComponentDetail200Response from a dict +get_test_result_web_transactions_component_detail200_response_form_dict = get_test_result_web_transactions_component_detail200_response.from_dict(get_test_result_web_transactions_component_detail200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultWebTransactionsComponentPageDetail200Response.md b/test_results_api/docs/GetTestResultWebTransactionsComponentPageDetail200Response.md new file mode 100644 index 00000000..272315a6 --- /dev/null +++ b/test_results_api/docs/GetTestResultWebTransactionsComponentPageDetail200Response.md @@ -0,0 +1,30 @@ +# GetTestResultWebTransactionsComponentPageDetail200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[WebTransactionPageDetailTestResult]**](WebTransactionPageDetailTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_result_web_transactions_component_page_detail200_response import GetTestResultWebTransactionsComponentPageDetail200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultWebTransactionsComponentPageDetail200Response from a JSON string +get_test_result_web_transactions_component_page_detail200_response_instance = GetTestResultWebTransactionsComponentPageDetail200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultWebTransactionsComponentPageDetail200Response.to_json() + +# convert the object into a dict +get_test_result_web_transactions_component_page_detail200_response_dict = get_test_result_web_transactions_component_page_detail200_response_instance.to_dict() +# create an instance of GetTestResultWebTransactionsComponentPageDetail200Response from a dict +get_test_result_web_transactions_component_page_detail200_response_form_dict = get_test_result_web_transactions_component_page_detail200_response.from_dict(get_test_result_web_transactions_component_page_detail200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultsBgp200Response.md b/test_results_api/docs/GetTestResultsBgp200Response.md new file mode 100644 index 00000000..036cc175 --- /dev/null +++ b/test_results_api/docs/GetTestResultsBgp200Response.md @@ -0,0 +1,30 @@ +# GetTestResultsBgp200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[BgpTestResult]**](BgpTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_results_bgp200_response import GetTestResultsBgp200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultsBgp200Response from a JSON string +get_test_results_bgp200_response_instance = GetTestResultsBgp200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultsBgp200Response.to_json() + +# convert the object into a dict +get_test_results_bgp200_response_dict = get_test_results_bgp200_response_instance.to_dict() +# create an instance of GetTestResultsBgp200Response from a dict +get_test_results_bgp200_response_form_dict = get_test_results_bgp200_response.from_dict(get_test_results_bgp200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/GetTestResultsBgpPrefix200Response.md b/test_results_api/docs/GetTestResultsBgpPrefix200Response.md new file mode 100644 index 00000000..ebb752cb --- /dev/null +++ b/test_results_api/docs/GetTestResultsBgpPrefix200Response.md @@ -0,0 +1,30 @@ +# GetTestResultsBgpPrefix200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[BgpTestRouteInformationResult]**](BgpTestRouteInformationResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.get_test_results_bgp_prefix200_response import GetTestResultsBgpPrefix200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTestResultsBgpPrefix200Response from a JSON string +get_test_results_bgp_prefix200_response_instance = GetTestResultsBgpPrefix200Response.from_json(json) +# print the JSON string representation of the object +print GetTestResultsBgpPrefix200Response.to_json() + +# convert the object into a dict +get_test_results_bgp_prefix200_response_dict = get_test_results_bgp_prefix200_response_instance.to_dict() +# create an instance of GetTestResultsBgpPrefix200Response from a dict +get_test_results_bgp_prefix200_response_form_dict = get_test_results_bgp_prefix200_response.from_dict(get_test_results_bgp_prefix200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/HttpTestResult.md b/test_results_api/docs/HttpTestResult.md new file mode 100644 index 00000000..86dff3c7 --- /dev/null +++ b/test_results_api/docs/HttpTestResult.md @@ -0,0 +1,50 @@ +# HttpTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**agent** | [**Agent**](Agent.md) | | [optional] +**server_ip** | **str** | IP address of destination server | [optional] [readonly] +**response_code** | **int** | HTTP response code | [optional] +**num_redirects** | **int** | Number of redirects | [optional] +**redirect_time** | **int** | Cumulative redirect timing in milliseconds | [optional] +**dns_time** | **int** | Time required to resolve DNS in milliseconds | [optional] +**ssl_time** | **int** | Time to negotiate SSL/TLS in milliseconds | [optional] +**connect_time** | **int** | Time required to establish a TCP connection to the server | [optional] +**wait_time** | **int** | Time elapsed between completion of request and first byte of response in milliseconds | [optional] +**receive_time** | **int** | Elapsed time between first and last byte of response in milliseconds | [optional] +**wire_size** | **int** | Size of content in bytes | [optional] +**response_time** | **int** | Time to first byte in milliseconds | [optional] +**throughput** | **float** | WireSize divided by receiveTime in byter per second | [optional] +**total_time** | **int** | response time + receive time | [optional] +**headers** | [**HttpTestResultHeaders**](HttpTestResultHeaders.md) | | [optional] +**error_type** | **str** | Type of error encountered; corresponds to phase of connection | [optional] [readonly] +**error_details** | **str** | Error details, if an error were encountered | [optional] [readonly] +**ssl_cipher** | **str** | Cipher suite | [optional] +**ssl_version** | **str** | TLS version | [optional] +**ssl_certificates** | [**List[SslCert]**](SslCert.md) | | [optional] + +## Example + +```python +from test_results_api.models.http_test_result import HttpTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpTestResult from a JSON string +http_test_result_instance = HttpTestResult.from_json(json) +# print the JSON string representation of the object +print HttpTestResult.to_json() + +# convert the object into a dict +http_test_result_dict = http_test_result_instance.to_dict() +# create an instance of HttpTestResult from a dict +http_test_result_form_dict = http_test_result.from_dict(http_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/HttpTestResultHeaders.md b/test_results_api/docs/HttpTestResultHeaders.md new file mode 100644 index 00000000..55c8132e --- /dev/null +++ b/test_results_api/docs/HttpTestResultHeaders.md @@ -0,0 +1,30 @@ +# HttpTestResultHeaders + +Expandable object containing both request and response headers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_headers** | **str** | Crlf-delimited list of request headers in header: value format | [optional] +**response_headers** | **str** | crlf-delimited list of response headers in header: value format | [optional] + +## Example + +```python +from test_results_api.models.http_test_result_headers import HttpTestResultHeaders + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpTestResultHeaders from a JSON string +http_test_result_headers_instance = HttpTestResultHeaders.from_json(json) +# print the JSON string representation of the object +print HttpTestResultHeaders.to_json() + +# convert the object into a dict +http_test_result_headers_dict = http_test_result_headers_instance.to_dict() +# create an instance of HttpTestResultHeaders from a dict +http_test_result_headers_form_dict = http_test_result_headers.from_dict(http_test_result_headers_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/HttpTestResults.md b/test_results_api/docs/HttpTestResults.md new file mode 100644 index 00000000..ecdc7704 --- /dev/null +++ b/test_results_api/docs/HttpTestResults.md @@ -0,0 +1,29 @@ +# HttpTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[HttpTestResult]**](HttpTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.http_test_results import HttpTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpTestResults from a JSON string +http_test_results_instance = HttpTestResults.from_json(json) +# print the JSON string representation of the object +print HttpTestResults.to_json() + +# convert the object into a dict +http_test_results_dict = http_test_results_instance.to_dict() +# create an instance of HttpTestResults from a dict +http_test_results_form_dict = http_test_results.from_dict(http_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/Link.md b/test_results_api/docs/Link.md new file mode 100644 index 00000000..ceef9be3 --- /dev/null +++ b/test_results_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from test_results_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/Marker.md b/test_results_api/docs/Marker.md new file mode 100644 index 00000000..b4a9d1e9 --- /dev/null +++ b/test_results_api/docs/Marker.md @@ -0,0 +1,29 @@ +# Marker + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name assigned to marker in transaction script | [optional] [readonly] +**duration** | **int** | Total time recorded by marker in milliseconds | [optional] [readonly] + +## Example + +```python +from test_results_api.models.marker import Marker + +# TODO update the JSON string below +json = "{}" +# create an instance of Marker from a JSON string +marker_instance = Marker.from_json(json) +# print the JSON string representation of the object +print Marker.to_json() + +# convert the object into a dict +marker_dict = marker_instance.to_dict() +# create an instance of Marker from a dict +marker_form_dict = marker.from_dict(marker_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/Monitor.md b/test_results_api/docs/Monitor.md new file mode 100644 index 00000000..f054012f --- /dev/null +++ b/test_results_api/docs/Monitor.md @@ -0,0 +1,30 @@ +# Monitor + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**monitor_id** | **str** | Unique monitor ID. | [optional] [readonly] +**monitor_name** | **str** | The name of the Monitor. | [optional] [readonly] +**country_id** | **str** | 2-digit ISO country code. | [optional] [readonly] + +## Example + +```python +from test_results_api.models.monitor import Monitor + +# TODO update the JSON string below +json = "{}" +# create an instance of Monitor from a JSON string +monitor_instance = Monitor.from_json(json) +# print the JSON string representation of the object +print Monitor.to_json() + +# convert the object into a dict +monitor_dict = monitor_instance.to_dict() +# create an instance of Monitor from a dict +monitor_form_dict = monitor.from_dict(monitor_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/NetworkBGPTestMetricsApi.md b/test_results_api/docs/NetworkBGPTestMetricsApi.md new file mode 100644 index 00000000..fc83d7ee --- /dev/null +++ b/test_results_api/docs/NetworkBGPTestMetricsApi.md @@ -0,0 +1,196 @@ +# test_results_api.NetworkBGPTestMetricsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_results_bgp**](NetworkBGPTestMetricsApi.md#get_test_results_bgp) | **GET** /v7/test-results/{testId}/bgp | Get BGP test results +[**get_test_results_bgp_prefix**](NetworkBGPTestMetricsApi.md#get_test_results_bgp_prefix) | **GET** /v7/test-results/{testId}/bgp/routes/prefix/{prefixId}/round/{roundId} | Get BGP route test results by prefix + + +# **get_test_results_bgp** +> GetTestResultsBgp200Response get_test_results_bgp(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get BGP test results + +Returns a list of BGP monitors actively monitoring the destination's target prefix. This list includes information about the prefix, its associated AS Number, and provides details regarding reachability, path updates, and any changes in the path for the target network. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_results_bgp200_response import GetTestResultsBgp200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.NetworkBGPTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # Get BGP test results + api_response = api_instance.get_test_results_bgp(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of NetworkBGPTestMetricsApi->get_test_results_bgp:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkBGPTestMetricsApi->get_test_results_bgp: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**GetTestResultsBgp200Response**](GetTestResultsBgp200Response.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 | - | +**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) + +# **get_test_results_bgp_prefix** +> GetTestResultsBgpPrefix200Response get_test_results_bgp_prefix(test_id, prefix_id, round_id, aid=aid) + +Get BGP route test results by prefix + +Returns an ordered list of networks crossed by a particular network prefix, including assigned monitors for the test and the paths taken to reach the destination. This is similar to revealing ASPath details found in a BGP Routing Information Base (rib) dump. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_results_bgp_prefix200_response import GetTestResultsBgpPrefix200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.NetworkBGPTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + prefix_id = '3789376546' # str | The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint. + round_id = '1384309800' # str | Round ID + 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: + # Get BGP route test results by prefix + api_response = api_instance.get_test_results_bgp_prefix(test_id, prefix_id, round_id, aid=aid) + print("The response of NetworkBGPTestMetricsApi->get_test_results_bgp_prefix:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkBGPTestMetricsApi->get_test_results_bgp_prefix: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **prefix_id** | **str**| The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint. | + **round_id** | **str**| Round ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetTestResultsBgpPrefix200Response**](GetTestResultsBgpPrefix200Response.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/test_results_api/docs/NetworkTestMetricsApi.md b/test_results_api/docs/NetworkTestMetricsApi.md new file mode 100644 index 00000000..6096c106 --- /dev/null +++ b/test_results_api/docs/NetworkTestMetricsApi.md @@ -0,0 +1,301 @@ +# test_results_api.NetworkTestMetricsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_pathvis_agent_round**](NetworkTestMetricsApi.md#get_test_pathvis_agent_round) | **GET** /v7/test-results/{testId}/pathvis/agent/{agentId}/round/{roundId} | Get pathvis test results by agent and round +[**get_test_result_metrics**](NetworkTestMetricsApi.md#get_test_result_metrics) | **GET** /v7/test-results/{testId}/network | Get network test results +[**get_test_result_network_pathvis**](NetworkTestMetricsApi.md#get_test_result_network_pathvis) | **GET** /v7/test-results/{testId}/pathvis | Get pathvis network test results + + +# **get_test_pathvis_agent_round** +> GetTestPathvisAgentRound200Response get_test_pathvis_agent_round(test_id, agent_id, round_id, aid=aid, direction=direction) + +Get pathvis test results by agent and round + +Returns a summary of the path trace data collected during path visualization for a given agent and round. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `pathvis?direction=to-target`. For results from agent D to agent A, you can use `pathvis?direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_pathvis_agent_round200_response import GetTestPathvisAgentRound200Response +from test_results_api.models.test_direction import TestDirection +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.NetworkTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + agent_id = '11' # str | Agent ID + round_id = '1384309800' # str | Round ID + 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) + direction = test_results_api.TestDirection() # TestDirection | Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. (optional) + + try: + # Get pathvis test results by agent and round + api_response = api_instance.get_test_pathvis_agent_round(test_id, agent_id, round_id, aid=aid, direction=direction) + print("The response of NetworkTestMetricsApi->get_test_pathvis_agent_round:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkTestMetricsApi->get_test_pathvis_agent_round: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_id** | **str**| Agent ID | + **round_id** | **str**| Round ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **direction** | [**TestDirection**](.md)| Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. | [optional] + +### Return type + +[**GetTestPathvisAgentRound200Response**](GetTestPathvisAgentRound200Response.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 | - | +**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) + +# **get_test_result_metrics** +> GetTestResultMetrics200Response get_test_result_metrics(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, direction=direction) + +Get network test results + +Returns network test results for every agent and round. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_metrics200_response import GetTestResultMetrics200Response +from test_results_api.models.test_direction import TestDirection +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.NetworkTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + direction = test_results_api.TestDirection() # TestDirection | Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. (optional) + + try: + # Get network test results + api_response = api_instance.get_test_result_metrics(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, direction=direction) + print("The response of NetworkTestMetricsApi->get_test_result_metrics:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkTestMetricsApi->get_test_result_metrics: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **direction** | [**TestDirection**](.md)| Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. | [optional] + +### Return type + +[**GetTestResultMetrics200Response**](GetTestResultMetrics200Response.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 | - | +**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) + +# **get_test_result_network_pathvis** +> GetTestResultNetworkPathvis200Response get_test_result_network_pathvis(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, direction=direction) + +Get pathvis network test results + +Returns a summary of the path trace data collected during path visualization for a given time range. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `pathvis?direction=to-target`. For results from agent D to agent A, you can use `pathvis?direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_network_pathvis200_response import GetTestResultNetworkPathvis200Response +from test_results_api.models.test_direction import TestDirection +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.NetworkTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + direction = test_results_api.TestDirection() # TestDirection | Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. (optional) + + try: + # Get pathvis network test results + api_response = api_instance.get_test_result_network_pathvis(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, direction=direction) + print("The response of NetworkTestMetricsApi->get_test_result_network_pathvis:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkTestMetricsApi->get_test_result_network_pathvis: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **direction** | [**TestDirection**](.md)| Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. | [optional] + +### Return type + +[**GetTestResultNetworkPathvis200Response**](GetTestResultNetworkPathvis200Response.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/test_results_api/docs/NetworkTestResult.md b/test_results_api/docs/NetworkTestResult.md new file mode 100644 index 00000000..0a1d013e --- /dev/null +++ b/test_results_api/docs/NetworkTestResult.md @@ -0,0 +1,44 @@ +# NetworkTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date in UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] +**available_bandwidth** | **float** | | [optional] [readonly] +**avg_latency** | **float** | Average RTT for packets sent to destination | [optional] [readonly] +**bandwidth** | **float** | | [optional] [readonly] +**capacity** | **float** | | [optional] [readonly] +**jitter** | **float** | Standard deviation of latency | [optional] [readonly] +**loss** | **float** | Percentage of packets not reaching destination | [optional] [readonly] +**max_latency** | **float** | Maximum RTT for packets sent to destination | [optional] [readonly] +**min_latency** | **float** | Minimum RTT for packets sent to destination | [optional] [readonly] +**agent** | [**Agent**](Agent.md) | | [optional] +**server_ip** | **str** | IP of target server | [optional] [readonly] +**server** | **str** | Target server, including port (if method used is TCP) | [optional] [readonly] +**direction** | [**TestDirection**](TestDirection.md) | | [optional] + +## Example + +```python +from test_results_api.models.network_test_result import NetworkTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkTestResult from a JSON string +network_test_result_instance = NetworkTestResult.from_json(json) +# print the JSON string representation of the object +print NetworkTestResult.to_json() + +# convert the object into a dict +network_test_result_dict = network_test_result_instance.to_dict() +# create an instance of NetworkTestResult from a dict +network_test_result_form_dict = network_test_result.from_dict(network_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/NetworkTestResults.md b/test_results_api/docs/NetworkTestResults.md new file mode 100644 index 00000000..d7062e55 --- /dev/null +++ b/test_results_api/docs/NetworkTestResults.md @@ -0,0 +1,29 @@ +# NetworkTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[NetworkTestResult]**](NetworkTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.network_test_results import NetworkTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkTestResults from a JSON string +network_test_results_instance = NetworkTestResults.from_json(json) +# print the JSON string representation of the object +print NetworkTestResults.to_json() + +# convert the object into a dict +network_test_results_dict = network_test_results_instance.to_dict() +# create an instance of NetworkTestResults from a dict +network_test_results_form_dict = network_test_results.from_dict(network_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/Page.md b/test_results_api/docs/Page.md new file mode 100644 index 00000000..4458777b --- /dev/null +++ b/test_results_api/docs/Page.md @@ -0,0 +1,32 @@ +# Page + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page_num** | **int** | Page index | [optional] [readonly] +**page_name** | **str** | Meta title value for page visited | [optional] [readonly] +**component_count** | **int** | Number of components on target page | [optional] [readonly] +**error_count** | **int** | Number of errors encountered during page load | [optional] [readonly] +**duration** | **float** | Time spent on page in milliseconds | [optional] [readonly] + +## Example + +```python +from test_results_api.models.page import Page + +# TODO update the JSON string below +json = "{}" +# create an instance of Page from a JSON string +page_instance = Page.from_json(json) +# print the JSON string representation of the object +print Page.to_json() + +# convert the object into a dict +page_dict = page_instance.to_dict() +# create an instance of Page from a dict +page_form_dict = page.from_dict(page_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PageLoadDetailTestResult.md b/test_results_api/docs/PageLoadDetailTestResult.md new file mode 100644 index 00000000..dc99e5e0 --- /dev/null +++ b/test_results_api/docs/PageLoadDetailTestResult.md @@ -0,0 +1,38 @@ +# PageLoadDetailTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**agent** | [**Agent**](Agent.md) | | [optional] +**response_time** | **float** | Time to first byte in milliseconds | [optional] [readonly] +**total_size** | **int** | Sum of wire size of all objects on page in bytes | [optional] [readonly] +**num_objects** | **int** | Number of objects found on the page | [optional] [readonly] +**num_errors** | **int** | Number of objects which encountered errors during download | [optional] [readonly] +**dom_load_time** | **int** | Time to interaction in milliseconds | [optional] [readonly] +**page_load_time** | **int** | Time to completely load page in milliseconds | [optional] [readonly] +**har** | **object** | See [HAR specification](http://www.softwareishard.com/blog/har-12-spec/) for details | [optional] [readonly] + +## Example + +```python +from test_results_api.models.page_load_detail_test_result import PageLoadDetailTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PageLoadDetailTestResult from a JSON string +page_load_detail_test_result_instance = PageLoadDetailTestResult.from_json(json) +# print the JSON string representation of the object +print PageLoadDetailTestResult.to_json() + +# convert the object into a dict +page_load_detail_test_result_dict = page_load_detail_test_result_instance.to_dict() +# create an instance of PageLoadDetailTestResult from a dict +page_load_detail_test_result_form_dict = page_load_detail_test_result.from_dict(page_load_detail_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PageLoadDetailTestResults.md b/test_results_api/docs/PageLoadDetailTestResults.md new file mode 100644 index 00000000..dc32e60b --- /dev/null +++ b/test_results_api/docs/PageLoadDetailTestResults.md @@ -0,0 +1,29 @@ +# PageLoadDetailTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PageLoadDetailTestResult]**](PageLoadDetailTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.page_load_detail_test_results import PageLoadDetailTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of PageLoadDetailTestResults from a JSON string +page_load_detail_test_results_instance = PageLoadDetailTestResults.from_json(json) +# print the JSON string representation of the object +print PageLoadDetailTestResults.to_json() + +# convert the object into a dict +page_load_detail_test_results_dict = page_load_detail_test_results_instance.to_dict() +# create an instance of PageLoadDetailTestResults from a dict +page_load_detail_test_results_form_dict = page_load_detail_test_results.from_dict(page_load_detail_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PageLoadTestResult.md b/test_results_api/docs/PageLoadTestResult.md new file mode 100644 index 00000000..0b681e4d --- /dev/null +++ b/test_results_api/docs/PageLoadTestResult.md @@ -0,0 +1,37 @@ +# PageLoadTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**agent** | [**Agent**](Agent.md) | | [optional] +**response_time** | **float** | Time to first byte in milliseconds | [optional] [readonly] +**total_size** | **int** | Sum of wire size of all objects on page in bytes | [optional] [readonly] +**num_objects** | **int** | Number of objects found on the page | [optional] [readonly] +**num_errors** | **int** | Number of objects which encountered errors during download | [optional] [readonly] +**dom_load_time** | **int** | Time to interaction in milliseconds | [optional] [readonly] +**page_load_time** | **int** | Time to completely load page in milliseconds | [optional] [readonly] + +## Example + +```python +from test_results_api.models.page_load_test_result import PageLoadTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PageLoadTestResult from a JSON string +page_load_test_result_instance = PageLoadTestResult.from_json(json) +# print the JSON string representation of the object +print PageLoadTestResult.to_json() + +# convert the object into a dict +page_load_test_result_dict = page_load_test_result_instance.to_dict() +# create an instance of PageLoadTestResult from a dict +page_load_test_result_form_dict = page_load_test_result.from_dict(page_load_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PageLoadTestResults.md b/test_results_api/docs/PageLoadTestResults.md new file mode 100644 index 00000000..a3a90f61 --- /dev/null +++ b/test_results_api/docs/PageLoadTestResults.md @@ -0,0 +1,29 @@ +# PageLoadTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PageLoadTestResult]**](PageLoadTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.page_load_test_results import PageLoadTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of PageLoadTestResults from a JSON string +page_load_test_results_instance = PageLoadTestResults.from_json(json) +# print the JSON string representation of the object +print PageLoadTestResults.to_json() + +# convert the object into a dict +page_load_test_results_dict = page_load_test_results_instance.to_dict() +# create an instance of PageLoadTestResults from a dict +page_load_test_results_form_dict = page_load_test_results.from_dict(page_load_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PaginationLinks.md b/test_results_api/docs/PaginationLinks.md new file mode 100644 index 00000000..2b864257 --- /dev/null +++ b/test_results_api/docs/PaginationLinks.md @@ -0,0 +1,29 @@ +# PaginationLinks + +A links object containing pagination related link(s). + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**PaginationLinksLinks**](PaginationLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.pagination_links import PaginationLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationLinks from a JSON string +pagination_links_instance = PaginationLinks.from_json(json) +# print the JSON string representation of the object +print PaginationLinks.to_json() + +# convert the object into a dict +pagination_links_dict = pagination_links_instance.to_dict() +# create an instance of PaginationLinks from a dict +pagination_links_form_dict = pagination_links.from_dict(pagination_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PaginationLinksLinks.md b/test_results_api/docs/PaginationLinksLinks.md new file mode 100644 index 00000000..002477dc --- /dev/null +++ b/test_results_api/docs/PaginationLinksLinks.md @@ -0,0 +1,29 @@ +# PaginationLinksLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**previous** | [**Link**](Link.md) | | [optional] +**next** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from test_results_api.models.pagination_links_links import PaginationLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationLinksLinks from a JSON string +pagination_links_links_instance = PaginationLinksLinks.from_json(json) +# print the JSON string representation of the object +print PaginationLinksLinks.to_json() + +# convert the object into a dict +pagination_links_links_dict = pagination_links_links_instance.to_dict() +# create an instance of PaginationLinksLinks from a dict +pagination_links_links_form_dict = pagination_links_links.from_dict(pagination_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PathVisBaseTestResult.md b/test_results_api/docs/PathVisBaseTestResult.md new file mode 100644 index 00000000..82ab1097 --- /dev/null +++ b/test_results_api/docs/PathVisBaseTestResult.md @@ -0,0 +1,39 @@ +# PathVisBaseTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] +**agent** | [**Agent**](Agent.md) | | [optional] +**server** | **str** | Target server, including port (if method used is TCP) | [optional] [readonly] +**server_ip** | **str** | IP of target server | [optional] [readonly] +**source_ip** | **str** | IP address of source agent | [optional] [readonly] +**source_prefix** | **str** | IP prefix of source agent | [optional] [readonly] +**target_is_proxy** | **bool** | | [optional] [readonly] +**direction** | [**TestDirection**](TestDirection.md) | | [optional] + +## Example + +```python +from test_results_api.models.path_vis_base_test_result import PathVisBaseTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisBaseTestResult from a JSON string +path_vis_base_test_result_instance = PathVisBaseTestResult.from_json(json) +# print the JSON string representation of the object +print PathVisBaseTestResult.to_json() + +# convert the object into a dict +path_vis_base_test_result_dict = path_vis_base_test_result_instance.to_dict() +# create an instance of PathVisBaseTestResult from a dict +path_vis_base_test_result_form_dict = path_vis_base_test_result.from_dict(path_vis_base_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PathVisDetailTestResult.md b/test_results_api/docs/PathVisDetailTestResult.md new file mode 100644 index 00000000..e4a320eb --- /dev/null +++ b/test_results_api/docs/PathVisDetailTestResult.md @@ -0,0 +1,40 @@ +# PathVisDetailTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] +**agent** | [**Agent**](Agent.md) | | [optional] +**server** | **str** | Target server, including port (if method used is TCP) | [optional] [readonly] +**server_ip** | **str** | IP of target server | [optional] [readonly] +**source_ip** | **str** | IP address of source agent | [optional] [readonly] +**source_prefix** | **str** | IP prefix of source agent | [optional] [readonly] +**target_is_proxy** | **bool** | | [optional] [readonly] +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**routes** | [**List[PathVisRoute]**](PathVisRoute.md) | Shows 3 iterations of path trace, with each iteration specified by a pathId | [optional] + +## Example + +```python +from test_results_api.models.path_vis_detail_test_result import PathVisDetailTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDetailTestResult from a JSON string +path_vis_detail_test_result_instance = PathVisDetailTestResult.from_json(json) +# print the JSON string representation of the object +print PathVisDetailTestResult.to_json() + +# convert the object into a dict +path_vis_detail_test_result_dict = path_vis_detail_test_result_instance.to_dict() +# create an instance of PathVisDetailTestResult from a dict +path_vis_detail_test_result_form_dict = path_vis_detail_test_result.from_dict(path_vis_detail_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PathVisDetailTestResults.md b/test_results_api/docs/PathVisDetailTestResults.md new file mode 100644 index 00000000..3253f069 --- /dev/null +++ b/test_results_api/docs/PathVisDetailTestResults.md @@ -0,0 +1,29 @@ +# PathVisDetailTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisDetailTestResult]**](PathVisDetailTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.path_vis_detail_test_results import PathVisDetailTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDetailTestResults from a JSON string +path_vis_detail_test_results_instance = PathVisDetailTestResults.from_json(json) +# print the JSON string representation of the object +print PathVisDetailTestResults.to_json() + +# convert the object into a dict +path_vis_detail_test_results_dict = path_vis_detail_test_results_instance.to_dict() +# create an instance of PathVisDetailTestResults from a dict +path_vis_detail_test_results_form_dict = path_vis_detail_test_results.from_dict(path_vis_detail_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PathVisEndpoint.md b/test_results_api/docs/PathVisEndpoint.md new file mode 100644 index 00000000..7dee720a --- /dev/null +++ b/test_results_api/docs/PathVisEndpoint.md @@ -0,0 +1,33 @@ +# PathVisEndpoint + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_address** | **str** | IP address of the hop | [optional] [readonly] +**mss** | **int** | Maximum segment size in bytes | [optional] [readonly] +**number_of_hops** | **int** | Number of hops for path trace to destination | [optional] [readonly] +**path_id** | **str** | Unique ID of path trace | [optional] [readonly] +**path_mtu** | **str** | Location information for the hop | [optional] [readonly] +**response_time** | **int** | RTT of the path trace to the destination in milliseconds | [optional] [readonly] + +## Example + +```python +from test_results_api.models.path_vis_endpoint import PathVisEndpoint + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisEndpoint from a JSON string +path_vis_endpoint_instance = PathVisEndpoint.from_json(json) +# print the JSON string representation of the object +print PathVisEndpoint.to_json() + +# convert the object into a dict +path_vis_endpoint_dict = path_vis_endpoint_instance.to_dict() +# create an instance of PathVisEndpoint from a dict +path_vis_endpoint_form_dict = path_vis_endpoint.from_dict(path_vis_endpoint_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PathVisHop.md b/test_results_api/docs/PathVisHop.md new file mode 100644 index 00000000..56aa7902 --- /dev/null +++ b/test_results_api/docs/PathVisHop.md @@ -0,0 +1,35 @@ +# PathVisHop + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hop** | **int** | Hop index | [optional] [readonly] +**ip_address** | **str** | IP address of the hop | [optional] [readonly] +**prefix** | **str** | Prefix of IP address shown in CIDR | [optional] [readonly] +**rdns** | **str** | Reverse DNS entry of IP, if available | [optional] [readonly] +**network** | **str** | Autonomous System originating the prefix | [optional] [readonly] +**response_time** | **int** | RTT to the hop’s IP in milliseconds | [optional] [readonly] +**location** | **str** | Location information for the hop | [optional] [readonly] +**mpls** | **str** | Multiprotocol Label Switching information, if available | [optional] [readonly] + +## Example + +```python +from test_results_api.models.path_vis_hop import PathVisHop + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisHop from a JSON string +path_vis_hop_instance = PathVisHop.from_json(json) +# print the JSON string representation of the object +print PathVisHop.to_json() + +# convert the object into a dict +path_vis_hop_dict = path_vis_hop_instance.to_dict() +# create an instance of PathVisHop from a dict +path_vis_hop_form_dict = path_vis_hop.from_dict(path_vis_hop_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PathVisRoute.md b/test_results_api/docs/PathVisRoute.md new file mode 100644 index 00000000..4e88edec --- /dev/null +++ b/test_results_api/docs/PathVisRoute.md @@ -0,0 +1,29 @@ +# PathVisRoute + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**path_id** | **str** | Unique ID of path trace | [optional] [readonly] +**hops** | [**List[PathVisHop]**](PathVisHop.md) | Array of hop objects indicating each step in the traceroute | [optional] + +## Example + +```python +from test_results_api.models.path_vis_route import PathVisRoute + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisRoute from a JSON string +path_vis_route_instance = PathVisRoute.from_json(json) +# print the JSON string representation of the object +print PathVisRoute.to_json() + +# convert the object into a dict +path_vis_route_dict = path_vis_route_instance.to_dict() +# create an instance of PathVisRoute from a dict +path_vis_route_form_dict = path_vis_route.from_dict(path_vis_route_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PathVisTestResult.md b/test_results_api/docs/PathVisTestResult.md new file mode 100644 index 00000000..eded7878 --- /dev/null +++ b/test_results_api/docs/PathVisTestResult.md @@ -0,0 +1,40 @@ +# PathVisTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] +**agent** | [**Agent**](Agent.md) | | [optional] +**server** | **str** | Target server, including port (if method used is TCP) | [optional] [readonly] +**server_ip** | **str** | IP of target server | [optional] [readonly] +**source_ip** | **str** | IP address of source agent | [optional] [readonly] +**source_prefix** | **str** | IP prefix of source agent | [optional] [readonly] +**target_is_proxy** | **bool** | | [optional] [readonly] +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**endpoints** | [**List[PathVisEndpoint]**](PathVisEndpoint.md) | Shows all iterations of path trace, with each iteration specified by a pathId | [optional] + +## Example + +```python +from test_results_api.models.path_vis_test_result import PathVisTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisTestResult from a JSON string +path_vis_test_result_instance = PathVisTestResult.from_json(json) +# print the JSON string representation of the object +print PathVisTestResult.to_json() + +# convert the object into a dict +path_vis_test_result_dict = path_vis_test_result_instance.to_dict() +# create an instance of PathVisTestResult from a dict +path_vis_test_result_form_dict = path_vis_test_result.from_dict(path_vis_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/PathVisTestResults.md b/test_results_api/docs/PathVisTestResults.md new file mode 100644 index 00000000..1210688a --- /dev/null +++ b/test_results_api/docs/PathVisTestResults.md @@ -0,0 +1,29 @@ +# PathVisTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisTestResult]**](PathVisTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.path_vis_test_results import PathVisTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisTestResults from a JSON string +path_vis_test_results_instance = PathVisTestResults.from_json(json) +# print the JSON string representation of the object +print PathVisTestResults.to_json() + +# convert the object into a dict +path_vis_test_results_dict = path_vis_test_results_instance.to_dict() +# create an instance of PathVisTestResults from a dict +path_vis_test_results_form_dict = path_vis_test_results.from_dict(path_vis_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/QueryWindow.md b/test_results_api/docs/QueryWindow.md new file mode 100644 index 00000000..82dc47d1 --- /dev/null +++ b/test_results_api/docs/QueryWindow.md @@ -0,0 +1,29 @@ +# QueryWindow + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] + +## Example + +```python +from test_results_api.models.query_window import QueryWindow + +# TODO update the JSON string below +json = "{}" +# create an instance of QueryWindow from a JSON string +query_window_instance = QueryWindow.from_json(json) +# print the JSON string representation of the object +print QueryWindow.to_json() + +# convert the object into a dict +query_window_dict = query_window_instance.to_dict() +# create an instance of QueryWindow from a dict +query_window_form_dict = query_window.from_dict(query_window_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/RtpStreamTestResult.md b/test_results_api/docs/RtpStreamTestResult.md new file mode 100644 index 00000000..07cffe24 --- /dev/null +++ b/test_results_api/docs/RtpStreamTestResult.md @@ -0,0 +1,42 @@ +# RtpStreamTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**agent** | [**Agent**](Agent.md) | | [optional] +**server_ip** | **str** | Target agent IP address | [optional] [readonly] +**dscp** | **str** | DSCP value received by the server from the agent | [optional] [readonly] +**dscp_name** | **str** | Name of DSCP value received by the server from the agent | [optional] [readonly] +**mos** | **float** | Mean opinion score for agent’s stream | [optional] [readonly] +**codec_name** | **str** | Name of codec used by agen | [optional] [readonly] +**codec_max_mos** | **float** | Maximum value of Mean Opinion Score based on codec selection | [optional] [readonly] +**loss** | **float** | Percentage value of packets sent from agent not received by server | [optional] [readonly] +**discards** | **float** | Percentage of packets discarded | [optional] [readonly] +**latency** | **int** | Time to send packets from source to server in milliseconds | [optional] [readonly] +**pdv** | **int** | Variation in packet delay in milliseconds | [optional] [readonly] +**error_detail** | **str** | Error details, if an error was encountered | [optional] [readonly] + +## Example + +```python +from test_results_api.models.rtp_stream_test_result import RtpStreamTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of RtpStreamTestResult from a JSON string +rtp_stream_test_result_instance = RtpStreamTestResult.from_json(json) +# print the JSON string representation of the object +print RtpStreamTestResult.to_json() + +# convert the object into a dict +rtp_stream_test_result_dict = rtp_stream_test_result_instance.to_dict() +# create an instance of RtpStreamTestResult from a dict +rtp_stream_test_result_form_dict = rtp_stream_test_result.from_dict(rtp_stream_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/RtpStreamTestResults.md b/test_results_api/docs/RtpStreamTestResults.md new file mode 100644 index 00000000..3cd27cee --- /dev/null +++ b/test_results_api/docs/RtpStreamTestResults.md @@ -0,0 +1,29 @@ +# RtpStreamTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[RtpStreamTestResult]**](RtpStreamTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.rtp_stream_test_results import RtpStreamTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of RtpStreamTestResults from a JSON string +rtp_stream_test_results_instance = RtpStreamTestResults.from_json(json) +# print the JSON string representation of the object +print RtpStreamTestResults.to_json() + +# convert the object into a dict +rtp_stream_test_results_dict = rtp_stream_test_results_instance.to_dict() +# create an instance of RtpStreamTestResults from a dict +rtp_stream_test_results_form_dict = rtp_stream_test_results.from_dict(rtp_stream_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/SelfLinks.md b/test_results_api/docs/SelfLinks.md new file mode 100644 index 00000000..f3bf2ff8 --- /dev/null +++ b/test_results_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/SelfLinksLinks.md b/test_results_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..2eecc7cc --- /dev/null +++ b/test_results_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from test_results_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/SimpleTest.md b/test_results_api/docs/SimpleTest.md new file mode 100644 index 00000000..744e15d9 --- /dev/null +++ b/test_results_api/docs/SimpleTest.md @@ -0,0 +1,42 @@ +# SimpleTest + +Each test includes additional fields depending on its `type`. Refer `/tests/{type}` endpoint to know the set of fields returned by a given `type`. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | [**TestType**](TestType.md) | | [optional] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.simple_test import SimpleTest + +# TODO update the JSON string below +json = "{}" +# create an instance of SimpleTest from a JSON string +simple_test_instance = SimpleTest.from_json(json) +# print the JSON string representation of the object +print SimpleTest.to_json() + +# convert the object into a dict +simple_test_dict = simple_test_instance.to_dict() +# create an instance of SimpleTest from a dict +simple_test_form_dict = simple_test.from_dict(simple_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/SipServerErrorType.md b/test_results_api/docs/SipServerErrorType.md new file mode 100644 index 00000000..470dbab0 --- /dev/null +++ b/test_results_api/docs/SipServerErrorType.md @@ -0,0 +1,11 @@ +# SipServerErrorType + +Error type, none if there is no error + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/SipServerTestResult.md b/test_results_api/docs/SipServerTestResult.md new file mode 100644 index 00000000..b409347d --- /dev/null +++ b/test_results_api/docs/SipServerTestResult.md @@ -0,0 +1,47 @@ +# SipServerTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**server_ip** | **str** | Target agent IP address | [optional] [readonly] +**agent** | [**Agent**](Agent.md) | | [optional] +**availability** | **float** | availability of the service | [optional] [readonly] +**connect_time** | **int** | Time required to establish a TCP connection to the server in milliseconds, only available when TCP is configured as protocol | [optional] [readonly] +**dns_time** | **int** | Time required to resolve DNS in milliseconds | [optional] [readonly] +**invite_time** | **int** | Time to complete INVITE in milliseconds | [optional] [readonly] +**options_time** | **int** | Time to complete OPTIONS in milliseconds | [optional] [readonly] +**num_redirects** | **int** | Number of redirects | [optional] [readonly] +**options_request** | **str** | Entire OPTIONS request | [optional] [readonly] +**options_response** | **str** | Entire OPTIONS response | [optional] [readonly] +**register_time** | **int** | Time to complete REGISTER in milliseconds | [optional] [readonly] +**response_code** | **int** | SIP server response code | [optional] [readonly] +**response_time** | **int** | Time to first byte | [optional] [readonly] +**total_time** | **int** | Total time | [optional] [readonly] +**wait_time** | **int** | Time elapsed between completion of request and first byte of response | [optional] [readonly] +**error_type** | [**SipServerErrorType**](SipServerErrorType.md) | | [optional] +**problem_detail** | **str** | Error details, if an error was encountered | [optional] [readonly] + +## Example + +```python +from test_results_api.models.sip_server_test_result import SipServerTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of SipServerTestResult from a JSON string +sip_server_test_result_instance = SipServerTestResult.from_json(json) +# print the JSON string representation of the object +print SipServerTestResult.to_json() + +# convert the object into a dict +sip_server_test_result_dict = sip_server_test_result_instance.to_dict() +# create an instance of SipServerTestResult from a dict +sip_server_test_result_form_dict = sip_server_test_result.from_dict(sip_server_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/SipServerTestResults.md b/test_results_api/docs/SipServerTestResults.md new file mode 100644 index 00000000..27167ad3 --- /dev/null +++ b/test_results_api/docs/SipServerTestResults.md @@ -0,0 +1,29 @@ +# SipServerTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[SipServerTestResult]**](SipServerTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.sip_server_test_results import SipServerTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of SipServerTestResults from a JSON string +sip_server_test_results_instance = SipServerTestResults.from_json(json) +# print the JSON string representation of the object +print SipServerTestResults.to_json() + +# convert the object into a dict +sip_server_test_results_dict = sip_server_test_results_instance.to_dict() +# create an instance of SipServerTestResults from a dict +sip_server_test_results_form_dict = sip_server_test_results.from_dict(sip_server_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/SslCert.md b/test_results_api/docs/SslCert.md new file mode 100644 index 00000000..7e29a8bb --- /dev/null +++ b/test_results_api/docs/SslCert.md @@ -0,0 +1,35 @@ +# SslCert + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**days_until_expiry** | **int** | Days until certificate expires, rounded down. 0 is shown if there are less than 24 hours remaining. Calculated when the test was executed. | [optional] +**is_fetch_date_in_valid_cert_date_range** | **str** | True when certificate fetch date is within the valid certificate date range, false otherwise | [optional] +**has_valid_signing_cert** | **str** | This field is implicitly true; it is output only when false. false indicates this certificate was missing a valid signing certificate in the chain. | [optional] +**issuer_name** | **str** | Certificate issuer | [optional] +**valid_before** | **datetime** | Certificate is not valid after this date | [optional] +**valid_after** | **datetime** | Certificate is not valid before this date | [optional] +**subject_alternative_names** | **List[str]** | Alternative name(s) of the certificate subject, extracted from the Subject Alternative Name (SAN) X.509 certificate extension, for example example.com, www2.example.com | [optional] +**subject_name** | **str** | certificate’s subject name - a value of the common name (CN) RDN from the certificate’s Subject attribute, for example www.example.com | [optional] + +## Example + +```python +from test_results_api.models.ssl_cert import SslCert + +# TODO update the JSON string below +json = "{}" +# create an instance of SslCert from a JSON string +ssl_cert_instance = SslCert.from_json(json) +# print the JSON string representation of the object +print SslCert.to_json() + +# convert the object into a dict +ssl_cert_dict = ssl_cert_instance.to_dict() +# create an instance of SslCert from a dict +ssl_cert_form_dict = ssl_cert.from_dict(ssl_cert_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/TestDirection.md b/test_results_api/docs/TestDirection.md new file mode 100644 index 00000000..59dab3fb --- /dev/null +++ b/test_results_api/docs/TestDirection.md @@ -0,0 +1,11 @@ +# TestDirection + +Direction of the test, which affects how results are shown. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/TestInterval.md b/test_results_api/docs/TestInterval.md new file mode 100644 index 00000000..e0e57d69 --- /dev/null +++ b/test_results_api/docs/TestInterval.md @@ -0,0 +1,11 @@ +# TestInterval + +Interval between test runs in seconds. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/TestResult.md b/test_results_api/docs/TestResult.md new file mode 100644 index 00000000..0d161a85 --- /dev/null +++ b/test_results_api/docs/TestResult.md @@ -0,0 +1,30 @@ +# TestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | **object** | | [optional] +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] + +## Example + +```python +from test_results_api.models.test_result import TestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of TestResult from a JSON string +test_result_instance = TestResult.from_json(json) +# print the JSON string representation of the object +print TestResult.to_json() + +# convert the object into a dict +test_result_dict = test_result_instance.to_dict() +# create an instance of TestResult from a dict +test_result_form_dict = test_result.from_dict(test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/TestResultAppLinks.md b/test_results_api/docs/TestResultAppLinks.md new file mode 100644 index 00000000..93c067e7 --- /dev/null +++ b/test_results_api/docs/TestResultAppLinks.md @@ -0,0 +1,28 @@ +# TestResultAppLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | **object** | | [optional] + +## Example + +```python +from test_results_api.models.test_result_app_links import TestResultAppLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of TestResultAppLinks from a JSON string +test_result_app_links_instance = TestResultAppLinks.from_json(json) +# print the JSON string representation of the object +print TestResultAppLinks.to_json() + +# convert the object into a dict +test_result_app_links_dict = test_result_app_links_instance.to_dict() +# create an instance of TestResultAppLinks from a dict +test_result_app_links_form_dict = test_result_app_links.from_dict(test_result_app_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/TestType.md b/test_results_api/docs/TestType.md new file mode 100644 index 00000000..ae5d924e --- /dev/null +++ b/test_results_api/docs/TestType.md @@ -0,0 +1,11 @@ +# TestType + +This is a read only value, as test type is implicit in the test creation url. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/UnauthorizedError.md b/test_results_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..e4879144 --- /dev/null +++ b/test_results_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from test_results_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/UnexpandedInstantTest.md b/test_results_api/docs/UnexpandedInstantTest.md new file mode 100644 index 00000000..2f96646f --- /dev/null +++ b/test_results_api/docs/UnexpandedInstantTest.md @@ -0,0 +1,38 @@ +# UnexpandedInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | [**TestType**](TestType.md) | | [optional] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] + +## Example + +```python +from test_results_api.models.unexpanded_instant_test import UnexpandedInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTest from a JSON string +unexpanded_instant_test_instance = UnexpandedInstantTest.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTest.to_json() + +# convert the object into a dict +unexpanded_instant_test_dict = unexpanded_instant_test_instance.to_dict() +# create an instance of UnexpandedInstantTest from a dict +unexpanded_instant_test_form_dict = unexpanded_instant_test.from_dict(unexpanded_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/UnexpandedInstantTestLinks.md b/test_results_api/docs/UnexpandedInstantTestLinks.md new file mode 100644 index 00000000..a67b7eab --- /dev/null +++ b/test_results_api/docs/UnexpandedInstantTestLinks.md @@ -0,0 +1,30 @@ +# UnexpandedInstantTestLinks + +A list of links that can be accessed to get more information + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**UnexpandedInstantTestLinksSelf**](UnexpandedInstantTestLinksSelf.md) | | [optional] +**test_results** | [**UnexpandedInstantTestLinksTestResults**](UnexpandedInstantTestLinksTestResults.md) | | [optional] + +## Example + +```python +from test_results_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinks from a JSON string +unexpanded_instant_test_links_instance = UnexpandedInstantTestLinks.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinks.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_dict = unexpanded_instant_test_links_instance.to_dict() +# create an instance of UnexpandedInstantTestLinks from a dict +unexpanded_instant_test_links_form_dict = unexpanded_instant_test_links.from_dict(unexpanded_instant_test_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/UnexpandedInstantTestLinksSelf.md b/test_results_api/docs/UnexpandedInstantTestLinksSelf.md new file mode 100644 index 00000000..c508e07a --- /dev/null +++ b/test_results_api/docs/UnexpandedInstantTestLinksSelf.md @@ -0,0 +1,35 @@ +# UnexpandedInstantTestLinksSelf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from test_results_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinksSelf from a JSON string +unexpanded_instant_test_links_self_instance = UnexpandedInstantTestLinksSelf.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinksSelf.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_self_dict = unexpanded_instant_test_links_self_instance.to_dict() +# create an instance of UnexpandedInstantTestLinksSelf from a dict +unexpanded_instant_test_links_self_form_dict = unexpanded_instant_test_links_self.from_dict(unexpanded_instant_test_links_self_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/UnexpandedInstantTestLinksTestResults.md b/test_results_api/docs/UnexpandedInstantTestLinksTestResults.md new file mode 100644 index 00000000..5c006a0d --- /dev/null +++ b/test_results_api/docs/UnexpandedInstantTestLinksTestResults.md @@ -0,0 +1,35 @@ +# UnexpandedInstantTestLinksTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from test_results_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinksTestResults from a JSON string +unexpanded_instant_test_links_test_results_instance = UnexpandedInstantTestLinksTestResults.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinksTestResults.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_test_results_dict = unexpanded_instant_test_links_test_results_instance.to_dict() +# create an instance of UnexpandedInstantTestLinksTestResults from a dict +unexpanded_instant_test_links_test_results_form_dict = unexpanded_instant_test_links_test_results.from_dict(unexpanded_instant_test_links_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/UnexpandedTest.md b/test_results_api/docs/UnexpandedTest.md new file mode 100644 index 00000000..54b806dc --- /dev/null +++ b/test_results_api/docs/UnexpandedTest.md @@ -0,0 +1,30 @@ +# UnexpandedTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] + +## Example + +```python +from test_results_api.models.unexpanded_test import UnexpandedTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedTest from a JSON string +unexpanded_test_instance = UnexpandedTest.from_json(json) +# print the JSON string representation of the object +print UnexpandedTest.to_json() + +# convert the object into a dict +unexpanded_test_dict = unexpanded_test_instance.to_dict() +# create an instance of UnexpandedTest from a dict +unexpanded_test_form_dict = unexpanded_test.from_dict(unexpanded_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/VoiceRTPServerTestMetricsApi.md b/test_results_api/docs/VoiceRTPServerTestMetricsApi.md new file mode 100644 index 00000000..30df6577 --- /dev/null +++ b/test_results_api/docs/VoiceRTPServerTestMetricsApi.md @@ -0,0 +1,104 @@ +# test_results_api.VoiceRTPServerTestMetricsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_result_rtp_stream**](VoiceRTPServerTestMetricsApi.md#get_test_result_rtp_stream) | **GET** /v7/test-results/{testId}/rtp-server | Retrieve RTP server test metrics + + +# **get_test_result_rtp_stream** +> GetTestResultRtpStream200Response get_test_result_rtp_stream(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Retrieve RTP server test metrics + +Returns Voice RTP server test results. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_rtp_stream200_response import GetTestResultRtpStream200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.VoiceRTPServerTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # Retrieve RTP server test metrics + api_response = api_instance.get_test_result_rtp_stream(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of VoiceRTPServerTestMetricsApi->get_test_result_rtp_stream:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceRTPServerTestMetricsApi->get_test_result_rtp_stream: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**GetTestResultRtpStream200Response**](GetTestResultRtpStream200Response.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/test_results_api/docs/VoiceSIPServerTestMetricsApi.md b/test_results_api/docs/VoiceSIPServerTestMetricsApi.md new file mode 100644 index 00000000..d49d5ea0 --- /dev/null +++ b/test_results_api/docs/VoiceSIPServerTestMetricsApi.md @@ -0,0 +1,104 @@ +# test_results_api.VoiceSIPServerTestMetricsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_result_sip_server**](VoiceSIPServerTestMetricsApi.md#get_test_result_sip_server) | **GET** /v7/test-results/{testId}/sip-server | Get SIP server test results + + +# **get_test_result_sip_server** +> GetTestResultSipServer200Response get_test_result_sip_server(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get SIP server test results + +Returns Voice SIP server test results. It returns data for each agent and each `roundId` within the selected time frame. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_sip_server200_response import GetTestResultSipServer200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.VoiceSIPServerTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # Get SIP server test results + api_response = api_instance.get_test_result_sip_server(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of VoiceSIPServerTestMetricsApi->get_test_result_sip_server:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceSIPServerTestMetricsApi->get_test_result_sip_server: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**GetTestResultSipServer200Response**](GetTestResultSipServer200Response.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/test_results_api/docs/WebFTPServerTestMetricsApi.md b/test_results_api/docs/WebFTPServerTestMetricsApi.md new file mode 100644 index 00000000..31761790 --- /dev/null +++ b/test_results_api/docs/WebFTPServerTestMetricsApi.md @@ -0,0 +1,104 @@ +# test_results_api.WebFTPServerTestMetricsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_result_ftp_server**](WebFTPServerTestMetricsApi.md#get_test_result_ftp_server) | **GET** /v7/test-results/{testId}/ftp-server | Get FTP server test results + + +# **get_test_result_ftp_server** +> GetTestResultFtpServer200Response get_test_result_ftp_server(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get FTP server test results + +Returns test results for FTP server requests. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_ftp_server200_response import GetTestResultFtpServer200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.WebFTPServerTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # Get FTP server test results + api_response = api_instance.get_test_result_ftp_server(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of WebFTPServerTestMetricsApi->get_test_result_ftp_server:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebFTPServerTestMetricsApi->get_test_result_ftp_server: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**GetTestResultFtpServer200Response**](GetTestResultFtpServer200Response.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/test_results_api/docs/WebHTTPServerTestMetricsApi.md b/test_results_api/docs/WebHTTPServerTestMetricsApi.md new file mode 100644 index 00000000..d77d7c33 --- /dev/null +++ b/test_results_api/docs/WebHTTPServerTestMetricsApi.md @@ -0,0 +1,107 @@ +# test_results_api.WebHTTPServerTestMetricsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_result_http_server**](WebHTTPServerTestMetricsApi.md#get_test_result_http_server) | **GET** /v7/test-results/{testId}/http-server | Get HTTP server test results + + +# **get_test_result_http_server** +> GetTestResultHttpServer200Response get_test_result_http_server(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, expand=expand) + +Get HTTP server test results + +Returns results for requests made over HTTP. Components include DNS, Connect, Wait, Receive, and Fetch. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.expand import Expand +from test_results_api.models.get_test_result_http_server200_response import GetTestResultHttpServer200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.WebHTTPServerTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + expand = [test_results_api.Expand()] # List[Expand] | This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the query. (optional) + + try: + # Get HTTP server test results + api_response = api_instance.get_test_result_http_server(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, expand=expand) + print("The response of WebHTTPServerTestMetricsApi->get_test_result_http_server:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebHTTPServerTestMetricsApi->get_test_result_http_server: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + **expand** | [**List[Expand]**](Expand.md)| This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the query. | [optional] + +### Return type + +[**GetTestResultHttpServer200Response**](GetTestResultHttpServer200Response.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/test_results_api/docs/WebPageLoadTestMetricsApi.md b/test_results_api/docs/WebPageLoadTestMetricsApi.md new file mode 100644 index 00000000..c65301d1 --- /dev/null +++ b/test_results_api/docs/WebPageLoadTestMetricsApi.md @@ -0,0 +1,196 @@ +# test_results_api.WebPageLoadTestMetricsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_result_page_load**](WebPageLoadTestMetricsApi.md#get_test_result_page_load) | **GET** /v7/test-results/{testId}/page-load | Get page load server test results +[**get_test_result_page_load_component_detail**](WebPageLoadTestMetricsApi.md#get_test_result_page_load_component_detail) | **GET** /v7/test-results/{testId}/page-load/agent/{agentId}/round/{roundId} | Get page load server test results by agent and round + + +# **get_test_result_page_load** +> GetTestResultPageLoad200Response get_test_result_page_load(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get page load server test results + +Returns results for page load server tests with a focus on page load times and DOM for a web page. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_page_load200_response import GetTestResultPageLoad200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.WebPageLoadTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # Get page load server test results + api_response = api_instance.get_test_result_page_load(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of WebPageLoadTestMetricsApi->get_test_result_page_load:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebPageLoadTestMetricsApi->get_test_result_page_load: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**GetTestResultPageLoad200Response**](GetTestResultPageLoad200Response.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 | - | +**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) + +# **get_test_result_page_load_component_detail** +> GetTestResultPageLoadComponentDetail200Response get_test_result_page_load_component_detail(test_id, agent_id, round_id, aid=aid) + +Get page load server test results by agent and round + +Returns test results for a given agent and round in [HAR (http archive)](http://www.softwareishard.com/blog/har-12-spec/) format. These results contain a list of components and their load times in a page load test, similar to the waterfall view for a page load test. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_page_load_component_detail200_response import GetTestResultPageLoadComponentDetail200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.WebPageLoadTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + agent_id = '11' # str | Agent ID + round_id = '1384309800' # str | Round ID + 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: + # Get page load server test results by agent and round + api_response = api_instance.get_test_result_page_load_component_detail(test_id, agent_id, round_id, aid=aid) + print("The response of WebPageLoadTestMetricsApi->get_test_result_page_load_component_detail:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebPageLoadTestMetricsApi->get_test_result_page_load_component_detail: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_id** | **str**| Agent ID | + **round_id** | **str**| Round ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetTestResultPageLoadComponentDetail200Response**](GetTestResultPageLoadComponentDetail200Response.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/test_results_api/docs/WebTransactionDetailTestResult.md b/test_results_api/docs/WebTransactionDetailTestResult.md new file mode 100644 index 00000000..a342e85b --- /dev/null +++ b/test_results_api/docs/WebTransactionDetailTestResult.md @@ -0,0 +1,37 @@ +# WebTransactionDetailTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**agent** | [**Agent**](Agent.md) | | [optional] +**component_errors** | **int** | Number of components which did not successfully load | [optional] [readonly] +**transaction_time** | **int** | Elapsed execution time of the web transaction script in milliseconds | [optional] [readonly] +**error_type** | **str** | Type of error encountered; corresponds to phase of connection | [optional] [readonly] +**error_details** | **str** | Error details, if an error were encountered | [optional] [readonly] +**markers** | [**List[Marker]**](Marker.md) | | [optional] +**pages** | [**List[Page]**](Page.md) | | [optional] + +## Example + +```python +from test_results_api.models.web_transaction_detail_test_result import WebTransactionDetailTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionDetailTestResult from a JSON string +web_transaction_detail_test_result_instance = WebTransactionDetailTestResult.from_json(json) +# print the JSON string representation of the object +print WebTransactionDetailTestResult.to_json() + +# convert the object into a dict +web_transaction_detail_test_result_dict = web_transaction_detail_test_result_instance.to_dict() +# create an instance of WebTransactionDetailTestResult from a dict +web_transaction_detail_test_result_form_dict = web_transaction_detail_test_result.from_dict(web_transaction_detail_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/WebTransactionDetailTestResults.md b/test_results_api/docs/WebTransactionDetailTestResults.md new file mode 100644 index 00000000..dd71247c --- /dev/null +++ b/test_results_api/docs/WebTransactionDetailTestResults.md @@ -0,0 +1,29 @@ +# WebTransactionDetailTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[WebTransactionDetailTestResult]**](WebTransactionDetailTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.web_transaction_detail_test_results import WebTransactionDetailTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionDetailTestResults from a JSON string +web_transaction_detail_test_results_instance = WebTransactionDetailTestResults.from_json(json) +# print the JSON string representation of the object +print WebTransactionDetailTestResults.to_json() + +# convert the object into a dict +web_transaction_detail_test_results_dict = web_transaction_detail_test_results_instance.to_dict() +# create an instance of WebTransactionDetailTestResults from a dict +web_transaction_detail_test_results_form_dict = web_transaction_detail_test_results.from_dict(web_transaction_detail_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/WebTransactionPageDetailTestResult.md b/test_results_api/docs/WebTransactionPageDetailTestResult.md new file mode 100644 index 00000000..8f75b505 --- /dev/null +++ b/test_results_api/docs/WebTransactionPageDetailTestResult.md @@ -0,0 +1,38 @@ +# WebTransactionPageDetailTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**agent** | [**Agent**](Agent.md) | | [optional] +**component_errors** | **int** | Number of components which did not successfully load | [optional] [readonly] +**transaction_time** | **int** | Elapsed execution time of the web transaction script in milliseconds | [optional] [readonly] +**error_type** | **str** | Type of error encountered; corresponds to phase of connection | [optional] [readonly] +**error_details** | **str** | Error details, if an error were encountered | [optional] [readonly] +**markers** | [**List[Marker]**](Marker.md) | | [optional] +**pages** | [**List[Page]**](Page.md) | | [optional] +**har** | **object** | See [HAR specification](http://www.softwareishard.com/blog/har-12-spec/) for details | [optional] [readonly] + +## Example + +```python +from test_results_api.models.web_transaction_page_detail_test_result import WebTransactionPageDetailTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionPageDetailTestResult from a JSON string +web_transaction_page_detail_test_result_instance = WebTransactionPageDetailTestResult.from_json(json) +# print the JSON string representation of the object +print WebTransactionPageDetailTestResult.to_json() + +# convert the object into a dict +web_transaction_page_detail_test_result_dict = web_transaction_page_detail_test_result_instance.to_dict() +# create an instance of WebTransactionPageDetailTestResult from a dict +web_transaction_page_detail_test_result_form_dict = web_transaction_page_detail_test_result.from_dict(web_transaction_page_detail_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/WebTransactionPageDetailTestResults.md b/test_results_api/docs/WebTransactionPageDetailTestResults.md new file mode 100644 index 00000000..43c212e7 --- /dev/null +++ b/test_results_api/docs/WebTransactionPageDetailTestResults.md @@ -0,0 +1,29 @@ +# WebTransactionPageDetailTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[WebTransactionPageDetailTestResult]**](WebTransactionPageDetailTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.web_transaction_page_detail_test_results import WebTransactionPageDetailTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionPageDetailTestResults from a JSON string +web_transaction_page_detail_test_results_instance = WebTransactionPageDetailTestResults.from_json(json) +# print the JSON string representation of the object +print WebTransactionPageDetailTestResults.to_json() + +# convert the object into a dict +web_transaction_page_detail_test_results_dict = web_transaction_page_detail_test_results_instance.to_dict() +# create an instance of WebTransactionPageDetailTestResults from a dict +web_transaction_page_detail_test_results_form_dict = web_transaction_page_detail_test_results.from_dict(web_transaction_page_detail_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/WebTransactionTestResult.md b/test_results_api/docs/WebTransactionTestResult.md new file mode 100644 index 00000000..f03f08a2 --- /dev/null +++ b/test_results_api/docs/WebTransactionTestResult.md @@ -0,0 +1,35 @@ +# WebTransactionTestResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] +**links** | **object** | | [optional] +**agent** | [**Agent**](Agent.md) | | [optional] +**component_errors** | **int** | Number of components which did not successfully load | [optional] [readonly] +**transaction_time** | **int** | Elapsed execution time of the web transaction script in milliseconds | [optional] [readonly] +**error_type** | **str** | Type of error encountered; corresponds to phase of connection | [optional] [readonly] +**error_details** | **str** | Error details, if an error were encountered | [optional] [readonly] + +## Example + +```python +from test_results_api.models.web_transaction_test_result import WebTransactionTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionTestResult from a JSON string +web_transaction_test_result_instance = WebTransactionTestResult.from_json(json) +# print the JSON string representation of the object +print WebTransactionTestResult.to_json() + +# convert the object into a dict +web_transaction_test_result_dict = web_transaction_test_result_instance.to_dict() +# create an instance of WebTransactionTestResult from a dict +web_transaction_test_result_form_dict = web_transaction_test_result.from_dict(web_transaction_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/WebTransactionTestResults.md b/test_results_api/docs/WebTransactionTestResults.md new file mode 100644 index 00000000..fcca3591 --- /dev/null +++ b/test_results_api/docs/WebTransactionTestResults.md @@ -0,0 +1,29 @@ +# WebTransactionTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[WebTransactionTestResult]**](WebTransactionTestResult.md) | | [optional] +**test** | [**SimpleTest**](SimpleTest.md) | | [optional] + +## Example + +```python +from test_results_api.models.web_transaction_test_results import WebTransactionTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionTestResults from a JSON string +web_transaction_test_results_instance = WebTransactionTestResults.from_json(json) +# print the JSON string representation of the object +print WebTransactionTestResults.to_json() + +# convert the object into a dict +web_transaction_test_results_dict = web_transaction_test_results_instance.to_dict() +# create an instance of WebTransactionTestResults from a dict +web_transaction_test_results_form_dict = web_transaction_test_results.from_dict(web_transaction_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_results_api/docs/WebTransactionsTestMetricsApi.md b/test_results_api/docs/WebTransactionsTestMetricsApi.md new file mode 100644 index 00000000..a736bf68 --- /dev/null +++ b/test_results_api/docs/WebTransactionsTestMetricsApi.md @@ -0,0 +1,290 @@ +# test_results_api.WebTransactionsTestMetricsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_result_web_transactions**](WebTransactionsTestMetricsApi.md#get_test_result_web_transactions) | **GET** /v7/test-results/{testId}/web-transactions | Get web transactions test results +[**get_test_result_web_transactions_component_detail**](WebTransactionsTestMetricsApi.md#get_test_result_web_transactions_component_detail) | **GET** /v7/test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId} | Get web transactions test results by agent and round +[**get_test_result_web_transactions_component_page_detail**](WebTransactionsTestMetricsApi.md#get_test_result_web_transactions_component_page_detail) | **GET** /v7/test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId}/page/{pageId} | Get detailed web transactions test result by agent, round, and page + + +# **get_test_result_web_transactions** +> GetTestResultWebTransactions200Response get_test_result_web_transactions(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get web transactions test results + +Returns test results for web transactions. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_web_transactions200_response import GetTestResultWebTransactions200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.WebTransactionsTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # Get web transactions test results + api_response = api_instance.get_test_result_web_transactions(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of WebTransactionsTestMetricsApi->get_test_result_web_transactions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionsTestMetricsApi->get_test_result_web_transactions: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**GetTestResultWebTransactions200Response**](GetTestResultWebTransactions200Response.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 | - | +**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) + +# **get_test_result_web_transactions_component_detail** +> GetTestResultWebTransactionsComponentDetail200Response get_test_result_web_transactions_component_detail(test_id, agent_id, round_id, aid=aid) + +Get web transactions test results by agent and round + +Returns test results for web transactions for a given agent and round. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_web_transactions_component_detail200_response import GetTestResultWebTransactionsComponentDetail200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.WebTransactionsTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + agent_id = '11' # str | Agent ID + round_id = '1384309800' # str | Round ID + 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: + # Get web transactions test results by agent and round + api_response = api_instance.get_test_result_web_transactions_component_detail(test_id, agent_id, round_id, aid=aid) + print("The response of WebTransactionsTestMetricsApi->get_test_result_web_transactions_component_detail:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionsTestMetricsApi->get_test_result_web_transactions_component_detail: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_id** | **str**| Agent ID | + **round_id** | **str**| Round ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetTestResultWebTransactionsComponentDetail200Response**](GetTestResultWebTransactionsComponentDetail200Response.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 | - | +**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) + +# **get_test_result_web_transactions_component_page_detail** +> GetTestResultWebTransactionsComponentPageDetail200Response get_test_result_web_transactions_component_page_detail(test_id, agent_id, round_id, page_id, aid=aid) + +Get detailed web transactions test result by agent, round, and page + +Returns a page of web transaction test results for an agent and round. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_results_api +from test_results_api.models.get_test_result_web_transactions_component_page_detail200_response import GetTestResultWebTransactionsComponentPageDetail200Response +from test_results_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 = test_results_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 = test_results_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_results_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_results_api.WebTransactionsTestMetricsApi(api_client) + test_id = '202701' # str | Test ID + agent_id = '11' # str | Agent ID + round_id = '1384309800' # str | Round ID + page_id = '281474976710706' # str | Web page ID + 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: + # Get detailed web transactions test result by agent, round, and page + api_response = api_instance.get_test_result_web_transactions_component_page_detail(test_id, agent_id, round_id, page_id, aid=aid) + print("The response of WebTransactionsTestMetricsApi->get_test_result_web_transactions_component_page_detail:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionsTestMetricsApi->get_test_result_web_transactions_component_page_detail: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_id** | **str**| Agent ID | + **round_id** | **str**| Round ID | + **page_id** | **str**| Web page ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetTestResultWebTransactionsComponentPageDetail200Response**](GetTestResultWebTransactionsComponentPageDetail200Response.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/test_results_api/git_push.sh b/test_results_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/test_results_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/test_results_api/pyproject.toml b/test_results_api/pyproject.toml new file mode 100644 index 00000000..dac929c2 --- /dev/null +++ b/test_results_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "test_results_api" +version = "1.0.0" +description = "Test Results API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Test Results API"] +include = ["test_results_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/test_results_api/requirements.txt b/test_results_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/test_results_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/test_results_api/setup.cfg b/test_results_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/test_results_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/test_results_api/setup.py b/test_results_api/setup.py new file mode 100644 index 00000000..a06dae85 --- /dev/null +++ b/test_results_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "test-results-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Test Results API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Test Results API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + Get test result metrics for Cloud and Enterprise Agent tests. + """, # noqa: E501 + package_data={"test_results_api": ["py.typed"]}, +) diff --git a/test_results_api/test-requirements.txt b/test_results_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/test_results_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/test_results_api/test/__init__.py b/test_results_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test_results_api/test/test_agent.py b/test_results_api/test/test_agent.py new file mode 100644 index 00000000..57e6bb76 --- /dev/null +++ b/test_results_api/test/test_agent.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.agent import Agent + +class TestAgent(unittest.TestCase): + """Agent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Agent: + """Test Agent + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Agent` + """ + model = Agent() + if include_optional: + return Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US' + ) + else: + return Agent( + ) + """ + + def testAgent(self): + """Test Agent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_app_links.py b/test_results_api/test/test_app_links.py new file mode 100644 index 00000000..093b28b8 --- /dev/null +++ b/test_results_api/test/test_app_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.app_links import AppLinks + +class TestAppLinks(unittest.TestCase): + """AppLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AppLinks: + """Test AppLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AppLinks` + """ + model = AppLinks() + if include_optional: + return AppLinks( + links = test_results_api.models.app_links__links.AppLinks__links( + app_link = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return AppLinks( + ) + """ + + def testAppLinks(self): + """Test AppLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_app_links_links.py b/test_results_api/test/test_app_links_links.py new file mode 100644 index 00000000..26c22071 --- /dev/null +++ b/test_results_api/test/test_app_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.app_links_links import AppLinksLinks + +class TestAppLinksLinks(unittest.TestCase): + """AppLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AppLinksLinks: + """Test AppLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AppLinksLinks` + """ + model = AppLinksLinks() + if include_optional: + return AppLinksLinks( + app_link = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return AppLinksLinks( + ) + """ + + def testAppLinksLinks(self): + """Test AppLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_bgp_basic_test_result.py b/test_results_api/test/test_bgp_basic_test_result.py new file mode 100644 index 00000000..199aac33 --- /dev/null +++ b/test_results_api/test/test_bgp_basic_test_result.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.bgp_basic_test_result import BgpBasicTestResult + +class TestBgpBasicTestResult(unittest.TestCase): + """BgpBasicTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpBasicTestResult: + """Test BgpBasicTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BgpBasicTestResult` + """ + model = BgpBasicTestResult() + if include_optional: + return BgpBasicTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + monitor = test_results_api.models.monitor.Monitor( + monitor_id = '281474976710706', + monitor_name = 'Vancouver, Canada - Bell Canada (AS 6539)', + country_id = 'US', ), + prefix_id = '215', + prefix = '99.128.0.0/11' + ) + else: + return BgpBasicTestResult( + ) + """ + + def testBgpBasicTestResult(self): + """Test BgpBasicTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_bgp_hop.py b/test_results_api/test/test_bgp_hop.py new file mode 100644 index 00000000..03dc5060 --- /dev/null +++ b/test_results_api/test/test_bgp_hop.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.bgp_hop import BgpHop + +class TestBgpHop(unittest.TestCase): + """BgpHop unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpHop: + """Test BgpHop + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BgpHop` + """ + model = BgpHop() + if include_optional: + return BgpHop( + asn = 852, + as_name = 'Telus Advanced Communications' + ) + else: + return BgpHop( + ) + """ + + def testBgpHop(self): + """Test BgpHop""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_bgp_test_result.py b/test_results_api/test/test_bgp_test_result.py new file mode 100644 index 00000000..62c2c474 --- /dev/null +++ b/test_results_api/test/test_bgp_test_result.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.bgp_test_result import BgpTestResult + +class TestBgpTestResult(unittest.TestCase): + """BgpTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpTestResult: + """Test BgpTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BgpTestResult` + """ + model = BgpTestResult() + if include_optional: + return BgpTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + monitor = test_results_api.models.monitor.Monitor( + monitor_id = '281474976710706', + monitor_name = 'Vancouver, Canada - Bell Canada (AS 6539)', + country_id = 'US', ), + prefix_id = '215', + prefix = '99.128.0.0/11', + updates = 0.0, + path_changes = 0.0, + reachability = 0.0 + ) + else: + return BgpTestResult( + ) + """ + + def testBgpTestResult(self): + """Test BgpTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_bgp_test_results.py b/test_results_api/test/test_bgp_test_results.py new file mode 100644 index 00000000..73be8b30 --- /dev/null +++ b/test_results_api/test/test_bgp_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.bgp_test_results import BgpTestResults + +class TestBgpTestResults(unittest.TestCase): + """BgpTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpTestResults: + """Test BgpTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BgpTestResults` + """ + model = BgpTestResults() + if include_optional: + return BgpTestResults( + results = [ + null + ], + test = None + ) + else: + return BgpTestResults( + ) + """ + + def testBgpTestResults(self): + """Test BgpTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_bgp_test_route_information_result.py b/test_results_api/test/test_bgp_test_route_information_result.py new file mode 100644 index 00000000..5bdac4aa --- /dev/null +++ b/test_results_api/test/test_bgp_test_route_information_result.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.bgp_test_route_information_result import BgpTestRouteInformationResult + +class TestBgpTestRouteInformationResult(unittest.TestCase): + """BgpTestRouteInformationResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpTestRouteInformationResult: + """Test BgpTestRouteInformationResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BgpTestRouteInformationResult` + """ + model = BgpTestRouteInformationResult() + if include_optional: + return BgpTestRouteInformationResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + monitor = test_results_api.models.monitor.Monitor( + monitor_id = '281474976710706', + monitor_name = 'Vancouver, Canada - Bell Canada (AS 6539)', + country_id = 'US', ), + prefix_id = '215', + prefix = '99.128.0.0/11', + is_active = True, + hops = [ + test_results_api.models.bgp_hop.BgpHop( + asn = 852, + as_name = 'Telus Advanced Communications', ) + ] + ) + else: + return BgpTestRouteInformationResult( + ) + """ + + def testBgpTestRouteInformationResult(self): + """Test BgpTestRouteInformationResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_bgp_test_route_information_results.py b/test_results_api/test/test_bgp_test_route_information_results.py new file mode 100644 index 00000000..5ed1421e --- /dev/null +++ b/test_results_api/test/test_bgp_test_route_information_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.bgp_test_route_information_results import BgpTestRouteInformationResults + +class TestBgpTestRouteInformationResults(unittest.TestCase): + """BgpTestRouteInformationResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpTestRouteInformationResults: + """Test BgpTestRouteInformationResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BgpTestRouteInformationResults` + """ + model = BgpTestRouteInformationResults() + if include_optional: + return BgpTestRouteInformationResults( + results = [ + null + ], + test = None + ) + else: + return BgpTestRouteInformationResults( + ) + """ + + def testBgpTestRouteInformationResults(self): + """Test BgpTestRouteInformationResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_dns_server_test_metrics_api.py b/test_results_api/test/test_dns_server_test_metrics_api.py new file mode 100644 index 00000000..e7a999d0 --- /dev/null +++ b/test_results_api/test/test_dns_server_test_metrics_api.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest + +from test_results_api.api.dns_server_test_metrics_api import DNSServerTestMetricsApi + + +class TestDNSServerTestMetricsApi(unittest.TestCase): + """DNSServerTestMetricsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSServerTestMetricsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_result_dns_server(self) -> None: + """Test case for get_test_result_dns_server + + Get DNS server test results by server + """ + pass + + def test_get_test_result_dns_servers(self) -> None: + """Test case for get_test_result_dns_servers + + Get DNS server test results + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_dns_server_test_result.py b/test_results_api/test/test_dns_server_test_result.py new file mode 100644 index 00000000..40a14980 --- /dev/null +++ b/test_results_api/test/test_dns_server_test_result.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.dns_server_test_result import DnsServerTestResult + +class TestDnsServerTestResult(unittest.TestCase): + """DnsServerTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsServerTestResult: + """Test DnsServerTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsServerTestResult` + """ + model = DnsServerTestResult() + if include_optional: + return DnsServerTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + start_time = 1384309800, + end_time = 1384309800, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + server_id = '456', + server = 'a1.verisigndns.com.', + resolution_time = 3, + error_details = 'Connection error', + mappings = '208.185.7.120' + ) + else: + return DnsServerTestResult( + ) + """ + + def testDnsServerTestResult(self): + """Test DnsServerTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_dns_server_test_results.py b/test_results_api/test/test_dns_server_test_results.py new file mode 100644 index 00000000..3c4a251f --- /dev/null +++ b/test_results_api/test/test_dns_server_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.dns_server_test_results import DnsServerTestResults + +class TestDnsServerTestResults(unittest.TestCase): + """DnsServerTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsServerTestResults: + """Test DnsServerTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsServerTestResults` + """ + model = DnsServerTestResults() + if include_optional: + return DnsServerTestResults( + results = [ + null + ], + test = None + ) + else: + return DnsServerTestResults( + ) + """ + + def testDnsServerTestResults(self): + """Test DnsServerTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_dns_trace_test_metrics_api.py b/test_results_api/test/test_dns_trace_test_metrics_api.py new file mode 100644 index 00000000..0dfabcaf --- /dev/null +++ b/test_results_api/test/test_dns_trace_test_metrics_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest + +from test_results_api.api.dns_trace_test_metrics_api import DNSTraceTestMetricsApi + + +class TestDNSTraceTestMetricsApi(unittest.TestCase): + """DNSTraceTestMetricsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSTraceTestMetricsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_result_dns_trace(self) -> None: + """Test case for get_test_result_dns_trace + + Get DNS trace test results + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_dns_trace_test_result.py b/test_results_api/test/test_dns_trace_test_result.py new file mode 100644 index 00000000..46d90923 --- /dev/null +++ b/test_results_api/test/test_dns_trace_test_result.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.dns_trace_test_result import DnsTraceTestResult + +class TestDnsTraceTestResult(unittest.TestCase): + """DnsTraceTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsTraceTestResult: + """Test DnsTraceTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsTraceTestResult` + """ + model = DnsTraceTestResult() + if include_optional: + return DnsTraceTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + start_time = 1384309800, + end_time = 1384309800, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + output = 'com. 172800 IN NS a.gtld-servers.net. +com. 172800 IN NS f.gtld-servers.net. +com. 172800 IN NS c.gtld-servers.net. +com. 172800 IN NS b.gtld-servers.net. +com. 172800 IN NS d.gtld-servers.net. +com. 172800 IN NS e.gtld-servers.net. +com. 172800 IN NS g.gtld-servers.net. +com. 172800 IN NS m.gtld-servers.net. +com. 172800 IN NS h.gtld-servers.net. +com. 172800 IN NS j.gtld-servers.net. +com. 172800 IN NS i.gtld-servers.net. +com. 172800 IN NS l.gtld-servers.net. +com. 172800 IN NS k.gtld-servers.net. +;; Received 498 bytes from 199.7.91.13(d.root-servers.net.) in 119 ms + +thousandeyes.com. 172800 IN NS a1.verisigndns.com. +thousandeyes.com. 172800 IN NS a2.verisigndns.com. +thousandeyes.com. 172800 IN NS a3.verisigndns.com. +thousandeyes.com. 172800 IN NS u1.verisigndns.com. +;; Received 266 bytes from 192.5.6.30(a.gtld-servers.net.) in 178 ms + +app.thousandeyes.com. 300 IN CNAME web.thousandeyes.com. +web.thousandeyes.com. 300 IN CNAME lb-app.thousandeyes.com. +lb-app.thousandeyes.com. 3600 IN A 208.185.7.120 +;; Received 173 bytes from 209.112.113.33(a1.verisigndns.com.) in 178 ms + +', + error_details = 'Connection error', + queries = 3, + failed_queries = 0, + final_server_queried = 'a1.verisigndns.com.', + final_query_time = 178, + mappings = '208.185.7.120' + ) + else: + return DnsTraceTestResult( + ) + """ + + def testDnsTraceTestResult(self): + """Test DnsTraceTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_dns_trace_test_results.py b/test_results_api/test/test_dns_trace_test_results.py new file mode 100644 index 00000000..7b83dbaf --- /dev/null +++ b/test_results_api/test/test_dns_trace_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.dns_trace_test_results import DnsTraceTestResults + +class TestDnsTraceTestResults(unittest.TestCase): + """DnsTraceTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsTraceTestResults: + """Test DnsTraceTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsTraceTestResults` + """ + model = DnsTraceTestResults() + if include_optional: + return DnsTraceTestResults( + results = [ + null + ], + test = None + ) + else: + return DnsTraceTestResults( + ) + """ + + def testDnsTraceTestResults(self): + """Test DnsTraceTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_dnssec_test_metrics_api.py b/test_results_api/test/test_dnssec_test_metrics_api.py new file mode 100644 index 00000000..172930bd --- /dev/null +++ b/test_results_api/test/test_dnssec_test_metrics_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest + +from test_results_api.api.dnssec_test_metrics_api import DNSSECTestMetricsApi + + +class TestDNSSECTestMetricsApi(unittest.TestCase): + """DNSSECTestMetricsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSSECTestMetricsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_result_dnssec(self) -> None: + """Test case for get_test_result_dnssec + + Get DNSSEC test results + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_dnssec_test_result.py b/test_results_api/test/test_dnssec_test_result.py new file mode 100644 index 00000000..f86c2995 --- /dev/null +++ b/test_results_api/test/test_dnssec_test_result.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.dnssec_test_result import DnssecTestResult + +class TestDnssecTestResult(unittest.TestCase): + """DnssecTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnssecTestResult: + """Test DnssecTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnssecTestResult` + """ + model = DnssecTestResult() + if include_optional: + return DnssecTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + start_time = 1384309800, + end_time = 1384309800, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + is_valid = True, + error_details = 'Connection error' + ) + else: + return DnssecTestResult( + ) + """ + + def testDnssecTestResult(self): + """Test DnssecTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_dnssec_test_results.py b/test_results_api/test/test_dnssec_test_results.py new file mode 100644 index 00000000..eb0bb6a2 --- /dev/null +++ b/test_results_api/test/test_dnssec_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.dnssec_test_results import DnssecTestResults + +class TestDnssecTestResults(unittest.TestCase): + """DnssecTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnssecTestResults: + """Test DnssecTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnssecTestResults` + """ + model = DnssecTestResults() + if include_optional: + return DnssecTestResults( + results = [ + null + ], + test = None + ) + else: + return DnssecTestResults( + ) + """ + + def testDnssecTestResults(self): + """Test DnssecTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_epoch_time_window.py b/test_results_api/test/test_epoch_time_window.py new file mode 100644 index 00000000..7cb811f0 --- /dev/null +++ b/test_results_api/test/test_epoch_time_window.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.epoch_time_window import EpochTimeWindow + +class TestEpochTimeWindow(unittest.TestCase): + """EpochTimeWindow unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EpochTimeWindow: + """Test EpochTimeWindow + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EpochTimeWindow` + """ + model = EpochTimeWindow() + if include_optional: + return EpochTimeWindow( + start_time = 1384309800, + end_time = 1384309800 + ) + else: + return EpochTimeWindow( + ) + """ + + def testEpochTimeWindow(self): + """Test EpochTimeWindow""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_error.py b/test_results_api/test/test_error.py new file mode 100644 index 00000000..72b5a4d1 --- /dev/null +++ b/test_results_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_expand.py b/test_results_api/test/test_expand.py new file mode 100644 index 00000000..cb82fbaf --- /dev/null +++ b/test_results_api/test/test_expand.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.expand import Expand + +class TestExpand(unittest.TestCase): + """Expand unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testExpand(self): + """Test Expand""" + # inst = Expand() + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_ftp_server_test_result.py b/test_results_api/test/test_ftp_server_test_result.py new file mode 100644 index 00000000..3c6a9d41 --- /dev/null +++ b/test_results_api/test/test_ftp_server_test_result.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.ftp_server_test_result import FtpServerTestResult + +class TestFtpServerTestResult(unittest.TestCase): + """FtpServerTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FtpServerTestResult: + """Test FtpServerTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FtpServerTestResult` + """ + model = FtpServerTestResult() + if include_optional: + return FtpServerTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + server_ip = '193.2.1.88', + response_code = 226, + dns_time = 0.589, + connect_time = 50.153, + negotiation_time = 503.413, + wait_time = 52.1, + response_time = 0.589, + transfer_time = 99.865, + wire_size = 22172, + total_time = 705.554, + error_type = 'None', + error_details = 'Connection error', + throughput = 123 + ) + else: + return FtpServerTestResult( + ) + """ + + def testFtpServerTestResult(self): + """Test FtpServerTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_ftp_server_test_results.py b/test_results_api/test/test_ftp_server_test_results.py new file mode 100644 index 00000000..3b1d48e8 --- /dev/null +++ b/test_results_api/test/test_ftp_server_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.ftp_server_test_results import FtpServerTestResults + +class TestFtpServerTestResults(unittest.TestCase): + """FtpServerTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FtpServerTestResults: + """Test FtpServerTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FtpServerTestResults` + """ + model = FtpServerTestResults() + if include_optional: + return FtpServerTestResults( + results = [ + null + ], + test = None + ) + else: + return FtpServerTestResults( + ) + """ + + def testFtpServerTestResults(self): + """Test FtpServerTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_pathvis_agent_round200_response.py b/test_results_api/test/test_get_test_pathvis_agent_round200_response.py new file mode 100644 index 00000000..bba87677 --- /dev/null +++ b/test_results_api/test/test_get_test_pathvis_agent_round200_response.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_pathvis_agent_round200_response import GetTestPathvisAgentRound200Response + +class TestGetTestPathvisAgentRound200Response(unittest.TestCase): + """GetTestPathvisAgentRound200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestPathvisAgentRound200Response: + """Test GetTestPathvisAgentRound200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestPathvisAgentRound200Response` + """ + model = GetTestPathvisAgentRound200Response() + if include_optional: + return GetTestPathvisAgentRound200Response( + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestPathvisAgentRound200Response( + ) + """ + + def testGetTestPathvisAgentRound200Response(self): + """Test GetTestPathvisAgentRound200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_dns_server200_response.py b/test_results_api/test/test_get_test_result_dns_server200_response.py new file mode 100644 index 00000000..8f47b8c4 --- /dev/null +++ b/test_results_api/test/test_get_test_result_dns_server200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_dns_server200_response import GetTestResultDnsServer200Response + +class TestGetTestResultDnsServer200Response(unittest.TestCase): + """GetTestResultDnsServer200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultDnsServer200Response: + """Test GetTestResultDnsServer200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultDnsServer200Response` + """ + model = GetTestResultDnsServer200Response() + if include_optional: + return GetTestResultDnsServer200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultDnsServer200Response( + ) + """ + + def testGetTestResultDnsServer200Response(self): + """Test GetTestResultDnsServer200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_dns_trace200_response.py b/test_results_api/test/test_get_test_result_dns_trace200_response.py new file mode 100644 index 00000000..f8375f64 --- /dev/null +++ b/test_results_api/test/test_get_test_result_dns_trace200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_dns_trace200_response import GetTestResultDnsTrace200Response + +class TestGetTestResultDnsTrace200Response(unittest.TestCase): + """GetTestResultDnsTrace200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultDnsTrace200Response: + """Test GetTestResultDnsTrace200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultDnsTrace200Response` + """ + model = GetTestResultDnsTrace200Response() + if include_optional: + return GetTestResultDnsTrace200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultDnsTrace200Response( + ) + """ + + def testGetTestResultDnsTrace200Response(self): + """Test GetTestResultDnsTrace200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_dnssec200_response.py b/test_results_api/test/test_get_test_result_dnssec200_response.py new file mode 100644 index 00000000..7619378a --- /dev/null +++ b/test_results_api/test/test_get_test_result_dnssec200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_dnssec200_response import GetTestResultDnssec200Response + +class TestGetTestResultDnssec200Response(unittest.TestCase): + """GetTestResultDnssec200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultDnssec200Response: + """Test GetTestResultDnssec200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultDnssec200Response` + """ + model = GetTestResultDnssec200Response() + if include_optional: + return GetTestResultDnssec200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultDnssec200Response( + ) + """ + + def testGetTestResultDnssec200Response(self): + """Test GetTestResultDnssec200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_ftp_server200_response.py b/test_results_api/test/test_get_test_result_ftp_server200_response.py new file mode 100644 index 00000000..1f3c9a26 --- /dev/null +++ b/test_results_api/test/test_get_test_result_ftp_server200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_ftp_server200_response import GetTestResultFtpServer200Response + +class TestGetTestResultFtpServer200Response(unittest.TestCase): + """GetTestResultFtpServer200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultFtpServer200Response: + """Test GetTestResultFtpServer200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultFtpServer200Response` + """ + model = GetTestResultFtpServer200Response() + if include_optional: + return GetTestResultFtpServer200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultFtpServer200Response( + ) + """ + + def testGetTestResultFtpServer200Response(self): + """Test GetTestResultFtpServer200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_http_server200_response.py b/test_results_api/test/test_get_test_result_http_server200_response.py new file mode 100644 index 00000000..53549a67 --- /dev/null +++ b/test_results_api/test/test_get_test_result_http_server200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_http_server200_response import GetTestResultHttpServer200Response + +class TestGetTestResultHttpServer200Response(unittest.TestCase): + """GetTestResultHttpServer200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultHttpServer200Response: + """Test GetTestResultHttpServer200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultHttpServer200Response` + """ + model = GetTestResultHttpServer200Response() + if include_optional: + return GetTestResultHttpServer200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultHttpServer200Response( + ) + """ + + def testGetTestResultHttpServer200Response(self): + """Test GetTestResultHttpServer200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_metrics200_response.py b/test_results_api/test/test_get_test_result_metrics200_response.py new file mode 100644 index 00000000..25e2c514 --- /dev/null +++ b/test_results_api/test/test_get_test_result_metrics200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_metrics200_response import GetTestResultMetrics200Response + +class TestGetTestResultMetrics200Response(unittest.TestCase): + """GetTestResultMetrics200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultMetrics200Response: + """Test GetTestResultMetrics200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultMetrics200Response` + """ + model = GetTestResultMetrics200Response() + if include_optional: + return GetTestResultMetrics200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultMetrics200Response( + ) + """ + + def testGetTestResultMetrics200Response(self): + """Test GetTestResultMetrics200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_network_pathvis200_response.py b/test_results_api/test/test_get_test_result_network_pathvis200_response.py new file mode 100644 index 00000000..c64628f9 --- /dev/null +++ b/test_results_api/test/test_get_test_result_network_pathvis200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_network_pathvis200_response import GetTestResultNetworkPathvis200Response + +class TestGetTestResultNetworkPathvis200Response(unittest.TestCase): + """GetTestResultNetworkPathvis200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultNetworkPathvis200Response: + """Test GetTestResultNetworkPathvis200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultNetworkPathvis200Response` + """ + model = GetTestResultNetworkPathvis200Response() + if include_optional: + return GetTestResultNetworkPathvis200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultNetworkPathvis200Response( + ) + """ + + def testGetTestResultNetworkPathvis200Response(self): + """Test GetTestResultNetworkPathvis200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_page_load200_response.py b/test_results_api/test/test_get_test_result_page_load200_response.py new file mode 100644 index 00000000..3437c588 --- /dev/null +++ b/test_results_api/test/test_get_test_result_page_load200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_page_load200_response import GetTestResultPageLoad200Response + +class TestGetTestResultPageLoad200Response(unittest.TestCase): + """GetTestResultPageLoad200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultPageLoad200Response: + """Test GetTestResultPageLoad200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultPageLoad200Response` + """ + model = GetTestResultPageLoad200Response() + if include_optional: + return GetTestResultPageLoad200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultPageLoad200Response( + ) + """ + + def testGetTestResultPageLoad200Response(self): + """Test GetTestResultPageLoad200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_page_load_component_detail200_response.py b/test_results_api/test/test_get_test_result_page_load_component_detail200_response.py new file mode 100644 index 00000000..5e75edd5 --- /dev/null +++ b/test_results_api/test/test_get_test_result_page_load_component_detail200_response.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_page_load_component_detail200_response import GetTestResultPageLoadComponentDetail200Response + +class TestGetTestResultPageLoadComponentDetail200Response(unittest.TestCase): + """GetTestResultPageLoadComponentDetail200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultPageLoadComponentDetail200Response: + """Test GetTestResultPageLoadComponentDetail200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultPageLoadComponentDetail200Response` + """ + model = GetTestResultPageLoadComponentDetail200Response() + if include_optional: + return GetTestResultPageLoadComponentDetail200Response( + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultPageLoadComponentDetail200Response( + ) + """ + + def testGetTestResultPageLoadComponentDetail200Response(self): + """Test GetTestResultPageLoadComponentDetail200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_rtp_stream200_response.py b/test_results_api/test/test_get_test_result_rtp_stream200_response.py new file mode 100644 index 00000000..42fd1915 --- /dev/null +++ b/test_results_api/test/test_get_test_result_rtp_stream200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_rtp_stream200_response import GetTestResultRtpStream200Response + +class TestGetTestResultRtpStream200Response(unittest.TestCase): + """GetTestResultRtpStream200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultRtpStream200Response: + """Test GetTestResultRtpStream200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultRtpStream200Response` + """ + model = GetTestResultRtpStream200Response() + if include_optional: + return GetTestResultRtpStream200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultRtpStream200Response( + ) + """ + + def testGetTestResultRtpStream200Response(self): + """Test GetTestResultRtpStream200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_sip_server200_response.py b/test_results_api/test/test_get_test_result_sip_server200_response.py new file mode 100644 index 00000000..41540d29 --- /dev/null +++ b/test_results_api/test/test_get_test_result_sip_server200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_sip_server200_response import GetTestResultSipServer200Response + +class TestGetTestResultSipServer200Response(unittest.TestCase): + """GetTestResultSipServer200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultSipServer200Response: + """Test GetTestResultSipServer200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultSipServer200Response` + """ + model = GetTestResultSipServer200Response() + if include_optional: + return GetTestResultSipServer200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultSipServer200Response( + ) + """ + + def testGetTestResultSipServer200Response(self): + """Test GetTestResultSipServer200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_web_transactions200_response.py b/test_results_api/test/test_get_test_result_web_transactions200_response.py new file mode 100644 index 00000000..18699757 --- /dev/null +++ b/test_results_api/test/test_get_test_result_web_transactions200_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_web_transactions200_response import GetTestResultWebTransactions200Response + +class TestGetTestResultWebTransactions200Response(unittest.TestCase): + """GetTestResultWebTransactions200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultWebTransactions200Response: + """Test GetTestResultWebTransactions200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultWebTransactions200Response` + """ + model = GetTestResultWebTransactions200Response() + if include_optional: + return GetTestResultWebTransactions200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultWebTransactions200Response( + ) + """ + + def testGetTestResultWebTransactions200Response(self): + """Test GetTestResultWebTransactions200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_web_transactions_component_detail200_response.py b/test_results_api/test/test_get_test_result_web_transactions_component_detail200_response.py new file mode 100644 index 00000000..9349cec6 --- /dev/null +++ b/test_results_api/test/test_get_test_result_web_transactions_component_detail200_response.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_web_transactions_component_detail200_response import GetTestResultWebTransactionsComponentDetail200Response + +class TestGetTestResultWebTransactionsComponentDetail200Response(unittest.TestCase): + """GetTestResultWebTransactionsComponentDetail200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultWebTransactionsComponentDetail200Response: + """Test GetTestResultWebTransactionsComponentDetail200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultWebTransactionsComponentDetail200Response` + """ + model = GetTestResultWebTransactionsComponentDetail200Response() + if include_optional: + return GetTestResultWebTransactionsComponentDetail200Response( + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultWebTransactionsComponentDetail200Response( + ) + """ + + def testGetTestResultWebTransactionsComponentDetail200Response(self): + """Test GetTestResultWebTransactionsComponentDetail200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_result_web_transactions_component_page_detail200_response.py b/test_results_api/test/test_get_test_result_web_transactions_component_page_detail200_response.py new file mode 100644 index 00000000..2cf29d57 --- /dev/null +++ b/test_results_api/test/test_get_test_result_web_transactions_component_page_detail200_response.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_result_web_transactions_component_page_detail200_response import GetTestResultWebTransactionsComponentPageDetail200Response + +class TestGetTestResultWebTransactionsComponentPageDetail200Response(unittest.TestCase): + """GetTestResultWebTransactionsComponentPageDetail200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultWebTransactionsComponentPageDetail200Response: + """Test GetTestResultWebTransactionsComponentPageDetail200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultWebTransactionsComponentPageDetail200Response` + """ + model = GetTestResultWebTransactionsComponentPageDetail200Response() + if include_optional: + return GetTestResultWebTransactionsComponentPageDetail200Response( + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultWebTransactionsComponentPageDetail200Response( + ) + """ + + def testGetTestResultWebTransactionsComponentPageDetail200Response(self): + """Test GetTestResultWebTransactionsComponentPageDetail200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_results_bgp200_response.py b/test_results_api/test/test_get_test_results_bgp200_response.py new file mode 100644 index 00000000..affd1752 --- /dev/null +++ b/test_results_api/test/test_get_test_results_bgp200_response.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_results_bgp200_response import GetTestResultsBgp200Response + +class TestGetTestResultsBgp200Response(unittest.TestCase): + """GetTestResultsBgp200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultsBgp200Response: + """Test GetTestResultsBgp200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultsBgp200Response` + """ + model = GetTestResultsBgp200Response() + if include_optional: + return GetTestResultsBgp200Response( + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultsBgp200Response( + ) + """ + + def testGetTestResultsBgp200Response(self): + """Test GetTestResultsBgp200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_get_test_results_bgp_prefix200_response.py b/test_results_api/test/test_get_test_results_bgp_prefix200_response.py new file mode 100644 index 00000000..60d59fc0 --- /dev/null +++ b/test_results_api/test/test_get_test_results_bgp_prefix200_response.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.get_test_results_bgp_prefix200_response import GetTestResultsBgpPrefix200Response + +class TestGetTestResultsBgpPrefix200Response(unittest.TestCase): + """GetTestResultsBgpPrefix200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTestResultsBgpPrefix200Response: + """Test GetTestResultsBgpPrefix200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTestResultsBgpPrefix200Response` + """ + model = GetTestResultsBgpPrefix200Response() + if include_optional: + return GetTestResultsBgpPrefix200Response( + results = [ + null + ], + test = None, + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTestResultsBgpPrefix200Response( + ) + """ + + def testGetTestResultsBgpPrefix200Response(self): + """Test GetTestResultsBgpPrefix200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_http_test_result.py b/test_results_api/test/test_http_test_result.py new file mode 100644 index 00000000..06eb2a76 --- /dev/null +++ b/test_results_api/test/test_http_test_result.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.http_test_result import HttpTestResult + +class TestHttpTestResult(unittest.TestCase): + """HttpTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HttpTestResult: + """Test HttpTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HttpTestResult` + """ + model = HttpTestResult() + if include_optional: + return HttpTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + server_ip = '193.2.1.88', + response_code = 200, + num_redirects = 0, + redirect_time = 10, + dns_time = 0, + ssl_time = 9, + connect_time = 2, + wait_time = 3, + receive_time = 1, + wire_size = 9993, + response_time = 14, + throughput = 123, + total_time = 15, + headers = test_results_api.models.http_test_result_headers.HttpTestResultHeaders( + request_headers = 'GET / HTTP/1.1 +Host: www.thousandeyes.com +User-Agent: curl/7.58.0-DEV +Accept: */* +Accept-Encoding: deflate, gzip +X-ThousandEyes-Agent: yes +', + response_headers = 'HTTP/1.1 200 OK +Content-Type: text/html;charset=UTF-8 +Content-Length: 9993 +Connection: keep-alive +Date: Mon, 04 May 2020 16:13:00 GMT +Server: Apache +Content-Language: en-US +Content-Encoding: gzip +X-Frame-Options: sameorigin +Cache-Control: max-age=600, must-revalidate +Strict-Transport-Security: max-age=31536000 +X-Content-Type-Options: nosniff +X-XSS-Protection: 1; mode=block +Vary: Accept-Encoding +X-Cache: Hit from cloudfront +Via: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront) +X-Amz-Cf-Pop: SFO5-C3 +X-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA== +Age: 132 +', ), + error_type = 'None', + error_details = 'Connection error', + ssl_cipher = '', + ssl_version = 'TLSv1.3', + ssl_certificates = [ + test_results_api.models.ssl_cert.SslCert( + days_until_expiry = 56, + is_fetch_date_in_valid_cert_date_range = 'true', + has_valid_signing_cert = 'false', + issuer_name = 'DigiCert SHA2 Extended Validation Server CA', + valid_before = '2020-05-12T12:00Z', + valid_after = '2018-03-27T00:00Z', + subject_alternative_names = ["www.thousandeyes.com","thousandeyes.com"], + subject_name = 'www.thousandeyes.com', ) + ] + ) + else: + return HttpTestResult( + ) + """ + + def testHttpTestResult(self): + """Test HttpTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_http_test_result_headers.py b/test_results_api/test/test_http_test_result_headers.py new file mode 100644 index 00000000..4fafe8da --- /dev/null +++ b/test_results_api/test/test_http_test_result_headers.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.http_test_result_headers import HttpTestResultHeaders + +class TestHttpTestResultHeaders(unittest.TestCase): + """HttpTestResultHeaders unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HttpTestResultHeaders: + """Test HttpTestResultHeaders + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HttpTestResultHeaders` + """ + model = HttpTestResultHeaders() + if include_optional: + return HttpTestResultHeaders( + request_headers = 'GET / HTTP/1.1 +Host: www.thousandeyes.com +User-Agent: curl/7.58.0-DEV +Accept: */* +Accept-Encoding: deflate, gzip +X-ThousandEyes-Agent: yes +', + response_headers = 'HTTP/1.1 200 OK +Content-Type: text/html;charset=UTF-8 +Content-Length: 9993 +Connection: keep-alive +Date: Mon, 04 May 2020 16:13:00 GMT +Server: Apache +Content-Language: en-US +Content-Encoding: gzip +X-Frame-Options: sameorigin +Cache-Control: max-age=600, must-revalidate +Strict-Transport-Security: max-age=31536000 +X-Content-Type-Options: nosniff +X-XSS-Protection: 1; mode=block +Vary: Accept-Encoding +X-Cache: Hit from cloudfront +Via: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront) +X-Amz-Cf-Pop: SFO5-C3 +X-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA== +Age: 132 +' + ) + else: + return HttpTestResultHeaders( + ) + """ + + def testHttpTestResultHeaders(self): + """Test HttpTestResultHeaders""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_http_test_results.py b/test_results_api/test/test_http_test_results.py new file mode 100644 index 00000000..d07b6ad5 --- /dev/null +++ b/test_results_api/test/test_http_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.http_test_results import HttpTestResults + +class TestHttpTestResults(unittest.TestCase): + """HttpTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HttpTestResults: + """Test HttpTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HttpTestResults` + """ + model = HttpTestResults() + if include_optional: + return HttpTestResults( + results = [ + null + ], + test = None + ) + else: + return HttpTestResults( + ) + """ + + def testHttpTestResults(self): + """Test HttpTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_link.py b/test_results_api/test/test_link.py new file mode 100644 index 00000000..4e0fb1b9 --- /dev/null +++ b/test_results_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_marker.py b/test_results_api/test/test_marker.py new file mode 100644 index 00000000..16c6da33 --- /dev/null +++ b/test_results_api/test/test_marker.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.marker import Marker + +class TestMarker(unittest.TestCase): + """Marker unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Marker: + """Test Marker + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Marker` + """ + model = Marker() + if include_optional: + return Marker( + name = 'SearchForWebdriver', + duration = 56 + ) + else: + return Marker( + ) + """ + + def testMarker(self): + """Test Marker""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_monitor.py b/test_results_api/test/test_monitor.py new file mode 100644 index 00000000..30fb97db --- /dev/null +++ b/test_results_api/test/test_monitor.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.monitor import Monitor + +class TestMonitor(unittest.TestCase): + """Monitor unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Monitor: + """Test Monitor + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Monitor` + """ + model = Monitor() + if include_optional: + return Monitor( + monitor_id = '281474976710706', + monitor_name = 'Vancouver, Canada - Bell Canada (AS 6539)', + country_id = 'US' + ) + else: + return Monitor( + ) + """ + + def testMonitor(self): + """Test Monitor""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_network_bgp_test_metrics_api.py b/test_results_api/test/test_network_bgp_test_metrics_api.py new file mode 100644 index 00000000..e1279a44 --- /dev/null +++ b/test_results_api/test/test_network_bgp_test_metrics_api.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest + +from test_results_api.api.network_bgp_test_metrics_api import NetworkBGPTestMetricsApi + + +class TestNetworkBGPTestMetricsApi(unittest.TestCase): + """NetworkBGPTestMetricsApi unit test stubs""" + + def setUp(self) -> None: + self.api = NetworkBGPTestMetricsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_results_bgp(self) -> None: + """Test case for get_test_results_bgp + + Get BGP test results + """ + pass + + def test_get_test_results_bgp_prefix(self) -> None: + """Test case for get_test_results_bgp_prefix + + Get BGP route test results by prefix + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_network_test_metrics_api.py b/test_results_api/test/test_network_test_metrics_api.py new file mode 100644 index 00000000..f22f4902 --- /dev/null +++ b/test_results_api/test/test_network_test_metrics_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest + +from test_results_api.api.network_test_metrics_api import NetworkTestMetricsApi + + +class TestNetworkTestMetricsApi(unittest.TestCase): + """NetworkTestMetricsApi unit test stubs""" + + def setUp(self) -> None: + self.api = NetworkTestMetricsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_pathvis_agent_round(self) -> None: + """Test case for get_test_pathvis_agent_round + + Get pathvis test results by agent and round + """ + pass + + def test_get_test_result_metrics(self) -> None: + """Test case for get_test_result_metrics + + Get network test results + """ + pass + + def test_get_test_result_network_pathvis(self) -> None: + """Test case for get_test_result_network_pathvis + + Get pathvis network test results + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_network_test_result.py b/test_results_api/test/test_network_test_result.py new file mode 100644 index 00000000..27589468 --- /dev/null +++ b/test_results_api/test/test_network_test_result.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.network_test_result import NetworkTestResult + +class TestNetworkTestResult(unittest.TestCase): + """NetworkTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkTestResult: + """Test NetworkTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NetworkTestResult` + """ + model = NetworkTestResult() + if include_optional: + return NetworkTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + start_time = 1384309800, + end_time = 1384309800, + available_bandwidth = 9.100464, + avg_latency = 167.04, + bandwidth = 4.3313155, + capacity = 210.10854, + jitter = 0.076808, + loss = 0.0, + max_latency = 168.0, + min_latency = 167.0, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + server_ip = '50.18.127.223', + server = 'www.thousandeyes.com:80', + direction = 'to-target' + ) + else: + return NetworkTestResult( + ) + """ + + def testNetworkTestResult(self): + """Test NetworkTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_network_test_results.py b/test_results_api/test/test_network_test_results.py new file mode 100644 index 00000000..921b9cb3 --- /dev/null +++ b/test_results_api/test/test_network_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.network_test_results import NetworkTestResults + +class TestNetworkTestResults(unittest.TestCase): + """NetworkTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NetworkTestResults: + """Test NetworkTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NetworkTestResults` + """ + model = NetworkTestResults() + if include_optional: + return NetworkTestResults( + results = [ + null + ], + test = None + ) + else: + return NetworkTestResults( + ) + """ + + def testNetworkTestResults(self): + """Test NetworkTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_page.py b/test_results_api/test/test_page.py new file mode 100644 index 00000000..66012e86 --- /dev/null +++ b/test_results_api/test/test_page.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.page import Page + +class TestPage(unittest.TestCase): + """Page unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Page: + """Test Page + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Page` + """ + model = Page() + if include_optional: + return Page( + page_num = 0, + page_name = 'Google', + component_count = 136, + error_count = 0, + duration = 1117.5660001039505 + ) + else: + return Page( + ) + """ + + def testPage(self): + """Test Page""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_page_load_detail_test_result.py b/test_results_api/test/test_page_load_detail_test_result.py new file mode 100644 index 00000000..25824dad --- /dev/null +++ b/test_results_api/test/test_page_load_detail_test_result.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.page_load_detail_test_result import PageLoadDetailTestResult + +class TestPageLoadDetailTestResult(unittest.TestCase): + """PageLoadDetailTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PageLoadDetailTestResult: + """Test PageLoadDetailTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageLoadDetailTestResult` + """ + model = PageLoadDetailTestResult() + if include_optional: + return PageLoadDetailTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + response_time = 34.35, + total_size = 403301, + num_objects = 17, + num_errors = 0, + dom_load_time = 352, + page_load_time = 352, + har = {"log":{"creator":{"name":"ThousandEyes DB Exporter"},"entries":[{"pageref":"page_0","request":{"headers":[{"name":":authority","value":"google.com"},{"name":":method","value":"GET"},{"name":":path","value":"/"},{"name":":scheme","value":"https"},{"name":"accept","value":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"},{"name":"accept-encoding","value":"gzip, deflate, br"},{"name":"accept-language","value":"en-US,en;q=0.9"},{"name":"upgrade-insecure-requests","value":"1"},{"name":"user-agent","value":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36"},{"name":"x-thousandeyes-agent","value":"yes"}],"method":"GET","url":"https://google.com/"},"response":{"bodySize":220,"content":{"mimeType":"text/html","size":220},"headers":[{"name":"alt-svc","value":"quic=\":443\"; ma=2592000; v=\"46,43\",h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000"},{"name":"cache-control","value":"public, max-age=2592000"},{"name":"content-length","value":"220"},{"name":"content-type","value":"text/html; charset=UTF-8"},{"name":"date","value":"Fri, 15 Nov 2019 16:41:54 GMT"},{"name":"expires","value":"Sun, 15 Dec 2019 16:41:54 GMT"},{"name":"location","value":"https://www.google.com/"},{"name":"server","value":"gws"},{"name":"status","value":"301"},{"name":"x-frame-options","value":"SAMEORIGIN"},{"name":"x-xss-protection","value":"0"}],"headersSize":471,"redirectURL":"","status":301,"statusText":"MOVED_PERMANENTLY"},"serverIPAddress":"172.217.6.110","startedDateTime":"2019-11-15T16:41:54.798Z","time":71,"timings":{"blocked":2,"connect":16,"dns":1,"receive":1,"send":0,"ssl":14,"wait":50}},{"pageref":"page_0","request":{"headers":[{"name":":authority","value":"www.google.com"},{"name":":method","value":"GET"},{"name":":path","value":"/"},{"name":":scheme","value":"https"},{"name":"accept","value":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"},{"name":"accept-encoding","value":"gzip, deflate, br"},{"name":"accept-language","value":"en-US,en;q=0.9"},{"name":"upgrade-insecure-requests","value":"1"},{"name":"user-agent","value":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36"},{"name":"x-thousandeyes-agent","value":"yes"}],"method":"GET","url":"https://www.google.com/"},"response":{"bodySize":65214,"content":{"mimeType":"text/html","size":225039},"headers":[{"name":"alt-svc","value":"quic=\":443\"; ma=2592000; v=\"46,43\",h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000"},{"name":"cache-control","value":"private, max-age=0"},{"name":"content-encoding","value":"br"},{"name":"content-length","value":"65214"},{"name":"content-type","value":"text/html; charset=UTF-8"},{"name":"date","value":"Fri, 15 Nov 2019 16:41:54 GMT"},{"name":"expires","value":"-1"},{"name":"p3p","value":"CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\""},{"name":"server","value":"gws"},{"name":"set-cookie","value":"(removed)"},{"name":"status","value":"200"},{"name":"strict-transport-security","value":"max-age=31536000"},{"name":"x-frame-options","value":"SAMEORIGIN"},{"name":"x-xss-protection","value":"0"}],"headersSize":915,"redirectURL":"","status":200,"statusText":"OK"},"serverIPAddress":"172.217.4.196","startedDateTime":"2019-11-15T16:41:54.870Z","time":182,"timings":{"blocked":2,"connect":4,"dns":0,"receive":58,"send":0,"ssl":2,"wait":118}}],"pages":[{"id":"page_0","pageTimings":{"onContentLoad":367,"onLoad":737},"responseCode":0,"startedDateTime":"2019-11-15T16:41:54.796Z","title":"Google"}],"version":"1.2"}} + ) + else: + return PageLoadDetailTestResult( + ) + """ + + def testPageLoadDetailTestResult(self): + """Test PageLoadDetailTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_page_load_detail_test_results.py b/test_results_api/test/test_page_load_detail_test_results.py new file mode 100644 index 00000000..3d0595a1 --- /dev/null +++ b/test_results_api/test/test_page_load_detail_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.page_load_detail_test_results import PageLoadDetailTestResults + +class TestPageLoadDetailTestResults(unittest.TestCase): + """PageLoadDetailTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PageLoadDetailTestResults: + """Test PageLoadDetailTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageLoadDetailTestResults` + """ + model = PageLoadDetailTestResults() + if include_optional: + return PageLoadDetailTestResults( + results = [ + null + ], + test = None + ) + else: + return PageLoadDetailTestResults( + ) + """ + + def testPageLoadDetailTestResults(self): + """Test PageLoadDetailTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_page_load_test_result.py b/test_results_api/test/test_page_load_test_result.py new file mode 100644 index 00000000..530b6579 --- /dev/null +++ b/test_results_api/test/test_page_load_test_result.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.page_load_test_result import PageLoadTestResult + +class TestPageLoadTestResult(unittest.TestCase): + """PageLoadTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PageLoadTestResult: + """Test PageLoadTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageLoadTestResult` + """ + model = PageLoadTestResult() + if include_optional: + return PageLoadTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + response_time = 34.35, + total_size = 403301, + num_objects = 17, + num_errors = 0, + dom_load_time = 352, + page_load_time = 352 + ) + else: + return PageLoadTestResult( + ) + """ + + def testPageLoadTestResult(self): + """Test PageLoadTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_page_load_test_results.py b/test_results_api/test/test_page_load_test_results.py new file mode 100644 index 00000000..91bbcdde --- /dev/null +++ b/test_results_api/test/test_page_load_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.page_load_test_results import PageLoadTestResults + +class TestPageLoadTestResults(unittest.TestCase): + """PageLoadTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PageLoadTestResults: + """Test PageLoadTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageLoadTestResults` + """ + model = PageLoadTestResults() + if include_optional: + return PageLoadTestResults( + results = [ + null + ], + test = None + ) + else: + return PageLoadTestResults( + ) + """ + + def testPageLoadTestResults(self): + """Test PageLoadTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_pagination_links.py b/test_results_api/test/test_pagination_links.py new file mode 100644 index 00000000..6546c96e --- /dev/null +++ b/test_results_api/test/test_pagination_links.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.pagination_links import PaginationLinks + +class TestPaginationLinks(unittest.TestCase): + """PaginationLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationLinks: + """Test PaginationLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationLinks` + """ + model = PaginationLinks() + if include_optional: + return PaginationLinks( + links = test_results_api.models.pagination_links__links.PaginationLinks__links( + previous = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + next = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return PaginationLinks( + ) + """ + + def testPaginationLinks(self): + """Test PaginationLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_pagination_links_links.py b/test_results_api/test/test_pagination_links_links.py new file mode 100644 index 00000000..ea4c6dae --- /dev/null +++ b/test_results_api/test/test_pagination_links_links.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.pagination_links_links import PaginationLinksLinks + +class TestPaginationLinksLinks(unittest.TestCase): + """PaginationLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationLinksLinks: + """Test PaginationLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationLinksLinks` + """ + model = PaginationLinksLinks() + if include_optional: + return PaginationLinksLinks( + previous = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + next = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return PaginationLinksLinks( + ) + """ + + def testPaginationLinksLinks(self): + """Test PaginationLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_path_vis_base_test_result.py b/test_results_api/test/test_path_vis_base_test_result.py new file mode 100644 index 00000000..809fd978 --- /dev/null +++ b/test_results_api/test/test_path_vis_base_test_result.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.path_vis_base_test_result import PathVisBaseTestResult + +class TestPathVisBaseTestResult(unittest.TestCase): + """PathVisBaseTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisBaseTestResult: + """Test PathVisBaseTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisBaseTestResult` + """ + model = PathVisBaseTestResult() + if include_optional: + return PathVisBaseTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + start_time = 1384309800, + end_time = 1384309800, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + server = 'www.google.com:443', + server_ip = '172.217.170.68', + source_ip = '196.40.106.237', + source_prefix = '196.40.96.0/20', + target_is_proxy = True, + direction = 'to-target' + ) + else: + return PathVisBaseTestResult( + ) + """ + + def testPathVisBaseTestResult(self): + """Test PathVisBaseTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_path_vis_detail_test_result.py b/test_results_api/test/test_path_vis_detail_test_result.py new file mode 100644 index 00000000..13a162ae --- /dev/null +++ b/test_results_api/test/test_path_vis_detail_test_result.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.path_vis_detail_test_result import PathVisDetailTestResult + +class TestPathVisDetailTestResult(unittest.TestCase): + """PathVisDetailTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisDetailTestResult: + """Test PathVisDetailTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisDetailTestResult` + """ + model = PathVisDetailTestResult() + if include_optional: + return PathVisDetailTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + start_time = 1384309800, + end_time = 1384309800, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + server = 'www.google.com:443', + server_ip = '172.217.170.68', + source_ip = '196.40.106.237', + source_prefix = '196.40.96.0/20', + target_is_proxy = True, + direction = 'to-target', + routes = [ + test_results_api.models.path_vis_route.PathVisRoute( + path_id = '4711301366345855606023718047703941305741293841502186803', + hops = [ + test_results_api.models.path_vis_hop.PathVisHop( + hop = 1, + ip_address = '196.40.106.237', + prefix = '196.40.96.0/20', + rdns = 'core-router1.cpt2.host-h.net', + network = 'HETZNER (Pty) Ltd (AS 37153)', + response_time = 1, + location = 'Cape Town, South Africa', + mpls = '', ) + ], ) + ] + ) + else: + return PathVisDetailTestResult( + ) + """ + + def testPathVisDetailTestResult(self): + """Test PathVisDetailTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_path_vis_detail_test_results.py b/test_results_api/test/test_path_vis_detail_test_results.py new file mode 100644 index 00000000..d72138b7 --- /dev/null +++ b/test_results_api/test/test_path_vis_detail_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.path_vis_detail_test_results import PathVisDetailTestResults + +class TestPathVisDetailTestResults(unittest.TestCase): + """PathVisDetailTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisDetailTestResults: + """Test PathVisDetailTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisDetailTestResults` + """ + model = PathVisDetailTestResults() + if include_optional: + return PathVisDetailTestResults( + results = [ + null + ], + test = None + ) + else: + return PathVisDetailTestResults( + ) + """ + + def testPathVisDetailTestResults(self): + """Test PathVisDetailTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_path_vis_endpoint.py b/test_results_api/test/test_path_vis_endpoint.py new file mode 100644 index 00000000..6edfec43 --- /dev/null +++ b/test_results_api/test/test_path_vis_endpoint.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.path_vis_endpoint import PathVisEndpoint + +class TestPathVisEndpoint(unittest.TestCase): + """PathVisEndpoint unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisEndpoint: + """Test PathVisEndpoint + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisEndpoint` + """ + model = PathVisEndpoint() + if include_optional: + return PathVisEndpoint( + ip_address = '196.40.106.237', + mss = 1460, + number_of_hops = 15, + path_id = '1230899668701775614109128428722974545787322404682781961521', + path_mtu = 'Cape Town, South Africa', + response_time = 1500 + ) + else: + return PathVisEndpoint( + ) + """ + + def testPathVisEndpoint(self): + """Test PathVisEndpoint""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_path_vis_hop.py b/test_results_api/test/test_path_vis_hop.py new file mode 100644 index 00000000..3913895a --- /dev/null +++ b/test_results_api/test/test_path_vis_hop.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.path_vis_hop import PathVisHop + +class TestPathVisHop(unittest.TestCase): + """PathVisHop unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisHop: + """Test PathVisHop + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisHop` + """ + model = PathVisHop() + if include_optional: + return PathVisHop( + hop = 1, + ip_address = '196.40.106.237', + prefix = '196.40.96.0/20', + rdns = 'core-router1.cpt2.host-h.net', + network = 'HETZNER (Pty) Ltd (AS 37153)', + response_time = 1, + location = 'Cape Town, South Africa', + mpls = '' + ) + else: + return PathVisHop( + ) + """ + + def testPathVisHop(self): + """Test PathVisHop""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_path_vis_route.py b/test_results_api/test/test_path_vis_route.py new file mode 100644 index 00000000..2b8ec4a1 --- /dev/null +++ b/test_results_api/test/test_path_vis_route.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.path_vis_route import PathVisRoute + +class TestPathVisRoute(unittest.TestCase): + """PathVisRoute unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisRoute: + """Test PathVisRoute + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisRoute` + """ + model = PathVisRoute() + if include_optional: + return PathVisRoute( + path_id = '4711301366345855606023718047703941305741293841502186803', + hops = [ + test_results_api.models.path_vis_hop.PathVisHop( + hop = 1, + ip_address = '196.40.106.237', + prefix = '196.40.96.0/20', + rdns = 'core-router1.cpt2.host-h.net', + network = 'HETZNER (Pty) Ltd (AS 37153)', + response_time = 1, + location = 'Cape Town, South Africa', + mpls = '', ) + ] + ) + else: + return PathVisRoute( + ) + """ + + def testPathVisRoute(self): + """Test PathVisRoute""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_path_vis_test_result.py b/test_results_api/test/test_path_vis_test_result.py new file mode 100644 index 00000000..656cf6a9 --- /dev/null +++ b/test_results_api/test/test_path_vis_test_result.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.path_vis_test_result import PathVisTestResult + +class TestPathVisTestResult(unittest.TestCase): + """PathVisTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisTestResult: + """Test PathVisTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisTestResult` + """ + model = PathVisTestResult() + if include_optional: + return PathVisTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + start_time = 1384309800, + end_time = 1384309800, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + server = 'www.google.com:443', + server_ip = '172.217.170.68', + source_ip = '196.40.106.237', + source_prefix = '196.40.96.0/20', + target_is_proxy = True, + direction = 'to-target', + endpoints = [ + test_results_api.models.path_vis_endpoint.PathVisEndpoint( + ip_address = '196.40.106.237', + mss = 1460, + number_of_hops = 15, + path_id = '1230899668701775614109128428722974545787322404682781961521', + path_mtu = 'Cape Town, South Africa', + response_time = 1500, ) + ] + ) + else: + return PathVisTestResult( + ) + """ + + def testPathVisTestResult(self): + """Test PathVisTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_path_vis_test_results.py b/test_results_api/test/test_path_vis_test_results.py new file mode 100644 index 00000000..3ebd6a9f --- /dev/null +++ b/test_results_api/test/test_path_vis_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.path_vis_test_results import PathVisTestResults + +class TestPathVisTestResults(unittest.TestCase): + """PathVisTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PathVisTestResults: + """Test PathVisTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PathVisTestResults` + """ + model = PathVisTestResults() + if include_optional: + return PathVisTestResults( + results = [ + null + ], + test = None + ) + else: + return PathVisTestResults( + ) + """ + + def testPathVisTestResults(self): + """Test PathVisTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_query_window.py b/test_results_api/test/test_query_window.py new file mode 100644 index 00000000..6afc1859 --- /dev/null +++ b/test_results_api/test/test_query_window.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.query_window import QueryWindow + +class TestQueryWindow(unittest.TestCase): + """QueryWindow unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> QueryWindow: + """Test QueryWindow + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `QueryWindow` + """ + model = QueryWindow() + if include_optional: + return QueryWindow( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z' + ) + else: + return QueryWindow( + ) + """ + + def testQueryWindow(self): + """Test QueryWindow""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_rtp_stream_test_result.py b/test_results_api/test/test_rtp_stream_test_result.py new file mode 100644 index 00000000..7d699b17 --- /dev/null +++ b/test_results_api/test/test_rtp_stream_test_result.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.rtp_stream_test_result import RtpStreamTestResult + +class TestRtpStreamTestResult(unittest.TestCase): + """RtpStreamTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RtpStreamTestResult: + """Test RtpStreamTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RtpStreamTestResult` + """ + model = RtpStreamTestResult() + if include_optional: + return RtpStreamTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + server_ip = '172.97.102.37', + dscp = '46', + dscp_name = 'EF (DSCP 46)', + mos = 4.351024, + codec_name = 'G.711 @ 64 Kbps', + codec_max_mos = 4.41, + loss = 0.0, + discards = 0, + latency = 103, + pdv = 1, + error_detail = 'Connection error' + ) + else: + return RtpStreamTestResult( + ) + """ + + def testRtpStreamTestResult(self): + """Test RtpStreamTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_rtp_stream_test_results.py b/test_results_api/test/test_rtp_stream_test_results.py new file mode 100644 index 00000000..2d5049a9 --- /dev/null +++ b/test_results_api/test/test_rtp_stream_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.rtp_stream_test_results import RtpStreamTestResults + +class TestRtpStreamTestResults(unittest.TestCase): + """RtpStreamTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RtpStreamTestResults: + """Test RtpStreamTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RtpStreamTestResults` + """ + model = RtpStreamTestResults() + if include_optional: + return RtpStreamTestResults( + results = [ + null + ], + test = None + ) + else: + return RtpStreamTestResults( + ) + """ + + def testRtpStreamTestResults(self): + """Test RtpStreamTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_self_links.py b/test_results_api/test/test_self_links.py new file mode 100644 index 00000000..75a45609 --- /dev/null +++ b/test_results_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = test_results_api.models.self_links__links.SelfLinks__links( + self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_self_links_links.py b/test_results_api/test/test_self_links_links.py new file mode 100644 index 00000000..9d6ed3f3 --- /dev/null +++ b/test_results_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = test_results_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_simple_test.py b/test_results_api/test/test_simple_test.py new file mode 100644 index 00000000..e1b94b2d --- /dev/null +++ b/test_results_api/test/test_simple_test.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.simple_test import SimpleTest + +class TestSimpleTest(unittest.TestCase): + """SimpleTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SimpleTest: + """Test SimpleTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SimpleTest` + """ + model = SimpleTest() + if include_optional: + return SimpleTest( + interval = 120, + alerts_enabled = True, + enabled = True, + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = test_results_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ) + ) + else: + return SimpleTest( + ) + """ + + def testSimpleTest(self): + """Test SimpleTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_sip_server_error_type.py b/test_results_api/test/test_sip_server_error_type.py new file mode 100644 index 00000000..23f8f5c2 --- /dev/null +++ b/test_results_api/test/test_sip_server_error_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.sip_server_error_type import SipServerErrorType + +class TestSipServerErrorType(unittest.TestCase): + """SipServerErrorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSipServerErrorType(self): + """Test SipServerErrorType""" + # inst = SipServerErrorType() + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_sip_server_test_result.py b/test_results_api/test/test_sip_server_test_result.py new file mode 100644 index 00000000..27752f22 --- /dev/null +++ b/test_results_api/test/test_sip_server_test_result.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.sip_server_test_result import SipServerTestResult + +class TestSipServerTestResult(unittest.TestCase): + """SipServerTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SipServerTestResult: + """Test SipServerTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SipServerTestResult` + """ + model = SipServerTestResult() + if include_optional: + return SipServerTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + server_ip = '193.2.1.88', + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + availability = 100.0, + connect_time = 5, + dns_time = 2, + invite_time = 10, + options_time = 17, + num_redirects = 0, + options_request = 'OPTIONS sip:6054@voice.sfo2.notarealco.com SIP/2.0 +Via: SIP/2.0/TCP 38.140.61.68:55431;branch=z9hG4bKRTzPzMoVh0;rport +From: ;tag=cGaJDNKQFE +To: +Call-ID: oO9WaL3av8@38.140.61.68 +CSeq: 3 OPTIONS +Contact: +User-Agent: ThousandEyes Test Call +Allow: INVITE, ACK, CANCEL, BYE +Supported: outbound, path +Max-Forwards: 70 +Expires: 60 +Content-Length: 0 + + +OPTIONS sip:6054@voice.sfo2.notarealco.com SIP/2.0 +Via: SIP/2.0/TCP 38.140.61.68:55431;branch=z9hG4bKRTzPzMoVh0;rport +From: ;tag=cGaJDNKQFE +To: +Call-ID: oO9WaL3av8@38.140.61.68 +CSeq: 4 OPTIONS +Contact: +Authorization: Digest username="al6054", realm="asterisk", nonce="1598728080/4e3bef2c789bdfa45ce9123221e08c8f", uri="sip:6054@voice.sfo2.notarealco.com", response="83c538a39ff766cf75ffd1d62317b442", algorithm=MD5, cnonce="0a4f113b", opaque="748ffa241d840721", qop=auth, nc=00000001 +User-Agent: ThousandEyes Test Call +Allow: INVITE, ACK, CANCEL, BYE +Supported: outbound, path +Max-Forwards: 70 +Expires: 60 +Content-Length: 0 + +', + options_response = 'SIP/2.0 401 Unauthorized +Via: SIP/2.0/TCP 38.140.61.68:55431;rport=55431;received=38.140.61.68;branch=z9hG4bKRTzPzMoVh0 +Call-ID: oO9WaL3av8@38.140.61.68 +From: ;tag=cGaJDNKQFE +To: ;tag=z9hG4bKRTzPzMoVh0 +CSeq: 3 OPTIONS +WWW-Authenticate: Digest realm="asterisk",nonce="1598728080/4e3bef2c789bdfa45ce9123221e08c8f",opaque="748ffa241d840721",algorithm=md5,qop="auth" +Server: Asterisk PBX 16.4.0 +Content-Length: 0 + + +SIP/2.0 200 OK +Via: SIP/2.0/TCP 38.140.61.68:55431;rport=55431;received=38.140.61.68;branch=z9hG4bKRTzPzMoVh0 +Call-ID: oO9WaL3av8@38.140.61.68 +From: ;tag=cGaJDNKQFE +To: ;tag=z9hG4bKRTzPzMoVh0 +CSeq: 4 OPTIONS +Accept: application/xpidf+xml, application/cpim-pidf+xml, application/simple-message-summary, application/pidf+xml, application/dialog-info+xml, application/simple-message-summary, application/pidf+xml, application/dialog-info+xml, application/sdp, message/sipfrag;version=2.0 +Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER +Supported: 100rel, timer, replaces, norefersub +Accept-Encoding: text/plain +Accept-Language: en +Server: Asterisk PBX 16.4.0 +Content-Length: 0 + +', + register_time = 21, + response_code = 200, + response_time = 12, + total_time = 40, + wait_time = 5, + error_type = 'none', + problem_detail = '' + ) + else: + return SipServerTestResult( + ) + """ + + def testSipServerTestResult(self): + """Test SipServerTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_sip_server_test_results.py b/test_results_api/test/test_sip_server_test_results.py new file mode 100644 index 00000000..1355b32f --- /dev/null +++ b/test_results_api/test/test_sip_server_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.sip_server_test_results import SipServerTestResults + +class TestSipServerTestResults(unittest.TestCase): + """SipServerTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SipServerTestResults: + """Test SipServerTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SipServerTestResults` + """ + model = SipServerTestResults() + if include_optional: + return SipServerTestResults( + results = [ + null + ], + test = None + ) + else: + return SipServerTestResults( + ) + """ + + def testSipServerTestResults(self): + """Test SipServerTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_ssl_cert.py b/test_results_api/test/test_ssl_cert.py new file mode 100644 index 00000000..4bf3258f --- /dev/null +++ b/test_results_api/test/test_ssl_cert.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.ssl_cert import SslCert + +class TestSslCert(unittest.TestCase): + """SslCert unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SslCert: + """Test SslCert + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SslCert` + """ + model = SslCert() + if include_optional: + return SslCert( + days_until_expiry = 56, + is_fetch_date_in_valid_cert_date_range = 'true', + has_valid_signing_cert = 'false', + issuer_name = 'DigiCert SHA2 Extended Validation Server CA', + valid_before = '2020-05-12T12:00Z', + valid_after = '2018-03-27T00:00Z', + subject_alternative_names = ["www.thousandeyes.com","thousandeyes.com"], + subject_name = 'www.thousandeyes.com' + ) + else: + return SslCert( + ) + """ + + def testSslCert(self): + """Test SslCert""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_test_direction.py b/test_results_api/test/test_test_direction.py new file mode 100644 index 00000000..2ea26fb6 --- /dev/null +++ b/test_results_api/test/test_test_direction.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.test_direction import TestDirection + +class TestTestDirection(unittest.TestCase): + """TestDirection unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestDirection(self): + """Test TestDirection""" + # inst = TestDirection() + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_test_interval.py b/test_results_api/test/test_test_interval.py new file mode 100644 index 00000000..f4a7a07a --- /dev/null +++ b/test_results_api/test/test_test_interval.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.test_interval import TestInterval + +class TestTestInterval(unittest.TestCase): + """TestInterval unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestInterval(self): + """Test TestInterval""" + # inst = TestInterval() + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_test_result.py b/test_results_api/test/test_test_result.py new file mode 100644 index 00000000..2f69632b --- /dev/null +++ b/test_results_api/test/test_test_result.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.test_result import TestResult + +class TestTestResult(unittest.TestCase): + """TestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestResult: + """Test TestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestResult` + """ + model = TestResult() + if include_optional: + return TestResult( + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800 + ) + else: + return TestResult( + ) + """ + + def testTestResult(self): + """Test TestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_test_result_app_links.py b/test_results_api/test/test_test_result_app_links.py new file mode 100644 index 00000000..ddefcdbf --- /dev/null +++ b/test_results_api/test/test_test_result_app_links.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.test_result_app_links import TestResultAppLinks + +class TestTestResultAppLinks(unittest.TestCase): + """TestResultAppLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestResultAppLinks: + """Test TestResultAppLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestResultAppLinks` + """ + model = TestResultAppLinks() + if include_optional: + return TestResultAppLinks( + links = {"appLink":{"href":"https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125"}} + ) + else: + return TestResultAppLinks( + ) + """ + + def testTestResultAppLinks(self): + """Test TestResultAppLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_test_type.py b/test_results_api/test/test_test_type.py new file mode 100644 index 00000000..438d7149 --- /dev/null +++ b/test_results_api/test/test_test_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.test_type import TestType + +class TestTestType(unittest.TestCase): + """TestType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestType(self): + """Test TestType""" + # inst = TestType() + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_unauthorized_error.py b/test_results_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..5f0ff289 --- /dev/null +++ b/test_results_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_unexpanded_instant_test.py b/test_results_api/test/test_unexpanded_instant_test.py new file mode 100644 index 00000000..9e992d53 --- /dev/null +++ b/test_results_api/test/test_unexpanded_instant_test.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.unexpanded_instant_test import UnexpandedInstantTest + +class TestUnexpandedInstantTest(unittest.TestCase): + """UnexpandedInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTest: + """Test UnexpandedInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTest` + """ + model = UnexpandedInstantTest() + if include_optional: + return UnexpandedInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = test_results_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ) + ) + else: + return UnexpandedInstantTest( + ) + """ + + def testUnexpandedInstantTest(self): + """Test UnexpandedInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_unexpanded_instant_test_links.py b/test_results_api/test/test_unexpanded_instant_test_links.py new file mode 100644 index 00000000..645ac1d2 --- /dev/null +++ b/test_results_api/test/test_unexpanded_instant_test_links.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks + +class TestUnexpandedInstantTestLinks(unittest.TestCase): + """UnexpandedInstantTestLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinks: + """Test UnexpandedInstantTestLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinks` + """ + model = UnexpandedInstantTestLinks() + if include_optional: + return UnexpandedInstantTestLinks( + var_self = None, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}] + ) + else: + return UnexpandedInstantTestLinks( + ) + """ + + def testUnexpandedInstantTestLinks(self): + """Test UnexpandedInstantTestLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_unexpanded_instant_test_links_self.py b/test_results_api/test/test_unexpanded_instant_test_links_self.py new file mode 100644 index 00000000..27523088 --- /dev/null +++ b/test_results_api/test/test_unexpanded_instant_test_links_self.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf + +class TestUnexpandedInstantTestLinksSelf(unittest.TestCase): + """UnexpandedInstantTestLinksSelf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinksSelf: + """Test UnexpandedInstantTestLinksSelf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinksSelf` + """ + model = UnexpandedInstantTestLinksSelf() + if include_optional: + return UnexpandedInstantTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return UnexpandedInstantTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testUnexpandedInstantTestLinksSelf(self): + """Test UnexpandedInstantTestLinksSelf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_unexpanded_instant_test_links_test_results.py b/test_results_api/test/test_unexpanded_instant_test_links_test_results.py new file mode 100644 index 00000000..a955609d --- /dev/null +++ b/test_results_api/test/test_unexpanded_instant_test_links_test_results.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults + +class TestUnexpandedInstantTestLinksTestResults(unittest.TestCase): + """UnexpandedInstantTestLinksTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinksTestResults: + """Test UnexpandedInstantTestLinksTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinksTestResults` + """ + model = UnexpandedInstantTestLinksTestResults() + if include_optional: + return UnexpandedInstantTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return UnexpandedInstantTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testUnexpandedInstantTestLinksTestResults(self): + """Test UnexpandedInstantTestLinksTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_unexpanded_test.py b/test_results_api/test/test_unexpanded_test.py new file mode 100644 index 00000000..722e92f7 --- /dev/null +++ b/test_results_api/test/test_unexpanded_test.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.unexpanded_test import UnexpandedTest + +class TestUnexpandedTest(unittest.TestCase): + """UnexpandedTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedTest: + """Test UnexpandedTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedTest` + """ + model = UnexpandedTest() + if include_optional: + return UnexpandedTest( + interval = 120, + alerts_enabled = True, + enabled = True + ) + else: + return UnexpandedTest( + ) + """ + + def testUnexpandedTest(self): + """Test UnexpandedTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_voice_rtp_server_test_metrics_api.py b/test_results_api/test/test_voice_rtp_server_test_metrics_api.py new file mode 100644 index 00000000..1e647ec4 --- /dev/null +++ b/test_results_api/test/test_voice_rtp_server_test_metrics_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest + +from test_results_api.api.voice_rtp_server_test_metrics_api import VoiceRTPServerTestMetricsApi + + +class TestVoiceRTPServerTestMetricsApi(unittest.TestCase): + """VoiceRTPServerTestMetricsApi unit test stubs""" + + def setUp(self) -> None: + self.api = VoiceRTPServerTestMetricsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_result_rtp_stream(self) -> None: + """Test case for get_test_result_rtp_stream + + Retrieve RTP server test metrics + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_voice_sip_server_test_metrics_api.py b/test_results_api/test/test_voice_sip_server_test_metrics_api.py new file mode 100644 index 00000000..ff19096b --- /dev/null +++ b/test_results_api/test/test_voice_sip_server_test_metrics_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest + +from test_results_api.api.voice_sip_server_test_metrics_api import VoiceSIPServerTestMetricsApi + + +class TestVoiceSIPServerTestMetricsApi(unittest.TestCase): + """VoiceSIPServerTestMetricsApi unit test stubs""" + + def setUp(self) -> None: + self.api = VoiceSIPServerTestMetricsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_result_sip_server(self) -> None: + """Test case for get_test_result_sip_server + + Get SIP server test results + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_web_ftp_server_test_metrics_api.py b/test_results_api/test/test_web_ftp_server_test_metrics_api.py new file mode 100644 index 00000000..ccd9d075 --- /dev/null +++ b/test_results_api/test/test_web_ftp_server_test_metrics_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest + +from test_results_api.api.web_ftp_server_test_metrics_api import WebFTPServerTestMetricsApi + + +class TestWebFTPServerTestMetricsApi(unittest.TestCase): + """WebFTPServerTestMetricsApi unit test stubs""" + + def setUp(self) -> None: + self.api = WebFTPServerTestMetricsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_result_ftp_server(self) -> None: + """Test case for get_test_result_ftp_server + + Get FTP server test results + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_web_http_server_test_metrics_api.py b/test_results_api/test/test_web_http_server_test_metrics_api.py new file mode 100644 index 00000000..e4a57f51 --- /dev/null +++ b/test_results_api/test/test_web_http_server_test_metrics_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest + +from test_results_api.api.web_http_server_test_metrics_api import WebHTTPServerTestMetricsApi + + +class TestWebHTTPServerTestMetricsApi(unittest.TestCase): + """WebHTTPServerTestMetricsApi unit test stubs""" + + def setUp(self) -> None: + self.api = WebHTTPServerTestMetricsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_result_http_server(self) -> None: + """Test case for get_test_result_http_server + + Get HTTP server test results + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_web_page_load_test_metrics_api.py b/test_results_api/test/test_web_page_load_test_metrics_api.py new file mode 100644 index 00000000..147af5a3 --- /dev/null +++ b/test_results_api/test/test_web_page_load_test_metrics_api.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest + +from test_results_api.api.web_page_load_test_metrics_api import WebPageLoadTestMetricsApi + + +class TestWebPageLoadTestMetricsApi(unittest.TestCase): + """WebPageLoadTestMetricsApi unit test stubs""" + + def setUp(self) -> None: + self.api = WebPageLoadTestMetricsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_result_page_load(self) -> None: + """Test case for get_test_result_page_load + + Get page load server test results + """ + pass + + def test_get_test_result_page_load_component_detail(self) -> None: + """Test case for get_test_result_page_load_component_detail + + Get page load server test results by agent and round + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_web_transaction_detail_test_result.py b/test_results_api/test/test_web_transaction_detail_test_result.py new file mode 100644 index 00000000..70fd994b --- /dev/null +++ b/test_results_api/test/test_web_transaction_detail_test_result.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.web_transaction_detail_test_result import WebTransactionDetailTestResult + +class TestWebTransactionDetailTestResult(unittest.TestCase): + """WebTransactionDetailTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebTransactionDetailTestResult: + """Test WebTransactionDetailTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebTransactionDetailTestResult` + """ + model = WebTransactionDetailTestResult() + if include_optional: + return WebTransactionDetailTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + component_errors = 5, + transaction_time = 2379, + error_type = 'None', + error_details = 'Connection error', + markers = [ + test_results_api.models.marker.Marker( + name = 'SearchForWebdriver', + duration = 56, ) + ], + pages = [ + test_results_api.models.page.Page( + page_num = 0, + page_name = 'Google', + component_count = 136, + error_count = 0, + duration = 1117.5660001039505, ) + ] + ) + else: + return WebTransactionDetailTestResult( + ) + """ + + def testWebTransactionDetailTestResult(self): + """Test WebTransactionDetailTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_web_transaction_detail_test_results.py b/test_results_api/test/test_web_transaction_detail_test_results.py new file mode 100644 index 00000000..2f924b44 --- /dev/null +++ b/test_results_api/test/test_web_transaction_detail_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.web_transaction_detail_test_results import WebTransactionDetailTestResults + +class TestWebTransactionDetailTestResults(unittest.TestCase): + """WebTransactionDetailTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebTransactionDetailTestResults: + """Test WebTransactionDetailTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebTransactionDetailTestResults` + """ + model = WebTransactionDetailTestResults() + if include_optional: + return WebTransactionDetailTestResults( + results = [ + null + ], + test = None + ) + else: + return WebTransactionDetailTestResults( + ) + """ + + def testWebTransactionDetailTestResults(self): + """Test WebTransactionDetailTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_web_transaction_page_detail_test_result.py b/test_results_api/test/test_web_transaction_page_detail_test_result.py new file mode 100644 index 00000000..bbfbcbbd --- /dev/null +++ b/test_results_api/test/test_web_transaction_page_detail_test_result.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.web_transaction_page_detail_test_result import WebTransactionPageDetailTestResult + +class TestWebTransactionPageDetailTestResult(unittest.TestCase): + """WebTransactionPageDetailTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebTransactionPageDetailTestResult: + """Test WebTransactionPageDetailTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebTransactionPageDetailTestResult` + """ + model = WebTransactionPageDetailTestResult() + if include_optional: + return WebTransactionPageDetailTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + component_errors = 5, + transaction_time = 2379, + error_type = 'None', + error_details = 'Connection error', + markers = [ + test_results_api.models.marker.Marker( + name = 'SearchForWebdriver', + duration = 56, ) + ], + pages = [ + test_results_api.models.page.Page( + page_num = 0, + page_name = 'Google', + component_count = 136, + error_count = 0, + duration = 1117.5660001039505, ) + ], + har = {"log":{"creator":{"name":"ThousandEyes DB Exporter"},"entries":[{"pageref":"page_0","request":{"headers":[{"name":":authority","value":"google.com"},{"name":":method","value":"GET"},{"name":":path","value":"/"},{"name":":scheme","value":"https"},{"name":"accept","value":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"},{"name":"accept-encoding","value":"gzip, deflate, br"},{"name":"accept-language","value":"en-US,en;q=0.9"},{"name":"upgrade-insecure-requests","value":"1"},{"name":"user-agent","value":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36"},{"name":"x-thousandeyes-agent","value":"yes"}],"method":"GET","url":"https://google.com/"},"response":{"bodySize":220,"content":{"mimeType":"text/html","size":220},"headers":[{"name":"alt-svc","value":"quic=\":443\"; ma=2592000; v=\"46,43\",h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000"},{"name":"cache-control","value":"public, max-age=2592000"},{"name":"content-length","value":"220"},{"name":"content-type","value":"text/html; charset=UTF-8"},{"name":"date","value":"Fri, 15 Nov 2019 16:41:54 GMT"},{"name":"expires","value":"Sun, 15 Dec 2019 16:41:54 GMT"},{"name":"location","value":"https://www.google.com/"},{"name":"server","value":"gws"},{"name":"status","value":"301"},{"name":"x-frame-options","value":"SAMEORIGIN"},{"name":"x-xss-protection","value":"0"}],"headersSize":471,"redirectURL":"","status":301,"statusText":"MOVED_PERMANENTLY"},"serverIPAddress":"172.217.6.110","startedDateTime":"2019-11-15T16:41:54.798Z","time":71,"timings":{"blocked":2,"connect":16,"dns":1,"receive":1,"send":0,"ssl":14,"wait":50}},{"pageref":"page_0","request":{"headers":[{"name":":authority","value":"www.google.com"},{"name":":method","value":"GET"},{"name":":path","value":"/"},{"name":":scheme","value":"https"},{"name":"accept","value":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"},{"name":"accept-encoding","value":"gzip, deflate, br"},{"name":"accept-language","value":"en-US,en;q=0.9"},{"name":"upgrade-insecure-requests","value":"1"},{"name":"user-agent","value":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36"},{"name":"x-thousandeyes-agent","value":"yes"}],"method":"GET","url":"https://www.google.com/"},"response":{"bodySize":65214,"content":{"mimeType":"text/html","size":225039},"headers":[{"name":"alt-svc","value":"quic=\":443\"; ma=2592000; v=\"46,43\",h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000"},{"name":"cache-control","value":"private, max-age=0"},{"name":"content-encoding","value":"br"},{"name":"content-length","value":"65214"},{"name":"content-type","value":"text/html; charset=UTF-8"},{"name":"date","value":"Fri, 15 Nov 2019 16:41:54 GMT"},{"name":"expires","value":"-1"},{"name":"p3p","value":"CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\""},{"name":"server","value":"gws"},{"name":"set-cookie","value":"(removed)"},{"name":"status","value":"200"},{"name":"strict-transport-security","value":"max-age=31536000"},{"name":"x-frame-options","value":"SAMEORIGIN"},{"name":"x-xss-protection","value":"0"}],"headersSize":915,"redirectURL":"","status":200,"statusText":"OK"},"serverIPAddress":"172.217.4.196","startedDateTime":"2019-11-15T16:41:54.870Z","time":182,"timings":{"blocked":2,"connect":4,"dns":0,"receive":58,"send":0,"ssl":2,"wait":118}}],"pages":[{"id":"page_0","pageTimings":{"onContentLoad":367,"onLoad":737},"responseCode":0,"startedDateTime":"2019-11-15T16:41:54.796Z","title":"Google"}],"version":"1.2"}} + ) + else: + return WebTransactionPageDetailTestResult( + ) + """ + + def testWebTransactionPageDetailTestResult(self): + """Test WebTransactionPageDetailTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_web_transaction_page_detail_test_results.py b/test_results_api/test/test_web_transaction_page_detail_test_results.py new file mode 100644 index 00000000..20240c81 --- /dev/null +++ b/test_results_api/test/test_web_transaction_page_detail_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.web_transaction_page_detail_test_results import WebTransactionPageDetailTestResults + +class TestWebTransactionPageDetailTestResults(unittest.TestCase): + """WebTransactionPageDetailTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebTransactionPageDetailTestResults: + """Test WebTransactionPageDetailTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebTransactionPageDetailTestResults` + """ + model = WebTransactionPageDetailTestResults() + if include_optional: + return WebTransactionPageDetailTestResults( + results = [ + null + ], + test = None + ) + else: + return WebTransactionPageDetailTestResults( + ) + """ + + def testWebTransactionPageDetailTestResults(self): + """Test WebTransactionPageDetailTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_web_transaction_test_result.py b/test_results_api/test/test_web_transaction_test_result.py new file mode 100644 index 00000000..d4815b64 --- /dev/null +++ b/test_results_api/test/test_web_transaction_test_result.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.web_transaction_test_result import WebTransactionTestResult + +class TestWebTransactionTestResult(unittest.TestCase): + """WebTransactionTestResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebTransactionTestResult: + """Test WebTransactionTestResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebTransactionTestResult` + """ + model = WebTransactionTestResult() + if include_optional: + return WebTransactionTestResult( + var_date = '2022-07-17T22:00:54Z', + round_id = 1384309800, + links = {appLink={href=https://app.thousandeyes.com/view/tests?__a=105&testId=195&roundId=1692916680&agentId=125}}, + agent = test_results_api.models.agent.Agent( + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + country_id = 'US', ), + component_errors = 5, + transaction_time = 2379, + error_type = 'None', + error_details = 'Connection error' + ) + else: + return WebTransactionTestResult( + ) + """ + + def testWebTransactionTestResult(self): + """Test WebTransactionTestResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_web_transaction_test_results.py b/test_results_api/test/test_web_transaction_test_results.py new file mode 100644 index 00000000..15574a60 --- /dev/null +++ b/test_results_api/test/test_web_transaction_test_results.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest +import datetime + +from test_results_api.models.web_transaction_test_results import WebTransactionTestResults + +class TestWebTransactionTestResults(unittest.TestCase): + """WebTransactionTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebTransactionTestResults: + """Test WebTransactionTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebTransactionTestResults` + """ + model = WebTransactionTestResults() + if include_optional: + return WebTransactionTestResults( + results = [ + null + ], + test = None + ) + else: + return WebTransactionTestResults( + ) + """ + + def testWebTransactionTestResults(self): + """Test WebTransactionTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test/test_web_transactions_test_metrics_api.py b/test_results_api/test/test_web_transactions_test_metrics_api.py new file mode 100644 index 00000000..382d0876 --- /dev/null +++ b/test_results_api/test/test_web_transactions_test_metrics_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 unittest + +from test_results_api.api.web_transactions_test_metrics_api import WebTransactionsTestMetricsApi + + +class TestWebTransactionsTestMetricsApi(unittest.TestCase): + """WebTransactionsTestMetricsApi unit test stubs""" + + def setUp(self) -> None: + self.api = WebTransactionsTestMetricsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_result_web_transactions(self) -> None: + """Test case for get_test_result_web_transactions + + Get web transactions test results + """ + pass + + def test_get_test_result_web_transactions_component_detail(self) -> None: + """Test case for get_test_result_web_transactions_component_detail + + Get web transactions test results by agent and round + """ + pass + + def test_get_test_result_web_transactions_component_page_detail(self) -> None: + """Test case for get_test_result_web_transactions_component_page_detail + + Get detailed web transactions test result by agent, round, and page + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test_results_api/test_results_api/__init__.py b/test_results_api/test_results_api/__init__.py new file mode 100644 index 00000000..a7fc452e --- /dev/null +++ b/test_results_api/test_results_api/__init__.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.api.dnssec_test_metrics_api import DNSSECTestMetricsApi +from test_results_api.api.dns_server_test_metrics_api import DNSServerTestMetricsApi +from test_results_api.api.dns_trace_test_metrics_api import DNSTraceTestMetricsApi +from test_results_api.api.network_bgp_test_metrics_api import NetworkBGPTestMetricsApi +from test_results_api.api.network_test_metrics_api import NetworkTestMetricsApi +from test_results_api.api.voice_rtp_server_test_metrics_api import VoiceRTPServerTestMetricsApi +from test_results_api.api.voice_sip_server_test_metrics_api import VoiceSIPServerTestMetricsApi +from test_results_api.api.web_ftp_server_test_metrics_api import WebFTPServerTestMetricsApi +from test_results_api.api.web_http_server_test_metrics_api import WebHTTPServerTestMetricsApi +from test_results_api.api.web_page_load_test_metrics_api import WebPageLoadTestMetricsApi +from test_results_api.api.web_transactions_test_metrics_api import WebTransactionsTestMetricsApi + +# import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.api_client import ApiClient +from test_results_api.configuration import Configuration +from test_results_api.exceptions import OpenApiException +from test_results_api.exceptions import ApiTypeError +from test_results_api.exceptions import ApiValueError +from test_results_api.exceptions import ApiKeyError +from test_results_api.exceptions import ApiAttributeError +from test_results_api.exceptions import ApiException + +# import models into sdk package +from test_results_api.models.agent import Agent +from test_results_api.models.app_links import AppLinks +from test_results_api.models.app_links_links import AppLinksLinks +from test_results_api.models.bgp_basic_test_result import BgpBasicTestResult +from test_results_api.models.bgp_hop import BgpHop +from test_results_api.models.bgp_test_result import BgpTestResult +from test_results_api.models.bgp_test_results import BgpTestResults +from test_results_api.models.bgp_test_route_information_result import BgpTestRouteInformationResult +from test_results_api.models.bgp_test_route_information_results import BgpTestRouteInformationResults +from test_results_api.models.dns_server_test_result import DnsServerTestResult +from test_results_api.models.dns_server_test_results import DnsServerTestResults +from test_results_api.models.dns_trace_test_result import DnsTraceTestResult +from test_results_api.models.dns_trace_test_results import DnsTraceTestResults +from test_results_api.models.dnssec_test_result import DnssecTestResult +from test_results_api.models.dnssec_test_results import DnssecTestResults +from test_results_api.models.epoch_time_window import EpochTimeWindow +from test_results_api.models.error import Error +from test_results_api.models.expand import Expand +from test_results_api.models.ftp_server_test_result import FtpServerTestResult +from test_results_api.models.ftp_server_test_results import FtpServerTestResults +from test_results_api.models.get_test_pathvis_agent_round200_response import GetTestPathvisAgentRound200Response +from test_results_api.models.get_test_result_dns_server200_response import GetTestResultDnsServer200Response +from test_results_api.models.get_test_result_dns_trace200_response import GetTestResultDnsTrace200Response +from test_results_api.models.get_test_result_dnssec200_response import GetTestResultDnssec200Response +from test_results_api.models.get_test_result_ftp_server200_response import GetTestResultFtpServer200Response +from test_results_api.models.get_test_result_http_server200_response import GetTestResultHttpServer200Response +from test_results_api.models.get_test_result_metrics200_response import GetTestResultMetrics200Response +from test_results_api.models.get_test_result_network_pathvis200_response import GetTestResultNetworkPathvis200Response +from test_results_api.models.get_test_result_page_load200_response import GetTestResultPageLoad200Response +from test_results_api.models.get_test_result_page_load_component_detail200_response import GetTestResultPageLoadComponentDetail200Response +from test_results_api.models.get_test_result_rtp_stream200_response import GetTestResultRtpStream200Response +from test_results_api.models.get_test_result_sip_server200_response import GetTestResultSipServer200Response +from test_results_api.models.get_test_result_web_transactions200_response import GetTestResultWebTransactions200Response +from test_results_api.models.get_test_result_web_transactions_component_detail200_response import GetTestResultWebTransactionsComponentDetail200Response +from test_results_api.models.get_test_result_web_transactions_component_page_detail200_response import GetTestResultWebTransactionsComponentPageDetail200Response +from test_results_api.models.get_test_results_bgp200_response import GetTestResultsBgp200Response +from test_results_api.models.get_test_results_bgp_prefix200_response import GetTestResultsBgpPrefix200Response +from test_results_api.models.http_test_result import HttpTestResult +from test_results_api.models.http_test_result_headers import HttpTestResultHeaders +from test_results_api.models.http_test_results import HttpTestResults +from test_results_api.models.link import Link +from test_results_api.models.marker import Marker +from test_results_api.models.monitor import Monitor +from test_results_api.models.network_test_result import NetworkTestResult +from test_results_api.models.network_test_results import NetworkTestResults +from test_results_api.models.page import Page +from test_results_api.models.page_load_detail_test_result import PageLoadDetailTestResult +from test_results_api.models.page_load_detail_test_results import PageLoadDetailTestResults +from test_results_api.models.page_load_test_result import PageLoadTestResult +from test_results_api.models.page_load_test_results import PageLoadTestResults +from test_results_api.models.pagination_links import PaginationLinks +from test_results_api.models.pagination_links_links import PaginationLinksLinks +from test_results_api.models.path_vis_base_test_result import PathVisBaseTestResult +from test_results_api.models.path_vis_detail_test_result import PathVisDetailTestResult +from test_results_api.models.path_vis_detail_test_results import PathVisDetailTestResults +from test_results_api.models.path_vis_endpoint import PathVisEndpoint +from test_results_api.models.path_vis_hop import PathVisHop +from test_results_api.models.path_vis_route import PathVisRoute +from test_results_api.models.path_vis_test_result import PathVisTestResult +from test_results_api.models.path_vis_test_results import PathVisTestResults +from test_results_api.models.query_window import QueryWindow +from test_results_api.models.rtp_stream_test_result import RtpStreamTestResult +from test_results_api.models.rtp_stream_test_results import RtpStreamTestResults +from test_results_api.models.self_links import SelfLinks +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +from test_results_api.models.sip_server_error_type import SipServerErrorType +from test_results_api.models.sip_server_test_result import SipServerTestResult +from test_results_api.models.sip_server_test_results import SipServerTestResults +from test_results_api.models.ssl_cert import SslCert +from test_results_api.models.test_direction import TestDirection +from test_results_api.models.test_interval import TestInterval +from test_results_api.models.test_result import TestResult +from test_results_api.models.test_result_app_links import TestResultAppLinks +from test_results_api.models.test_type import TestType +from test_results_api.models.unauthorized_error import UnauthorizedError +from test_results_api.models.unexpanded_instant_test import UnexpandedInstantTest +from test_results_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +from test_results_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf +from test_results_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults +from test_results_api.models.unexpanded_test import UnexpandedTest +from test_results_api.models.web_transaction_detail_test_result import WebTransactionDetailTestResult +from test_results_api.models.web_transaction_detail_test_results import WebTransactionDetailTestResults +from test_results_api.models.web_transaction_page_detail_test_result import WebTransactionPageDetailTestResult +from test_results_api.models.web_transaction_page_detail_test_results import WebTransactionPageDetailTestResults +from test_results_api.models.web_transaction_test_result import WebTransactionTestResult +from test_results_api.models.web_transaction_test_results import WebTransactionTestResults diff --git a/test_results_api/test_results_api/api/__init__.py b/test_results_api/test_results_api/api/__init__.py new file mode 100644 index 00000000..e9ebea34 --- /dev/null +++ b/test_results_api/test_results_api/api/__init__.py @@ -0,0 +1,15 @@ +# flake8: noqa + +# import apis into api package +from test_results_api.api.dnssec_test_metrics_api import DNSSECTestMetricsApi +from test_results_api.api.dns_server_test_metrics_api import DNSServerTestMetricsApi +from test_results_api.api.dns_trace_test_metrics_api import DNSTraceTestMetricsApi +from test_results_api.api.network_bgp_test_metrics_api import NetworkBGPTestMetricsApi +from test_results_api.api.network_test_metrics_api import NetworkTestMetricsApi +from test_results_api.api.voice_rtp_server_test_metrics_api import VoiceRTPServerTestMetricsApi +from test_results_api.api.voice_sip_server_test_metrics_api import VoiceSIPServerTestMetricsApi +from test_results_api.api.web_ftp_server_test_metrics_api import WebFTPServerTestMetricsApi +from test_results_api.api.web_http_server_test_metrics_api import WebHTTPServerTestMetricsApi +from test_results_api.api.web_page_load_test_metrics_api import WebPageLoadTestMetricsApi +from test_results_api.api.web_transactions_test_metrics_api import WebTransactionsTestMetricsApi + diff --git a/test_results_api/test_results_api/api/dns_server_test_metrics_api.py b/test_results_api/test_results_api/api/dns_server_test_metrics_api.py new file mode 100644 index 00000000..de83869e --- /dev/null +++ b/test_results_api/test_results_api/api/dns_server_test_metrics_api.py @@ -0,0 +1,846 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from test_results_api.models.get_test_result_dns_server200_response import GetTestResultDnsServer200Response + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class DNSServerTestMetricsApi: + """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_test_result_dns_server( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + server_id: Annotated[StrictStr, Field(description="DNS server ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultDnsServer200Response: + """Get DNS server test results by server + + Returns mappings for a DNS record and resolution time to the specified server, measured from the requesting agent's point of view. This is similar to dig @server. + + :param test_id: Test ID (required) + :type test_id: str + :param server_id: DNS server ID (required) + :type server_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_dns_server_serialize( + test_id=test_id, + server_id=server_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultDnsServer200Response", + '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 get_test_result_dns_server_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + server_id: Annotated[StrictStr, Field(description="DNS server ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultDnsServer200Response]: + """Get DNS server test results by server + + Returns mappings for a DNS record and resolution time to the specified server, measured from the requesting agent's point of view. This is similar to dig @server. + + :param test_id: Test ID (required) + :type test_id: str + :param server_id: DNS server ID (required) + :type server_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_dns_server_serialize( + test_id=test_id, + server_id=server_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultDnsServer200Response", + '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 get_test_result_dns_server_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + server_id: Annotated[StrictStr, Field(description="DNS server ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get DNS server test results by server + + Returns mappings for a DNS record and resolution time to the specified server, measured from the requesting agent's point of view. This is similar to dig @server. + + :param test_id: Test ID (required) + :type test_id: str + :param server_id: DNS server ID (required) + :type server_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_dns_server_serialize( + test_id=test_id, + server_id=server_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultDnsServer200Response", + '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 _get_test_result_dns_server_serialize( + self, + test_id, + server_id, + aid, + window, + start_date, + end_date, + cursor, + _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 test_id is not None: + _path_params['testId'] = test_id + if server_id is not None: + _path_params['serverId'] = server_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/test-results/{testId}/dns-server/{serverId}', + 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_test_result_dns_servers( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultDnsServer200Response: + """Get DNS server test results + + Returns the mappings for a DNS record, along with the resolution time to each authoritative server, measured from the agent's point of view. Similar to dig @server. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_dns_servers_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultDnsServer200Response", + '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 get_test_result_dns_servers_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultDnsServer200Response]: + """Get DNS server test results + + Returns the mappings for a DNS record, along with the resolution time to each authoritative server, measured from the agent's point of view. Similar to dig @server. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_dns_servers_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultDnsServer200Response", + '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 get_test_result_dns_servers_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get DNS server test results + + Returns the mappings for a DNS record, along with the resolution time to each authoritative server, measured from the agent's point of view. Similar to dig @server. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_dns_servers_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultDnsServer200Response", + '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 _get_test_result_dns_servers_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/test-results/{testId}/dns-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/test_results_api/test_results_api/api/dns_trace_test_metrics_api.py b/test_results_api/test_results_api/api/dns_trace_test_metrics_api.py new file mode 100644 index 00000000..4bf47d95 --- /dev/null +++ b/test_results_api/test_results_api/api/dns_trace_test_metrics_api.py @@ -0,0 +1,441 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from test_results_api.models.get_test_result_dns_trace200_response import GetTestResultDnsTrace200Response + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class DNSTraceTestMetricsApi: + """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_test_result_dns_trace( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultDnsTrace200Response: + """Get DNS trace test results + + Returns a DNS record from the requesting agent's point of view. This is similar to dig +trace. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_dns_trace_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultDnsTrace200Response", + '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 get_test_result_dns_trace_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultDnsTrace200Response]: + """Get DNS trace test results + + Returns a DNS record from the requesting agent's point of view. This is similar to dig +trace. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_dns_trace_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultDnsTrace200Response", + '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 get_test_result_dns_trace_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get DNS trace test results + + Returns a DNS record from the requesting agent's point of view. This is similar to dig +trace. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_dns_trace_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultDnsTrace200Response", + '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 _get_test_result_dns_trace_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/test-results/{testId}/dns-trace', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/test_results_api/test_results_api/api/dnssec_test_metrics_api.py b/test_results_api/test_results_api/api/dnssec_test_metrics_api.py new file mode 100644 index 00000000..18890593 --- /dev/null +++ b/test_results_api/test_results_api/api/dnssec_test_metrics_api.py @@ -0,0 +1,441 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from test_results_api.models.get_test_result_dnssec200_response import GetTestResultDnssec200Response + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class DNSSECTestMetricsApi: + """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_test_result_dnssec( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultDnssec200Response: + """Get DNSSEC test results + + Returns the keychain validity for a record on a domain secured using DNSSEC extensions. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_dnssec_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultDnssec200Response", + '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 get_test_result_dnssec_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultDnssec200Response]: + """Get DNSSEC test results + + Returns the keychain validity for a record on a domain secured using DNSSEC extensions. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_dnssec_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultDnssec200Response", + '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 get_test_result_dnssec_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get DNSSEC test results + + Returns the keychain validity for a record on a domain secured using DNSSEC extensions. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_dnssec_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultDnssec200Response", + '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 _get_test_result_dnssec_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/test-results/{testId}/dnssec', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/test_results_api/test_results_api/api/network_bgp_test_metrics_api.py b/test_results_api/test_results_api/api/network_bgp_test_metrics_api.py new file mode 100644 index 00000000..c47dbf05 --- /dev/null +++ b/test_results_api/test_results_api/api/network_bgp_test_metrics_api.py @@ -0,0 +1,776 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from test_results_api.models.get_test_results_bgp200_response import GetTestResultsBgp200Response +from test_results_api.models.get_test_results_bgp_prefix200_response import GetTestResultsBgpPrefix200Response + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class NetworkBGPTestMetricsApi: + """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_test_results_bgp( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultsBgp200Response: + """Get BGP test results + + Returns a list of BGP monitors actively monitoring the destination's target prefix. This list includes information about the prefix, its associated AS Number, and provides details regarding reachability, path updates, and any changes in the path for the target network. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_results_bgp_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultsBgp200Response", + '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 get_test_results_bgp_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultsBgp200Response]: + """Get BGP test results + + Returns a list of BGP monitors actively monitoring the destination's target prefix. This list includes information about the prefix, its associated AS Number, and provides details regarding reachability, path updates, and any changes in the path for the target network. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_results_bgp_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultsBgp200Response", + '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 get_test_results_bgp_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get BGP test results + + Returns a list of BGP monitors actively monitoring the destination's target prefix. This list includes information about the prefix, its associated AS Number, and provides details regarding reachability, path updates, and any changes in the path for the target network. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_results_bgp_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultsBgp200Response", + '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 _get_test_results_bgp_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/test-results/{testId}/bgp', + 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_test_results_bgp_prefix( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + prefix_id: Annotated[StrictStr, Field(description="The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint.")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultsBgpPrefix200Response: + """Get BGP route test results by prefix + + Returns an ordered list of networks crossed by a particular network prefix, including assigned monitors for the test and the paths taken to reach the destination. This is similar to revealing ASPath details found in a BGP Routing Information Base (rib) dump. + + :param test_id: Test ID (required) + :type test_id: str + :param prefix_id: The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint. (required) + :type prefix_id: str + :param round_id: Round ID (required) + :type round_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_test_results_bgp_prefix_serialize( + test_id=test_id, + prefix_id=prefix_id, + round_id=round_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': "GetTestResultsBgpPrefix200Response", + '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 get_test_results_bgp_prefix_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + prefix_id: Annotated[StrictStr, Field(description="The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint.")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultsBgpPrefix200Response]: + """Get BGP route test results by prefix + + Returns an ordered list of networks crossed by a particular network prefix, including assigned monitors for the test and the paths taken to reach the destination. This is similar to revealing ASPath details found in a BGP Routing Information Base (rib) dump. + + :param test_id: Test ID (required) + :type test_id: str + :param prefix_id: The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint. (required) + :type prefix_id: str + :param round_id: Round ID (required) + :type round_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_test_results_bgp_prefix_serialize( + test_id=test_id, + prefix_id=prefix_id, + round_id=round_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': "GetTestResultsBgpPrefix200Response", + '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 get_test_results_bgp_prefix_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + prefix_id: Annotated[StrictStr, Field(description="The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint.")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get BGP route test results by prefix + + Returns an ordered list of networks crossed by a particular network prefix, including assigned monitors for the test and the paths taken to reach the destination. This is similar to revealing ASPath details found in a BGP Routing Information Base (rib) dump. + + :param test_id: Test ID (required) + :type test_id: str + :param prefix_id: The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint. (required) + :type prefix_id: str + :param round_id: Round ID (required) + :type round_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_test_results_bgp_prefix_serialize( + test_id=test_id, + prefix_id=prefix_id, + round_id=round_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': "GetTestResultsBgpPrefix200Response", + '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 _get_test_results_bgp_prefix_serialize( + self, + test_id, + prefix_id, + round_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 test_id is not None: + _path_params['testId'] = test_id + if prefix_id is not None: + _path_params['prefixId'] = prefix_id + if round_id is not None: + _path_params['roundId'] = round_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/test-results/{testId}/bgp/routes/prefix/{prefixId}/round/{roundId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/test_results_api/test_results_api/api/network_test_metrics_api.py b/test_results_api/test_results_api/api/network_test_metrics_api.py new file mode 100644 index 00000000..f0bc7b76 --- /dev/null +++ b/test_results_api/test_results_api/api/network_test_metrics_api.py @@ -0,0 +1,1219 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from test_results_api.models.get_test_pathvis_agent_round200_response import GetTestPathvisAgentRound200Response +from test_results_api.models.get_test_result_metrics200_response import GetTestResultMetrics200Response +from test_results_api.models.get_test_result_network_pathvis200_response import GetTestResultNetworkPathvis200Response +from test_results_api.models.test_direction import TestDirection + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class NetworkTestMetricsApi: + """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_test_pathvis_agent_round( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + direction: Annotated[Optional[TestDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger 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, + ) -> GetTestPathvisAgentRound200Response: + """Get pathvis test results by agent and round + + Returns a summary of the path trace data collected during path visualization for a given agent and round. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `pathvis?direction=to-target`. For results from agent D to agent A, you can use `pathvis?direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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 direction: Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: TestDirection + :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_test_pathvis_agent_round_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestPathvisAgentRound200Response", + '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 get_test_pathvis_agent_round_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + direction: Annotated[Optional[TestDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger 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[GetTestPathvisAgentRound200Response]: + """Get pathvis test results by agent and round + + Returns a summary of the path trace data collected during path visualization for a given agent and round. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `pathvis?direction=to-target`. For results from agent D to agent A, you can use `pathvis?direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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 direction: Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: TestDirection + :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_test_pathvis_agent_round_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestPathvisAgentRound200Response", + '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 get_test_pathvis_agent_round_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + direction: Annotated[Optional[TestDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger 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: + """Get pathvis test results by agent and round + + Returns a summary of the path trace data collected during path visualization for a given agent and round. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `pathvis?direction=to-target`. For results from agent D to agent A, you can use `pathvis?direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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 direction: Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: TestDirection + :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_test_pathvis_agent_round_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestPathvisAgentRound200Response", + '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 _get_test_pathvis_agent_round_serialize( + self, + test_id, + agent_id, + round_id, + aid, + direction, + _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 test_id is not None: + _path_params['testId'] = test_id + if agent_id is not None: + _path_params['agentId'] = agent_id + if round_id is not None: + _path_params['roundId'] = round_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if direction is not None: + + _query_params.append(('direction', direction.value)) + + # 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/test-results/{testId}/pathvis/agent/{agentId}/round/{roundId}', + 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_test_result_metrics( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + direction: Annotated[Optional[TestDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger 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, + ) -> GetTestResultMetrics200Response: + """Get network test results + + Returns network test results for every agent and round. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: TestDirection + :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_test_result_metrics_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultMetrics200Response", + '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 get_test_result_metrics_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + direction: Annotated[Optional[TestDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger 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[GetTestResultMetrics200Response]: + """Get network test results + + Returns network test results for every agent and round. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: TestDirection + :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_test_result_metrics_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultMetrics200Response", + '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 get_test_result_metrics_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + direction: Annotated[Optional[TestDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger 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: + """Get network test results + + Returns network test results for every agent and round. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: TestDirection + :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_test_result_metrics_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultMetrics200Response", + '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 _get_test_result_metrics_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + direction, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if direction is not None: + + _query_params.append(('direction', direction.value)) + + # 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/test-results/{testId}/network', + 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_test_result_network_pathvis( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + direction: Annotated[Optional[TestDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger 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, + ) -> GetTestResultNetworkPathvis200Response: + """Get pathvis network test results + + Returns a summary of the path trace data collected during path visualization for a given time range. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `pathvis?direction=to-target`. For results from agent D to agent A, you can use `pathvis?direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: TestDirection + :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_test_result_network_pathvis_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultNetworkPathvis200Response", + '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 get_test_result_network_pathvis_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + direction: Annotated[Optional[TestDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger 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[GetTestResultNetworkPathvis200Response]: + """Get pathvis network test results + + Returns a summary of the path trace data collected during path visualization for a given time range. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `pathvis?direction=to-target`. For results from agent D to agent A, you can use `pathvis?direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: TestDirection + :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_test_result_network_pathvis_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultNetworkPathvis200Response", + '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 get_test_result_network_pathvis_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + direction: Annotated[Optional[TestDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger 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: + """Get pathvis network test results + + Returns a summary of the path trace data collected during path visualization for a given time range. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `pathvis?direction=to-target`. For results from agent D to agent A, you can use `pathvis?direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: TestDirection + :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_test_result_network_pathvis_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultNetworkPathvis200Response", + '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 _get_test_result_network_pathvis_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + direction, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if direction is not None: + + _query_params.append(('direction', direction.value)) + + # 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/test-results/{testId}/pathvis', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/test_results_api/test_results_api/api/voice_rtp_server_test_metrics_api.py b/test_results_api/test_results_api/api/voice_rtp_server_test_metrics_api.py new file mode 100644 index 00000000..f8a2292f --- /dev/null +++ b/test_results_api/test_results_api/api/voice_rtp_server_test_metrics_api.py @@ -0,0 +1,441 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from test_results_api.models.get_test_result_rtp_stream200_response import GetTestResultRtpStream200Response + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class VoiceRTPServerTestMetricsApi: + """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_test_result_rtp_stream( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultRtpStream200Response: + """Retrieve RTP server test metrics + + Returns Voice RTP server test results. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_rtp_stream_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultRtpStream200Response", + '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 get_test_result_rtp_stream_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultRtpStream200Response]: + """Retrieve RTP server test metrics + + Returns Voice RTP server test results. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_rtp_stream_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultRtpStream200Response", + '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 get_test_result_rtp_stream_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve RTP server test metrics + + Returns Voice RTP server test results. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_rtp_stream_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultRtpStream200Response", + '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 _get_test_result_rtp_stream_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/test-results/{testId}/rtp-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/test_results_api/test_results_api/api/voice_sip_server_test_metrics_api.py b/test_results_api/test_results_api/api/voice_sip_server_test_metrics_api.py new file mode 100644 index 00000000..bcba0d1c --- /dev/null +++ b/test_results_api/test_results_api/api/voice_sip_server_test_metrics_api.py @@ -0,0 +1,441 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from test_results_api.models.get_test_result_sip_server200_response import GetTestResultSipServer200Response + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class VoiceSIPServerTestMetricsApi: + """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_test_result_sip_server( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultSipServer200Response: + """Get SIP server test results + + Returns Voice SIP server test results. It returns data for each agent and each `roundId` within the selected time frame. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_sip_server_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultSipServer200Response", + '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 get_test_result_sip_server_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultSipServer200Response]: + """Get SIP server test results + + Returns Voice SIP server test results. It returns data for each agent and each `roundId` within the selected time frame. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_sip_server_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultSipServer200Response", + '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 get_test_result_sip_server_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get SIP server test results + + Returns Voice SIP server test results. It returns data for each agent and each `roundId` within the selected time frame. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_sip_server_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultSipServer200Response", + '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 _get_test_result_sip_server_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/test-results/{testId}/sip-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/test_results_api/test_results_api/api/web_ftp_server_test_metrics_api.py b/test_results_api/test_results_api/api/web_ftp_server_test_metrics_api.py new file mode 100644 index 00000000..73304dbc --- /dev/null +++ b/test_results_api/test_results_api/api/web_ftp_server_test_metrics_api.py @@ -0,0 +1,441 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from test_results_api.models.get_test_result_ftp_server200_response import GetTestResultFtpServer200Response + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class WebFTPServerTestMetricsApi: + """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_test_result_ftp_server( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultFtpServer200Response: + """Get FTP server test results + + Returns test results for FTP server requests. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_ftp_server_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultFtpServer200Response", + '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 get_test_result_ftp_server_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultFtpServer200Response]: + """Get FTP server test results + + Returns test results for FTP server requests. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_ftp_server_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultFtpServer200Response", + '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 get_test_result_ftp_server_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get FTP server test results + + Returns test results for FTP server requests. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_ftp_server_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultFtpServer200Response", + '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 _get_test_result_ftp_server_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/test-results/{testId}/ftp-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/test_results_api/test_results_api/api/web_http_server_test_metrics_api.py b/test_results_api/test_results_api/api/web_http_server_test_metrics_api.py new file mode 100644 index 00000000..9745c58d --- /dev/null +++ b/test_results_api/test_results_api/api/web_http_server_test_metrics_api.py @@ -0,0 +1,460 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import List, Optional + +from test_results_api.models.expand import Expand +from test_results_api.models.get_test_result_http_server200_response import GetTestResultHttpServer200Response + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class WebHTTPServerTestMetricsApi: + """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_test_result_http_server( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the 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, + ) -> GetTestResultHttpServer200Response: + """Get HTTP server test results + + Returns results for requests made over HTTP. Components include DNS, Connect, Wait, Receive, and Fetch. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the query. + :type expand: List[Expand] + :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_test_result_http_server_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultHttpServer200Response", + '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 get_test_result_http_server_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the 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[GetTestResultHttpServer200Response]: + """Get HTTP server test results + + Returns results for requests made over HTTP. Components include DNS, Connect, Wait, Receive, and Fetch. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the query. + :type expand: List[Expand] + :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_test_result_http_server_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultHttpServer200Response", + '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 get_test_result_http_server_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the 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: + """Get HTTP server test results + + Returns results for requests made over HTTP. Components include DNS, Connect, Wait, Receive, and Fetch. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the query. + :type expand: List[Expand] + :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_test_result_http_server_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultHttpServer200Response", + '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 _get_test_result_http_server_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + 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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # 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/test-results/{testId}/http-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/test_results_api/test_results_api/api/web_page_load_test_metrics_api.py b/test_results_api/test_results_api/api/web_page_load_test_metrics_api.py new file mode 100644 index 00000000..3ab2da4c --- /dev/null +++ b/test_results_api/test_results_api/api/web_page_load_test_metrics_api.py @@ -0,0 +1,776 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from test_results_api.models.get_test_result_page_load200_response import GetTestResultPageLoad200Response +from test_results_api.models.get_test_result_page_load_component_detail200_response import GetTestResultPageLoadComponentDetail200Response + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class WebPageLoadTestMetricsApi: + """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_test_result_page_load( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultPageLoad200Response: + """Get page load server test results + + Returns results for page load server tests with a focus on page load times and DOM for a web page. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_page_load_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultPageLoad200Response", + '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 get_test_result_page_load_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultPageLoad200Response]: + """Get page load server test results + + Returns results for page load server tests with a focus on page load times and DOM for a web page. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_page_load_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultPageLoad200Response", + '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 get_test_result_page_load_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get page load server test results + + Returns results for page load server tests with a focus on page load times and DOM for a web page. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_page_load_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultPageLoad200Response", + '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 _get_test_result_page_load_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/test-results/{testId}/page-load', + 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_test_result_page_load_component_detail( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultPageLoadComponentDetail200Response: + """Get page load server test results by agent and round + + Returns test results for a given agent and round in [HAR (http archive)](http://www.softwareishard.com/blog/har-12-spec/) format. These results contain a list of components and their load times in a page load test, similar to the waterfall view for a page load test. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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_test_result_page_load_component_detail_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_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': "GetTestResultPageLoadComponentDetail200Response", + '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 get_test_result_page_load_component_detail_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultPageLoadComponentDetail200Response]: + """Get page load server test results by agent and round + + Returns test results for a given agent and round in [HAR (http archive)](http://www.softwareishard.com/blog/har-12-spec/) format. These results contain a list of components and their load times in a page load test, similar to the waterfall view for a page load test. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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_test_result_page_load_component_detail_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_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': "GetTestResultPageLoadComponentDetail200Response", + '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 get_test_result_page_load_component_detail_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get page load server test results by agent and round + + Returns test results for a given agent and round in [HAR (http archive)](http://www.softwareishard.com/blog/har-12-spec/) format. These results contain a list of components and their load times in a page load test, similar to the waterfall view for a page load test. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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_test_result_page_load_component_detail_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_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': "GetTestResultPageLoadComponentDetail200Response", + '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 _get_test_result_page_load_component_detail_serialize( + self, + test_id, + agent_id, + round_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 test_id is not None: + _path_params['testId'] = test_id + if agent_id is not None: + _path_params['agentId'] = agent_id + if round_id is not None: + _path_params['roundId'] = round_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/test-results/{testId}/page-load/agent/{agentId}/round/{roundId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/test_results_api/test_results_api/api/web_transactions_test_metrics_api.py b/test_results_api/test_results_api/api/web_transactions_test_metrics_api.py new file mode 100644 index 00000000..6303fdf2 --- /dev/null +++ b/test_results_api/test_results_api/api/web_transactions_test_metrics_api.py @@ -0,0 +1,1126 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from test_results_api.models.get_test_result_web_transactions200_response import GetTestResultWebTransactions200Response +from test_results_api.models.get_test_result_web_transactions_component_detail200_response import GetTestResultWebTransactionsComponentDetail200Response +from test_results_api.models.get_test_result_web_transactions_component_page_detail200_response import GetTestResultWebTransactionsComponentPageDetail200Response + +from test_results_api.api_client import ApiClient +from test_results_api.api_response import ApiResponse +from test_results_api.rest import RESTResponseType + + +class WebTransactionsTestMetricsApi: + """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_test_result_web_transactions( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultWebTransactions200Response: + """Get web transactions test results + + Returns test results for web transactions. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_web_transactions_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultWebTransactions200Response", + '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 get_test_result_web_transactions_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultWebTransactions200Response]: + """Get web transactions test results + + Returns test results for web transactions. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_web_transactions_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultWebTransactions200Response", + '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 get_test_result_web_transactions_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get web transactions test results + + Returns test results for web transactions. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_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 window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_result_web_transactions_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetTestResultWebTransactions200Response", + '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 _get_test_result_web_transactions_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _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 test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/test-results/{testId}/web-transactions', + 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_test_result_web_transactions_component_detail( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultWebTransactionsComponentDetail200Response: + """Get web transactions test results by agent and round + + Returns test results for web transactions for a given agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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_test_result_web_transactions_component_detail_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_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': "GetTestResultWebTransactionsComponentDetail200Response", + '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 get_test_result_web_transactions_component_detail_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultWebTransactionsComponentDetail200Response]: + """Get web transactions test results by agent and round + + Returns test results for web transactions for a given agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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_test_result_web_transactions_component_detail_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_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': "GetTestResultWebTransactionsComponentDetail200Response", + '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 get_test_result_web_transactions_component_detail_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get web transactions test results by agent and round + + Returns test results for web transactions for a given agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_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_test_result_web_transactions_component_detail_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_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': "GetTestResultWebTransactionsComponentDetail200Response", + '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 _get_test_result_web_transactions_component_detail_serialize( + self, + test_id, + agent_id, + round_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 test_id is not None: + _path_params['testId'] = test_id + if agent_id is not None: + _path_params['agentId'] = agent_id + if round_id is not None: + _path_params['roundId'] = round_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/test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId}', + 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_test_result_web_transactions_component_page_detail( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + page_id: Annotated[StrictStr, Field(description="Web page ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetTestResultWebTransactionsComponentPageDetail200Response: + """Get detailed web transactions test result by agent, round, and page + + Returns a page of web transaction test results for an agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param page_id: Web page ID (required) + :type page_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_test_result_web_transactions_component_page_detail_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + page_id=page_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': "GetTestResultWebTransactionsComponentPageDetail200Response", + '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 get_test_result_web_transactions_component_page_detail_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + page_id: Annotated[StrictStr, Field(description="Web page ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetTestResultWebTransactionsComponentPageDetail200Response]: + """Get detailed web transactions test result by agent, round, and page + + Returns a page of web transaction test results for an agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param page_id: Web page ID (required) + :type page_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_test_result_web_transactions_component_page_detail_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + page_id=page_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': "GetTestResultWebTransactionsComponentPageDetail200Response", + '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 get_test_result_web_transactions_component_page_detail_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + page_id: Annotated[StrictStr, Field(description="Web page ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get detailed web transactions test result by agent, round, and page + + Returns a page of web transaction test results for an agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param page_id: Web page ID (required) + :type page_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_test_result_web_transactions_component_page_detail_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + page_id=page_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': "GetTestResultWebTransactionsComponentPageDetail200Response", + '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 _get_test_result_web_transactions_component_page_detail_serialize( + self, + test_id, + agent_id, + round_id, + page_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 test_id is not None: + _path_params['testId'] = test_id + if agent_id is not None: + _path_params['agentId'] = agent_id + if round_id is not None: + _path_params['roundId'] = round_id + if page_id is not None: + _path_params['pageId'] = page_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/test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId}/page/{pageId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/test_results_api/test_results_api/api_client.py b/test_results_api/test_results_api/api_client.py new file mode 100644 index 00000000..b3cda489 --- /dev/null +++ b/test_results_api/test_results_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.configuration import Configuration +from test_results_api.api_response import ApiResponse +import test_results_api.models +from test_results_api import rest +from test_results_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(test_results_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) diff --git a/test_results_api/test_results_api/api_response.py b/test_results_api/test_results_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/test_results_api/test_results_api/api_response.py @@ -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 + } diff --git a/test_results_api/test_results_api/configuration.py b/test_results_api/test_results_api/configuration.py new file mode 100644 index 00000000..4e8563ef --- /dev/null +++ b/test_results_api/test_results_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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("test_results_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 diff --git a/test_results_api/test_results_api/exceptions.py b/test_results_api/test_results_api/exceptions.py new file mode 100644 index 00000000..f5bd5637 --- /dev/null +++ b/test_results_api/test_results_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 diff --git a/test_results_api/test_results_api/models/__init__.py b/test_results_api/test_results_api/models/__init__.py new file mode 100644 index 00000000..f235dda1 --- /dev/null +++ b/test_results_api/test_results_api/models/__init__.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +# flake8: noqa +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.agent import Agent +from test_results_api.models.app_links import AppLinks +from test_results_api.models.app_links_links import AppLinksLinks +from test_results_api.models.bgp_basic_test_result import BgpBasicTestResult +from test_results_api.models.bgp_hop import BgpHop +from test_results_api.models.bgp_test_result import BgpTestResult +from test_results_api.models.bgp_test_results import BgpTestResults +from test_results_api.models.bgp_test_route_information_result import BgpTestRouteInformationResult +from test_results_api.models.bgp_test_route_information_results import BgpTestRouteInformationResults +from test_results_api.models.dns_server_test_result import DnsServerTestResult +from test_results_api.models.dns_server_test_results import DnsServerTestResults +from test_results_api.models.dns_trace_test_result import DnsTraceTestResult +from test_results_api.models.dns_trace_test_results import DnsTraceTestResults +from test_results_api.models.dnssec_test_result import DnssecTestResult +from test_results_api.models.dnssec_test_results import DnssecTestResults +from test_results_api.models.epoch_time_window import EpochTimeWindow +from test_results_api.models.error import Error +from test_results_api.models.expand import Expand +from test_results_api.models.ftp_server_test_result import FtpServerTestResult +from test_results_api.models.ftp_server_test_results import FtpServerTestResults +from test_results_api.models.get_test_pathvis_agent_round200_response import GetTestPathvisAgentRound200Response +from test_results_api.models.get_test_result_dns_server200_response import GetTestResultDnsServer200Response +from test_results_api.models.get_test_result_dns_trace200_response import GetTestResultDnsTrace200Response +from test_results_api.models.get_test_result_dnssec200_response import GetTestResultDnssec200Response +from test_results_api.models.get_test_result_ftp_server200_response import GetTestResultFtpServer200Response +from test_results_api.models.get_test_result_http_server200_response import GetTestResultHttpServer200Response +from test_results_api.models.get_test_result_metrics200_response import GetTestResultMetrics200Response +from test_results_api.models.get_test_result_network_pathvis200_response import GetTestResultNetworkPathvis200Response +from test_results_api.models.get_test_result_page_load200_response import GetTestResultPageLoad200Response +from test_results_api.models.get_test_result_page_load_component_detail200_response import GetTestResultPageLoadComponentDetail200Response +from test_results_api.models.get_test_result_rtp_stream200_response import GetTestResultRtpStream200Response +from test_results_api.models.get_test_result_sip_server200_response import GetTestResultSipServer200Response +from test_results_api.models.get_test_result_web_transactions200_response import GetTestResultWebTransactions200Response +from test_results_api.models.get_test_result_web_transactions_component_detail200_response import GetTestResultWebTransactionsComponentDetail200Response +from test_results_api.models.get_test_result_web_transactions_component_page_detail200_response import GetTestResultWebTransactionsComponentPageDetail200Response +from test_results_api.models.get_test_results_bgp200_response import GetTestResultsBgp200Response +from test_results_api.models.get_test_results_bgp_prefix200_response import GetTestResultsBgpPrefix200Response +from test_results_api.models.http_test_result import HttpTestResult +from test_results_api.models.http_test_result_headers import HttpTestResultHeaders +from test_results_api.models.http_test_results import HttpTestResults +from test_results_api.models.link import Link +from test_results_api.models.marker import Marker +from test_results_api.models.monitor import Monitor +from test_results_api.models.network_test_result import NetworkTestResult +from test_results_api.models.network_test_results import NetworkTestResults +from test_results_api.models.page import Page +from test_results_api.models.page_load_detail_test_result import PageLoadDetailTestResult +from test_results_api.models.page_load_detail_test_results import PageLoadDetailTestResults +from test_results_api.models.page_load_test_result import PageLoadTestResult +from test_results_api.models.page_load_test_results import PageLoadTestResults +from test_results_api.models.pagination_links import PaginationLinks +from test_results_api.models.pagination_links_links import PaginationLinksLinks +from test_results_api.models.path_vis_base_test_result import PathVisBaseTestResult +from test_results_api.models.path_vis_detail_test_result import PathVisDetailTestResult +from test_results_api.models.path_vis_detail_test_results import PathVisDetailTestResults +from test_results_api.models.path_vis_endpoint import PathVisEndpoint +from test_results_api.models.path_vis_hop import PathVisHop +from test_results_api.models.path_vis_route import PathVisRoute +from test_results_api.models.path_vis_test_result import PathVisTestResult +from test_results_api.models.path_vis_test_results import PathVisTestResults +from test_results_api.models.query_window import QueryWindow +from test_results_api.models.rtp_stream_test_result import RtpStreamTestResult +from test_results_api.models.rtp_stream_test_results import RtpStreamTestResults +from test_results_api.models.self_links import SelfLinks +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +from test_results_api.models.sip_server_error_type import SipServerErrorType +from test_results_api.models.sip_server_test_result import SipServerTestResult +from test_results_api.models.sip_server_test_results import SipServerTestResults +from test_results_api.models.ssl_cert import SslCert +from test_results_api.models.test_direction import TestDirection +from test_results_api.models.test_interval import TestInterval +from test_results_api.models.test_result import TestResult +from test_results_api.models.test_result_app_links import TestResultAppLinks +from test_results_api.models.test_type import TestType +from test_results_api.models.unauthorized_error import UnauthorizedError +from test_results_api.models.unexpanded_instant_test import UnexpandedInstantTest +from test_results_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +from test_results_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf +from test_results_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults +from test_results_api.models.unexpanded_test import UnexpandedTest +from test_results_api.models.web_transaction_detail_test_result import WebTransactionDetailTestResult +from test_results_api.models.web_transaction_detail_test_results import WebTransactionDetailTestResults +from test_results_api.models.web_transaction_page_detail_test_result import WebTransactionPageDetailTestResult +from test_results_api.models.web_transaction_page_detail_test_results import WebTransactionPageDetailTestResults +from test_results_api.models.web_transaction_test_result import WebTransactionTestResult +from test_results_api.models.web_transaction_test_results import WebTransactionTestResults diff --git a/test_results_api/test_results_api/models/agent.py b/test_results_api/test_results_api/models/agent.py new file mode 100644 index 00000000..e6347e77 --- /dev/null +++ b/test_results_api/test_results_api/models/agent.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 Agent(BaseModel): + """ + Agent + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique agent ID", alias="agentId") + agent_name: Optional[StrictStr] = Field(default=None, description="Agent name", alias="agentName") + country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId") + __properties: ClassVar[List[str]] = ["agentId", "agentName", "countryId"] + + 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "agent_id", + "agent_name", + "country_id", + }, + 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({ + "agentId": obj.get("agentId"), + "agentName": obj.get("agentName"), + "countryId": obj.get("countryId") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/app_links.py b/test_results_api/test_results_api/models/app_links.py new file mode 100644 index 00000000..75080366 --- /dev/null +++ b/test_results_api/test_results_api/models/app_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.app_links_links import AppLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AppLinks(BaseModel): + """ + AppLinks + """ # noqa: E501 + links: Optional[AppLinksLinks] = 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 AppLinks 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 AppLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": AppLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/app_links_links.py b/test_results_api/test_results_api/models/app_links_links.py new file mode 100644 index 00000000..3e90f86b --- /dev/null +++ b/test_results_api/test_results_api/models/app_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AppLinksLinks(BaseModel): + """ + A links object containing the ThousandEyes App link + """ # noqa: E501 + app_link: Optional[Link] = Field(default=None, alias="appLink") + __properties: ClassVar[List[str]] = ["appLink"] + + 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 AppLinksLinks 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 app_link + if self.app_link: + _dict['appLink'] = self.app_link.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AppLinksLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "appLink": Link.from_dict(obj.get("appLink")) if obj.get("appLink") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/bgp_basic_test_result.py b/test_results_api/test_results_api/models/bgp_basic_test_result.py new file mode 100644 index 00000000..b342caa9 --- /dev/null +++ b/test_results_api/test_results_api/models/bgp_basic_test_result.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.monitor import Monitor +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class BgpBasicTestResult(BaseModel): + """ + BgpBasicTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + monitor: Optional[Monitor] = None + prefix_id: Optional[StrictStr] = Field(default=None, description="Internally tracked prefix ID.", alias="prefixId") + prefix: Optional[StrictStr] = Field(default=None, description="Prefix being tracked.") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "monitor", "prefixId", "prefix"] + + 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 BgpBasicTestResult 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={ + "var_date", + "round_id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of monitor + if self.monitor: + _dict['monitor'] = self.monitor.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of BgpBasicTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "monitor": Monitor.from_dict(obj.get("monitor")) if obj.get("monitor") is not None else None, + "prefixId": obj.get("prefixId"), + "prefix": obj.get("prefix") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/bgp_hop.py b/test_results_api/test_results_api/models/bgp_hop.py new file mode 100644 index 00000000..01d745b6 --- /dev/null +++ b/test_results_api/test_results_api/models/bgp_hop.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class BgpHop(BaseModel): + """ + BgpHop + """ # noqa: E501 + asn: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="ASN of transit autonomous system") + as_name: Optional[StrictStr] = Field(default=None, description="Name of autonomous system.", alias="asName") + __properties: ClassVar[List[str]] = ["asn", "asName"] + + 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 BgpHop 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={ + "asn", + "as_name", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of BgpHop from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "asn": obj.get("asn"), + "asName": obj.get("asName") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/bgp_test_result.py b/test_results_api/test_results_api/models/bgp_test_result.py new file mode 100644 index 00000000..b178a9ea --- /dev/null +++ b/test_results_api/test_results_api/models/bgp_test_result.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.monitor import Monitor +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class BgpTestResult(BaseModel): + """ + BgpTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + monitor: Optional[Monitor] = None + prefix_id: Optional[StrictStr] = Field(default=None, description="Internally tracked prefix ID.", alias="prefixId") + prefix: Optional[StrictStr] = Field(default=None, description="Prefix being tracked.") + updates: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Number of updates tracked against this prefix by this monitor.") + path_changes: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Number of path changes tracked against this prefix by this monitor.", alias="pathChanges") + reachability: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percentage reachability") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "monitor", "prefixId", "prefix", "updates", "pathChanges", "reachability"] + + 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 BgpTestResult 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={ + "var_date", + "round_id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of monitor + if self.monitor: + _dict['monitor'] = self.monitor.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of BgpTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "monitor": Monitor.from_dict(obj.get("monitor")) if obj.get("monitor") is not None else None, + "prefixId": obj.get("prefixId"), + "prefix": obj.get("prefix"), + "updates": obj.get("updates"), + "pathChanges": obj.get("pathChanges"), + "reachability": obj.get("reachability") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/bgp_test_results.py b/test_results_api/test_results_api/models/bgp_test_results.py new file mode 100644 index 00000000..26dc4dfe --- /dev/null +++ b/test_results_api/test_results_api/models/bgp_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.bgp_test_result import BgpTestResult +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class BgpTestResults(BaseModel): + """ + BgpTestResults + """ # noqa: E501 + results: Optional[List[BgpTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 BgpTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of BgpTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [BgpTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/bgp_test_route_information_result.py b/test_results_api/test_results_api/models/bgp_test_route_information_result.py new file mode 100644 index 00000000..e2c6ad2a --- /dev/null +++ b/test_results_api/test_results_api/models/bgp_test_route_information_result.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.bgp_hop import BgpHop +from test_results_api.models.monitor import Monitor +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class BgpTestRouteInformationResult(BaseModel): + """ + BgpTestRouteInformationResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + monitor: Optional[Monitor] = None + prefix_id: Optional[StrictStr] = Field(default=None, description="Internally tracked prefix ID.", alias="prefixId") + prefix: Optional[StrictStr] = Field(default=None, description="Prefix being tracked.") + is_active: Optional[StrictBool] = Field(default=None, description="Represents whether the route is active or inactive. An inactive route was an active route in the previous test round and is now superseded by another active (preferred) route. When requesting data for the test round in which a route change happened, both routes (active and inactive one) are included in the response.", alias="isActive") + hops: Optional[List[BgpHop]] = None + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "monitor", "prefixId", "prefix", "isActive", "hops"] + + 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 BgpTestRouteInformationResult 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={ + "var_date", + "round_id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of monitor + if self.monitor: + _dict['monitor'] = self.monitor.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in hops (list) + _items = [] + if self.hops: + for _item in self.hops: + if _item: + _items.append(_item.to_dict()) + _dict['hops'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of BgpTestRouteInformationResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "monitor": Monitor.from_dict(obj.get("monitor")) if obj.get("monitor") is not None else None, + "prefixId": obj.get("prefixId"), + "prefix": obj.get("prefix"), + "isActive": obj.get("isActive"), + "hops": [BgpHop.from_dict(_item) for _item in obj.get("hops")] if obj.get("hops") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/bgp_test_route_information_results.py b/test_results_api/test_results_api/models/bgp_test_route_information_results.py new file mode 100644 index 00000000..270d4418 --- /dev/null +++ b/test_results_api/test_results_api/models/bgp_test_route_information_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.bgp_test_route_information_result import BgpTestRouteInformationResult +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class BgpTestRouteInformationResults(BaseModel): + """ + BgpTestRouteInformationResults + """ # noqa: E501 + results: Optional[List[BgpTestRouteInformationResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 BgpTestRouteInformationResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of BgpTestRouteInformationResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [BgpTestRouteInformationResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/dns_server_test_result.py b/test_results_api/test_results_api/models/dns_server_test_result.py new file mode 100644 index 00000000..ef4617e6 --- /dev/null +++ b/test_results_api/test_results_api/models/dns_server_test_result.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsServerTestResult(BaseModel): + """ + DnsServerTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") + end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") + agent: Optional[Agent] = None + server_id: Optional[StrictStr] = Field(default=None, description="Internal ID of DNS server being tested", alias="serverId") + server: Optional[StrictStr] = Field(default=None, description="Canonical name of server being tested") + resolution_time: Optional[StrictInt] = Field(default=None, description="How long it took to run the query against the serverow long it took to run the query against the server", alias="resolutionTime") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error were encountered", alias="errorDetails") + mappings: Optional[StrictStr] = Field(default=None, description="Final mappings returned from the request") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "startTime", "endTime", "agent", "serverId", "server", "resolutionTime", "errorDetails", "mappings"] + + 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 DnsServerTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "var_date", + "round_id", + "start_time", + "end_time", + "server_id", + "server", + "resolution_time", + "error_details", + "mappings", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DnsServerTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "startTime": obj.get("startTime"), + "endTime": obj.get("endTime"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "serverId": obj.get("serverId"), + "server": obj.get("server"), + "resolutionTime": obj.get("resolutionTime"), + "errorDetails": obj.get("errorDetails"), + "mappings": obj.get("mappings") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/dns_server_test_results.py b/test_results_api/test_results_api/models/dns_server_test_results.py new file mode 100644 index 00000000..a7adc3b6 --- /dev/null +++ b/test_results_api/test_results_api/models/dns_server_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.dns_server_test_result import DnsServerTestResult +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsServerTestResults(BaseModel): + """ + DnsServerTestResults + """ # noqa: E501 + results: Optional[List[DnsServerTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 DnsServerTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DnsServerTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [DnsServerTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/dns_trace_test_result.py b/test_results_api/test_results_api/models/dns_trace_test_result.py new file mode 100644 index 00000000..cacfb946 --- /dev/null +++ b/test_results_api/test_results_api/models/dns_trace_test_result.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsTraceTestResult(BaseModel): + """ + DnsTraceTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") + end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") + agent: Optional[Agent] = None + output: Optional[StrictStr] = Field(default=None, description="Verbose output from the trace request") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error were encountered", alias="errorDetails") + queries: Optional[StrictInt] = Field(default=None, description="How many queries were required to get to the requested result") + failed_queries: Optional[StrictInt] = Field(default=None, description="How many queries failed while getting to the requested result", alias="failedQueries") + final_server_queried: Optional[StrictStr] = Field(default=None, description="DNS server that provided the final result", alias="finalServerQueried") + final_query_time: Optional[StrictInt] = Field(default=None, description="How long the final query took to return a response", alias="finalQueryTime") + mappings: Optional[StrictStr] = Field(default=None, description="Final mappings returned from the request") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "startTime", "endTime", "agent", "output", "errorDetails", "queries", "failedQueries", "finalServerQueried", "finalQueryTime", "mappings"] + + 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 DnsTraceTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "var_date", + "round_id", + "start_time", + "end_time", + "output", + "error_details", + "queries", + "failed_queries", + "final_server_queried", + "final_query_time", + "mappings", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DnsTraceTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "startTime": obj.get("startTime"), + "endTime": obj.get("endTime"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "output": obj.get("output"), + "errorDetails": obj.get("errorDetails"), + "queries": obj.get("queries"), + "failedQueries": obj.get("failedQueries"), + "finalServerQueried": obj.get("finalServerQueried"), + "finalQueryTime": obj.get("finalQueryTime"), + "mappings": obj.get("mappings") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/dns_trace_test_results.py b/test_results_api/test_results_api/models/dns_trace_test_results.py new file mode 100644 index 00000000..548d28de --- /dev/null +++ b/test_results_api/test_results_api/models/dns_trace_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.dns_trace_test_result import DnsTraceTestResult +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsTraceTestResults(BaseModel): + """ + DnsTraceTestResults + """ # noqa: E501 + results: Optional[List[DnsTraceTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 DnsTraceTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DnsTraceTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [DnsTraceTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/dnssec_test_result.py b/test_results_api/test_results_api/models/dnssec_test_result.py new file mode 100644 index 00000000..c2a950cd --- /dev/null +++ b/test_results_api/test_results_api/models/dnssec_test_result.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnssecTestResult(BaseModel): + """ + DnssecTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") + end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") + agent: Optional[Agent] = None + is_valid: Optional[StrictBool] = Field(default=None, description="Indicates if keychain is valid (if false see errorDetails field)", alias="isValid") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error were encountered", alias="errorDetails") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "startTime", "endTime", "agent", "isValid", "errorDetails"] + + 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 DnssecTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "var_date", + "round_id", + "start_time", + "end_time", + "is_valid", + "error_details", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DnssecTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "startTime": obj.get("startTime"), + "endTime": obj.get("endTime"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "isValid": obj.get("isValid"), + "errorDetails": obj.get("errorDetails") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/dnssec_test_results.py b/test_results_api/test_results_api/models/dnssec_test_results.py new file mode 100644 index 00000000..4cd4531b --- /dev/null +++ b/test_results_api/test_results_api/models/dnssec_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.dnssec_test_result import DnssecTestResult +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnssecTestResults(BaseModel): + """ + DnssecTestResults + """ # noqa: E501 + results: Optional[List[DnssecTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 DnssecTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DnssecTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [DnssecTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/epoch_time_window.py b/test_results_api/test_results_api/models/epoch_time_window.py new file mode 100644 index 00000000..67d74595 --- /dev/null +++ b/test_results_api/test_results_api/models/epoch_time_window.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EpochTimeWindow(BaseModel): + """ + EpochTimeWindow + """ # noqa: E501 + start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") + end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") + __properties: ClassVar[List[str]] = ["startTime", "endTime"] + + 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 EpochTimeWindow 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={ + "start_time", + "end_time", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EpochTimeWindow from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startTime": obj.get("startTime"), + "endTime": obj.get("endTime") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/error.py b/test_results_api/test_results_api/models/error.py new file mode 100644 index 00000000..85b596d4 --- /dev/null +++ b/test_results_api/test_results_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 + + diff --git a/test_results_api/test_results_api/models/expand.py b/test_results_api/test_results_api/models/expand.py new file mode 100644 index 00000000..b16cb010 --- /dev/null +++ b/test_results_api/test_results_api/models/expand.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 Expand(str, Enum): + """ + Expand + """ + + """ + allowed enum values + """ + HEADER = 'header' + CERTIFICATE = 'certificate' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Expand from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/test_results_api/test_results_api/models/ftp_server_test_result.py b/test_results_api/test_results_api/models/ftp_server_test_result.py new file mode 100644 index 00000000..8e2fe026 --- /dev/null +++ b/test_results_api/test_results_api/models/ftp_server_test_result.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class FtpServerTestResult(BaseModel): + """ + FtpServerTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + agent: Optional[Agent] = None + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of destination server", alias="serverIp") + response_code: Optional[StrictInt] = Field(default=None, description="FTP response code", alias="responseCode") + dns_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Time required to resolve DNS in milliseconds", alias="dnsTime") + connect_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Time required to establish a TCP connection to the server in milliseconds", alias="connectTime") + negotiation_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Time negotiate the connection and authenticate with the destination server in milliseconds", alias="negotiationTime") + wait_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Time elapsed between completion of request and first byte of response in milliseconds", alias="waitTime") + response_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Sum of DNS, connect, negotiation and wait times in milliseconds", alias="responseTime") + transfer_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Elapsed time between first and last byte of the transfer in milliseconds", alias="transferTime") + wire_size: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Size of content in bytes", alias="wireSize") + total_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Sum of response + transfer time in milliseconds", alias="totalTime") + error_type: Optional[StrictStr] = Field(default=None, description="Type of error encountered; corresponds to phase of connection", alias="errorType") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error were encountered", alias="errorDetails") + throughput: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="WireSize divided by receiveTime in byter per second") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "agent", "serverIp", "responseCode", "dnsTime", "connectTime", "negotiationTime", "waitTime", "responseTime", "transferTime", "wireSize", "totalTime", "errorType", "errorDetails", "throughput"] + + 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 FtpServerTestResult 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={ + "var_date", + "round_id", + "server_ip", + "response_code", + "dns_time", + "connect_time", + "negotiation_time", + "wait_time", + "response_time", + "transfer_time", + "wire_size", + "total_time", + "error_type", + "error_details", + "throughput", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of FtpServerTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "serverIp": obj.get("serverIp"), + "responseCode": obj.get("responseCode"), + "dnsTime": obj.get("dnsTime"), + "connectTime": obj.get("connectTime"), + "negotiationTime": obj.get("negotiationTime"), + "waitTime": obj.get("waitTime"), + "responseTime": obj.get("responseTime"), + "transferTime": obj.get("transferTime"), + "wireSize": obj.get("wireSize"), + "totalTime": obj.get("totalTime"), + "errorType": obj.get("errorType"), + "errorDetails": obj.get("errorDetails"), + "throughput": obj.get("throughput") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/ftp_server_test_results.py b/test_results_api/test_results_api/models/ftp_server_test_results.py new file mode 100644 index 00000000..c68fdb3c --- /dev/null +++ b/test_results_api/test_results_api/models/ftp_server_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.ftp_server_test_result import FtpServerTestResult +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class FtpServerTestResults(BaseModel): + """ + FtpServerTestResults + """ # noqa: E501 + results: Optional[List[FtpServerTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 FtpServerTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of FtpServerTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [FtpServerTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_pathvis_agent_round200_response.py b/test_results_api/test_results_api/models/get_test_pathvis_agent_round200_response.py new file mode 100644 index 00000000..e25dedf1 --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_pathvis_agent_round200_response.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.path_vis_detail_test_result import PathVisDetailTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestPathvisAgentRound200Response(BaseModel): + """ + GetTestPathvisAgentRound200Response + """ # noqa: E501 + results: Optional[List[PathVisDetailTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "_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 GetTestPathvisAgentRound200Response 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestPathvisAgentRound200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisDetailTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_dns_server200_response.py b/test_results_api/test_results_api/models/get_test_result_dns_server200_response.py new file mode 100644 index 00000000..aff7d65a --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_dns_server200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +from pydantic import Field +from test_results_api.models.dns_server_test_result import DnsServerTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultDnsServer200Response(BaseModel): + """ + GetTestResultDnsServer200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[DnsServerTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "test", "_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 GetTestResultDnsServer200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultDnsServer200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [DnsServerTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_dns_trace200_response.py b/test_results_api/test_results_api/models/get_test_result_dns_trace200_response.py new file mode 100644 index 00000000..52455706 --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_dns_trace200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +from pydantic import Field +from test_results_api.models.dns_trace_test_result import DnsTraceTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultDnsTrace200Response(BaseModel): + """ + GetTestResultDnsTrace200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[DnsTraceTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "test", "_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 GetTestResultDnsTrace200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultDnsTrace200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [DnsTraceTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_dnssec200_response.py b/test_results_api/test_results_api/models/get_test_result_dnssec200_response.py new file mode 100644 index 00000000..7a163492 --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_dnssec200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +from pydantic import Field +from test_results_api.models.dnssec_test_result import DnssecTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultDnssec200Response(BaseModel): + """ + GetTestResultDnssec200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[DnssecTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "test", "_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 GetTestResultDnssec200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultDnssec200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [DnssecTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_ftp_server200_response.py b/test_results_api/test_results_api/models/get_test_result_ftp_server200_response.py new file mode 100644 index 00000000..0b647f77 --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_ftp_server200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +from pydantic import Field +from test_results_api.models.ftp_server_test_result import FtpServerTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultFtpServer200Response(BaseModel): + """ + GetTestResultFtpServer200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[FtpServerTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "test", "_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 GetTestResultFtpServer200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultFtpServer200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [FtpServerTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_http_server200_response.py b/test_results_api/test_results_api/models/get_test_result_http_server200_response.py new file mode 100644 index 00000000..14654421 --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_http_server200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +from pydantic import Field +from test_results_api.models.http_test_result import HttpTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultHttpServer200Response(BaseModel): + """ + GetTestResultHttpServer200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[HttpTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "test", "_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 GetTestResultHttpServer200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultHttpServer200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [HttpTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_metrics200_response.py b/test_results_api/test_results_api/models/get_test_result_metrics200_response.py new file mode 100644 index 00000000..283507f3 --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_metrics200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +from pydantic import Field +from test_results_api.models.network_test_result import NetworkTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultMetrics200Response(BaseModel): + """ + GetTestResultMetrics200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[NetworkTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "test", "_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 GetTestResultMetrics200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultMetrics200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [NetworkTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_network_pathvis200_response.py b/test_results_api/test_results_api/models/get_test_result_network_pathvis200_response.py new file mode 100644 index 00000000..3441fdd9 --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_network_pathvis200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +from pydantic import Field +from test_results_api.models.path_vis_test_result import PathVisTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultNetworkPathvis200Response(BaseModel): + """ + GetTestResultNetworkPathvis200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[PathVisTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "test", "_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 GetTestResultNetworkPathvis200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultNetworkPathvis200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [PathVisTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_page_load200_response.py b/test_results_api/test_results_api/models/get_test_result_page_load200_response.py new file mode 100644 index 00000000..e09a2c49 --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_page_load200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +from pydantic import Field +from test_results_api.models.page_load_test_result import PageLoadTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultPageLoad200Response(BaseModel): + """ + GetTestResultPageLoad200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[PageLoadTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "test", "_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 GetTestResultPageLoad200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultPageLoad200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [PageLoadTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_page_load_component_detail200_response.py b/test_results_api/test_results_api/models/get_test_result_page_load_component_detail200_response.py new file mode 100644 index 00000000..e0a3c737 --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_page_load_component_detail200_response.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.page_load_detail_test_result import PageLoadDetailTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultPageLoadComponentDetail200Response(BaseModel): + """ + GetTestResultPageLoadComponentDetail200Response + """ # noqa: E501 + results: Optional[List[PageLoadDetailTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "_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 GetTestResultPageLoadComponentDetail200Response 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultPageLoadComponentDetail200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PageLoadDetailTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_rtp_stream200_response.py b/test_results_api/test_results_api/models/get_test_result_rtp_stream200_response.py new file mode 100644 index 00000000..ab25d7e0 --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_rtp_stream200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +from pydantic import Field +from test_results_api.models.rtp_stream_test_result import RtpStreamTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultRtpStream200Response(BaseModel): + """ + GetTestResultRtpStream200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[RtpStreamTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "test", "_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 GetTestResultRtpStream200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultRtpStream200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [RtpStreamTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_sip_server200_response.py b/test_results_api/test_results_api/models/get_test_result_sip_server200_response.py new file mode 100644 index 00000000..4307898e --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_sip_server200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +from pydantic import Field +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +from test_results_api.models.sip_server_test_result import SipServerTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultSipServer200Response(BaseModel): + """ + GetTestResultSipServer200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[SipServerTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "test", "_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 GetTestResultSipServer200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultSipServer200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [SipServerTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_web_transactions200_response.py b/test_results_api/test_results_api/models/get_test_result_web_transactions200_response.py new file mode 100644 index 00000000..5d02a6c2 --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_web_transactions200_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +from pydantic import Field +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +from test_results_api.models.web_transaction_test_result import WebTransactionTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultWebTransactions200Response(BaseModel): + """ + GetTestResultWebTransactions200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + results: Optional[List[WebTransactionTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "results", "test", "_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 GetTestResultWebTransactions200Response 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultWebTransactions200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "results": [WebTransactionTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_web_transactions_component_detail200_response.py b/test_results_api/test_results_api/models/get_test_result_web_transactions_component_detail200_response.py new file mode 100644 index 00000000..bb77661a --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_web_transactions_component_detail200_response.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +from test_results_api.models.web_transaction_detail_test_result import WebTransactionDetailTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultWebTransactionsComponentDetail200Response(BaseModel): + """ + GetTestResultWebTransactionsComponentDetail200Response + """ # noqa: E501 + results: Optional[List[WebTransactionDetailTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "_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 GetTestResultWebTransactionsComponentDetail200Response 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultWebTransactionsComponentDetail200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [WebTransactionDetailTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_result_web_transactions_component_page_detail200_response.py b/test_results_api/test_results_api/models/get_test_result_web_transactions_component_page_detail200_response.py new file mode 100644 index 00000000..9758f7ff --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_result_web_transactions_component_page_detail200_response.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +from test_results_api.models.web_transaction_page_detail_test_result import WebTransactionPageDetailTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultWebTransactionsComponentPageDetail200Response(BaseModel): + """ + GetTestResultWebTransactionsComponentPageDetail200Response + """ # noqa: E501 + results: Optional[List[WebTransactionPageDetailTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "_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 GetTestResultWebTransactionsComponentPageDetail200Response 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultWebTransactionsComponentPageDetail200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [WebTransactionPageDetailTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_results_bgp200_response.py b/test_results_api/test_results_api/models/get_test_results_bgp200_response.py new file mode 100644 index 00000000..b05b2b92 --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_results_bgp200_response.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.bgp_test_result import BgpTestResult +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultsBgp200Response(BaseModel): + """ + GetTestResultsBgp200Response + """ # noqa: E501 + results: Optional[List[BgpTestResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "_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 GetTestResultsBgp200Response 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultsBgp200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [BgpTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/get_test_results_bgp_prefix200_response.py b/test_results_api/test_results_api/models/get_test_results_bgp_prefix200_response.py new file mode 100644 index 00000000..d82c5f44 --- /dev/null +++ b/test_results_api/test_results_api/models/get_test_results_bgp_prefix200_response.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.bgp_test_route_information_result import BgpTestRouteInformationResult +from test_results_api.models.self_links_links import SelfLinksLinks +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTestResultsBgpPrefix200Response(BaseModel): + """ + GetTestResultsBgpPrefix200Response + """ # noqa: E501 + results: Optional[List[BgpTestRouteInformationResult]] = None + test: Optional[SimpleTest] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "_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 GetTestResultsBgpPrefix200Response 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.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 GetTestResultsBgpPrefix200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [BgpTestRouteInformationResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/http_test_result.py b/test_results_api/test_results_api/models/http_test_result.py new file mode 100644 index 00000000..6b92d741 --- /dev/null +++ b/test_results_api/test_results_api/models/http_test_result.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +from test_results_api.models.http_test_result_headers import HttpTestResultHeaders +from test_results_api.models.ssl_cert import SslCert +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class HttpTestResult(BaseModel): + """ + HttpTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + agent: Optional[Agent] = None + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of destination server", alias="serverIp") + response_code: Optional[StrictInt] = Field(default=None, description="HTTP response code", alias="responseCode") + num_redirects: Optional[StrictInt] = Field(default=None, description="Number of redirects", alias="numRedirects") + redirect_time: Optional[StrictInt] = Field(default=None, description="Cumulative redirect timing in milliseconds", alias="redirectTime") + dns_time: Optional[StrictInt] = Field(default=None, description="Time required to resolve DNS in milliseconds", alias="dnsTime") + ssl_time: Optional[StrictInt] = Field(default=None, description="Time to negotiate SSL/TLS in milliseconds", alias="sslTime") + connect_time: Optional[StrictInt] = Field(default=None, description="Time required to establish a TCP connection to the server", alias="connectTime") + wait_time: Optional[StrictInt] = Field(default=None, description="Time elapsed between completion of request and first byte of response in milliseconds", alias="waitTime") + receive_time: Optional[StrictInt] = Field(default=None, description="Elapsed time between first and last byte of response in milliseconds", alias="receiveTime") + wire_size: Optional[StrictInt] = Field(default=None, description="Size of content in bytes", alias="wireSize") + response_time: Optional[StrictInt] = Field(default=None, description="Time to first byte in milliseconds", alias="responseTime") + throughput: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="WireSize divided by receiveTime in byter per second") + total_time: Optional[StrictInt] = Field(default=None, description="response time + receive time", alias="totalTime") + headers: Optional[HttpTestResultHeaders] = None + error_type: Optional[StrictStr] = Field(default=None, description="Type of error encountered; corresponds to phase of connection", alias="errorType") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error were encountered", alias="errorDetails") + ssl_cipher: Optional[StrictStr] = Field(default=None, description="Cipher suite", alias="sslCipher") + ssl_version: Optional[StrictStr] = Field(default=None, description="TLS version", alias="sslVersion") + ssl_certificates: Optional[List[SslCert]] = Field(default=None, alias="sslCertificates") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "agent", "serverIp", "responseCode", "numRedirects", "redirectTime", "dnsTime", "sslTime", "connectTime", "waitTime", "receiveTime", "wireSize", "responseTime", "throughput", "totalTime", "headers", "errorType", "errorDetails", "sslCipher", "sslVersion", "sslCertificates"] + + 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 HttpTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "var_date", + "round_id", + "server_ip", + "error_type", + "error_details", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + # override the default output from pydantic by calling `to_dict()` of headers + if self.headers: + _dict['headers'] = self.headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in ssl_certificates (list) + _items = [] + if self.ssl_certificates: + for _item in self.ssl_certificates: + if _item: + _items.append(_item.to_dict()) + _dict['sslCertificates'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of HttpTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "serverIp": obj.get("serverIp"), + "responseCode": obj.get("responseCode"), + "numRedirects": obj.get("numRedirects"), + "redirectTime": obj.get("redirectTime"), + "dnsTime": obj.get("dnsTime"), + "sslTime": obj.get("sslTime"), + "connectTime": obj.get("connectTime"), + "waitTime": obj.get("waitTime"), + "receiveTime": obj.get("receiveTime"), + "wireSize": obj.get("wireSize"), + "responseTime": obj.get("responseTime"), + "throughput": obj.get("throughput"), + "totalTime": obj.get("totalTime"), + "headers": HttpTestResultHeaders.from_dict(obj.get("headers")) if obj.get("headers") is not None else None, + "errorType": obj.get("errorType"), + "errorDetails": obj.get("errorDetails"), + "sslCipher": obj.get("sslCipher"), + "sslVersion": obj.get("sslVersion"), + "sslCertificates": [SslCert.from_dict(_item) for _item in obj.get("sslCertificates")] if obj.get("sslCertificates") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/http_test_result_headers.py b/test_results_api/test_results_api/models/http_test_result_headers.py new file mode 100644 index 00000000..ce178a7c --- /dev/null +++ b/test_results_api/test_results_api/models/http_test_result_headers.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 HttpTestResultHeaders(BaseModel): + """ + Expandable object containing both request and response headers + """ # noqa: E501 + request_headers: Optional[StrictStr] = Field(default=None, description="Crlf-delimited list of request headers in header: value format", alias="requestHeaders") + response_headers: Optional[StrictStr] = Field(default=None, description="crlf-delimited list of response headers in header: value format", alias="responseHeaders") + __properties: ClassVar[List[str]] = ["requestHeaders", "responseHeaders"] + + 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 HttpTestResultHeaders 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 HttpTestResultHeaders from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "requestHeaders": obj.get("requestHeaders"), + "responseHeaders": obj.get("responseHeaders") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/http_test_results.py b/test_results_api/test_results_api/models/http_test_results.py new file mode 100644 index 00000000..144efc1a --- /dev/null +++ b/test_results_api/test_results_api/models/http_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.http_test_result import HttpTestResult +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class HttpTestResults(BaseModel): + """ + HttpTestResults + """ # noqa: E501 + results: Optional[List[HttpTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 HttpTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of HttpTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [HttpTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/link.py b/test_results_api/test_results_api/models/link.py new file mode 100644 index 00000000..e356d428 --- /dev/null +++ b/test_results_api/test_results_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 + + diff --git a/test_results_api/test_results_api/models/marker.py b/test_results_api/test_results_api/models/marker.py new file mode 100644 index 00000000..4c8d75d6 --- /dev/null +++ b/test_results_api/test_results_api/models/marker.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 Marker(BaseModel): + """ + Marker + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Name assigned to marker in transaction script") + duration: Optional[StrictInt] = Field(default=None, description="Total time recorded by marker in milliseconds") + __properties: ClassVar[List[str]] = ["name", "duration"] + + 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 Marker 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={ + "name", + "duration", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Marker from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "duration": obj.get("duration") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/monitor.py b/test_results_api/test_results_api/models/monitor.py new file mode 100644 index 00000000..7e975106 --- /dev/null +++ b/test_results_api/test_results_api/models/monitor.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 Monitor(BaseModel): + """ + Monitor + """ # noqa: E501 + monitor_id: Optional[StrictStr] = Field(default=None, description="Unique monitor ID.", alias="monitorId") + monitor_name: Optional[StrictStr] = Field(default=None, description="The name of the Monitor.", alias="monitorName") + country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code.", alias="countryId") + __properties: ClassVar[List[str]] = ["monitorId", "monitorName", "countryId"] + + 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 Monitor 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={ + "monitor_id", + "monitor_name", + "country_id", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Monitor from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "monitorId": obj.get("monitorId"), + "monitorName": obj.get("monitorName"), + "countryId": obj.get("countryId") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/network_test_result.py b/test_results_api/test_results_api/models/network_test_result.py new file mode 100644 index 00000000..7988b056 --- /dev/null +++ b/test_results_api/test_results_api/models/network_test_result.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +from test_results_api.models.test_direction import TestDirection +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class NetworkTestResult(BaseModel): + """ + NetworkTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date in UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") + end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") + available_bandwidth: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="availableBandwidth") + avg_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Average RTT for packets sent to destination", alias="avgLatency") + bandwidth: Optional[Union[StrictFloat, StrictInt]] = None + capacity: Optional[Union[StrictFloat, StrictInt]] = None + jitter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Standard deviation of latency") + loss: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percentage of packets not reaching destination") + max_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum RTT for packets sent to destination", alias="maxLatency") + min_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Minimum RTT for packets sent to destination", alias="minLatency") + agent: Optional[Agent] = None + server_ip: Optional[StrictStr] = Field(default=None, description="IP of target server", alias="serverIp") + server: Optional[StrictStr] = Field(default=None, description="Target server, including port (if method used is TCP)") + direction: Optional[TestDirection] = None + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "startTime", "endTime", "availableBandwidth", "avgLatency", "bandwidth", "capacity", "jitter", "loss", "maxLatency", "minLatency", "agent", "serverIp", "server", "direction"] + + 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 NetworkTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "var_date", + "round_id", + "start_time", + "end_time", + "available_bandwidth", + "avg_latency", + "bandwidth", + "capacity", + "jitter", + "loss", + "max_latency", + "min_latency", + "server_ip", + "server", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NetworkTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "startTime": obj.get("startTime"), + "endTime": obj.get("endTime"), + "availableBandwidth": obj.get("availableBandwidth"), + "avgLatency": obj.get("avgLatency"), + "bandwidth": obj.get("bandwidth"), + "capacity": obj.get("capacity"), + "jitter": obj.get("jitter"), + "loss": obj.get("loss"), + "maxLatency": obj.get("maxLatency"), + "minLatency": obj.get("minLatency"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "serverIp": obj.get("serverIp"), + "server": obj.get("server"), + "direction": obj.get("direction") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/network_test_results.py b/test_results_api/test_results_api/models/network_test_results.py new file mode 100644 index 00000000..7827ec72 --- /dev/null +++ b/test_results_api/test_results_api/models/network_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.network_test_result import NetworkTestResult +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class NetworkTestResults(BaseModel): + """ + NetworkTestResults + """ # noqa: E501 + results: Optional[List[NetworkTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 NetworkTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NetworkTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [NetworkTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/page.py b/test_results_api/test_results_api/models/page.py new file mode 100644 index 00000000..7008012b --- /dev/null +++ b/test_results_api/test_results_api/models/page.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Page(BaseModel): + """ + Page + """ # noqa: E501 + page_num: Optional[StrictInt] = Field(default=None, description="Page index", alias="pageNum") + page_name: Optional[StrictStr] = Field(default=None, description="Meta title value for page visited", alias="pageName") + component_count: Optional[StrictInt] = Field(default=None, description="Number of components on target page", alias="componentCount") + error_count: Optional[StrictInt] = Field(default=None, description="Number of errors encountered during page load", alias="errorCount") + duration: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Time spent on page in milliseconds") + __properties: ClassVar[List[str]] = ["pageNum", "pageName", "componentCount", "errorCount", "duration"] + + 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 Page 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "page_num", + "page_name", + "component_count", + "error_count", + "duration", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Page from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pageNum": obj.get("pageNum"), + "pageName": obj.get("pageName"), + "componentCount": obj.get("componentCount"), + "errorCount": obj.get("errorCount"), + "duration": obj.get("duration") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/page_load_detail_test_result.py b/test_results_api/test_results_api/models/page_load_detail_test_result.py new file mode 100644 index 00000000..84696f41 --- /dev/null +++ b/test_results_api/test_results_api/models/page_load_detail_test_result.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +from test_results_api.models.agent import Agent +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PageLoadDetailTestResult(BaseModel): + """ + PageLoadDetailTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + agent: Optional[Agent] = None + response_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Time to first byte in milliseconds", alias="responseTime") + total_size: Optional[StrictInt] = Field(default=None, description="Sum of wire size of all objects on page in bytes", alias="totalSize") + num_objects: Optional[StrictInt] = Field(default=None, description="Number of objects found on the page", alias="numObjects") + num_errors: Optional[StrictInt] = Field(default=None, description="Number of objects which encountered errors during download", alias="numErrors") + dom_load_time: Optional[StrictInt] = Field(default=None, description="Time to interaction in milliseconds", alias="domLoadTime") + page_load_time: Optional[StrictInt] = Field(default=None, description="Time to completely load page in milliseconds", alias="pageLoadTime") + har: Optional[Union[str, Any]] = Field(default=None, description="See [HAR specification](http://www.softwareishard.com/blog/har-12-spec/) for details") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "agent", "responseTime", "totalSize", "numObjects", "numErrors", "domLoadTime", "pageLoadTime", "har"] + + 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 PageLoadDetailTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "var_date", + "round_id", + "response_time", + "total_size", + "num_objects", + "num_errors", + "dom_load_time", + "page_load_time", + "har", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PageLoadDetailTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "responseTime": obj.get("responseTime"), + "totalSize": obj.get("totalSize"), + "numObjects": obj.get("numObjects"), + "numErrors": obj.get("numErrors"), + "domLoadTime": obj.get("domLoadTime"), + "pageLoadTime": obj.get("pageLoadTime"), + "har": obj.get("har") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/page_load_detail_test_results.py b/test_results_api/test_results_api/models/page_load_detail_test_results.py new file mode 100644 index 00000000..682cda55 --- /dev/null +++ b/test_results_api/test_results_api/models/page_load_detail_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.page_load_detail_test_result import PageLoadDetailTestResult +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PageLoadDetailTestResults(BaseModel): + """ + PageLoadDetailTestResults + """ # noqa: E501 + results: Optional[List[PageLoadDetailTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 PageLoadDetailTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PageLoadDetailTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PageLoadDetailTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/page_load_test_result.py b/test_results_api/test_results_api/models/page_load_test_result.py new file mode 100644 index 00000000..9415e02d --- /dev/null +++ b/test_results_api/test_results_api/models/page_load_test_result.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +from test_results_api.models.agent import Agent +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PageLoadTestResult(BaseModel): + """ + PageLoadTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + agent: Optional[Agent] = None + response_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Time to first byte in milliseconds", alias="responseTime") + total_size: Optional[StrictInt] = Field(default=None, description="Sum of wire size of all objects on page in bytes", alias="totalSize") + num_objects: Optional[StrictInt] = Field(default=None, description="Number of objects found on the page", alias="numObjects") + num_errors: Optional[StrictInt] = Field(default=None, description="Number of objects which encountered errors during download", alias="numErrors") + dom_load_time: Optional[StrictInt] = Field(default=None, description="Time to interaction in milliseconds", alias="domLoadTime") + page_load_time: Optional[StrictInt] = Field(default=None, description="Time to completely load page in milliseconds", alias="pageLoadTime") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "agent", "responseTime", "totalSize", "numObjects", "numErrors", "domLoadTime", "pageLoadTime"] + + 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 PageLoadTestResult 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={ + "var_date", + "round_id", + "response_time", + "total_size", + "num_objects", + "num_errors", + "dom_load_time", + "page_load_time", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PageLoadTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "responseTime": obj.get("responseTime"), + "totalSize": obj.get("totalSize"), + "numObjects": obj.get("numObjects"), + "numErrors": obj.get("numErrors"), + "domLoadTime": obj.get("domLoadTime"), + "pageLoadTime": obj.get("pageLoadTime") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/page_load_test_results.py b/test_results_api/test_results_api/models/page_load_test_results.py new file mode 100644 index 00000000..a9cbdc43 --- /dev/null +++ b/test_results_api/test_results_api/models/page_load_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.page_load_test_result import PageLoadTestResult +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PageLoadTestResults(BaseModel): + """ + PageLoadTestResults + """ # noqa: E501 + results: Optional[List[PageLoadTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 PageLoadTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PageLoadTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PageLoadTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/pagination_links.py b/test_results_api/test_results_api/models/pagination_links.py new file mode 100644 index 00000000..81f9bc86 --- /dev/null +++ b/test_results_api/test_results_api/models/pagination_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.pagination_links_links import PaginationLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationLinks(BaseModel): + """ + A links object containing pagination related link(s). + """ # noqa: E501 + links: Optional[PaginationLinksLinks] = 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 PaginationLinks 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 PaginationLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": PaginationLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/pagination_links_links.py b/test_results_api/test_results_api/models/pagination_links_links.py new file mode 100644 index 00000000..c111b3a9 --- /dev/null +++ b/test_results_api/test_results_api/models/pagination_links_links.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationLinksLinks(BaseModel): + """ + PaginationLinksLinks + """ # noqa: E501 + previous: Optional[Link] = None + next: Optional[Link] = None + __properties: ClassVar[List[str]] = ["previous", "next"] + + 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 PaginationLinksLinks 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 previous + if self.previous: + _dict['previous'] = self.previous.to_dict() + # override the default output from pydantic by calling `to_dict()` of next + if self.next: + _dict['next'] = self.next.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PaginationLinksLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "previous": Link.from_dict(obj.get("previous")) if obj.get("previous") is not None else None, + "next": Link.from_dict(obj.get("next")) if obj.get("next") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/path_vis_base_test_result.py b/test_results_api/test_results_api/models/path_vis_base_test_result.py new file mode 100644 index 00000000..710baba6 --- /dev/null +++ b/test_results_api/test_results_api/models/path_vis_base_test_result.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +from test_results_api.models.test_direction import TestDirection +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisBaseTestResult(BaseModel): + """ + PathVisBaseTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") + end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") + agent: Optional[Agent] = None + server: Optional[StrictStr] = Field(default=None, description="Target server, including port (if method used is TCP)") + server_ip: Optional[StrictStr] = Field(default=None, description="IP of target server", alias="serverIp") + source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source agent", alias="sourceIp") + source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source agent", alias="sourcePrefix") + target_is_proxy: Optional[StrictBool] = Field(default=None, alias="targetIsProxy") + direction: Optional[TestDirection] = None + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "startTime", "endTime", "agent", "server", "serverIp", "sourceIp", "sourcePrefix", "targetIsProxy", "direction"] + + 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 PathVisBaseTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "var_date", + "round_id", + "start_time", + "end_time", + "server", + "server_ip", + "source_ip", + "source_prefix", + "target_is_proxy", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisBaseTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "startTime": obj.get("startTime"), + "endTime": obj.get("endTime"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "server": obj.get("server"), + "serverIp": obj.get("serverIp"), + "sourceIp": obj.get("sourceIp"), + "sourcePrefix": obj.get("sourcePrefix"), + "targetIsProxy": obj.get("targetIsProxy"), + "direction": obj.get("direction") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/path_vis_detail_test_result.py b/test_results_api/test_results_api/models/path_vis_detail_test_result.py new file mode 100644 index 00000000..27dae879 --- /dev/null +++ b/test_results_api/test_results_api/models/path_vis_detail_test_result.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +from test_results_api.models.path_vis_route import PathVisRoute +from test_results_api.models.test_direction import TestDirection +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisDetailTestResult(BaseModel): + """ + PathVisDetailTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") + end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") + agent: Optional[Agent] = None + server: Optional[StrictStr] = Field(default=None, description="Target server, including port (if method used is TCP)") + server_ip: Optional[StrictStr] = Field(default=None, description="IP of target server", alias="serverIp") + source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source agent", alias="sourceIp") + source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source agent", alias="sourcePrefix") + target_is_proxy: Optional[StrictBool] = Field(default=None, alias="targetIsProxy") + direction: Optional[TestDirection] = None + routes: Optional[List[PathVisRoute]] = Field(default=None, description="Shows 3 iterations of path trace, with each iteration specified by a pathId") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "startTime", "endTime", "agent", "server", "serverIp", "sourceIp", "sourcePrefix", "targetIsProxy", "direction", "routes"] + + 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 PathVisDetailTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "var_date", + "round_id", + "start_time", + "end_time", + "server", + "server_ip", + "source_ip", + "source_prefix", + "target_is_proxy", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in routes (list) + _items = [] + if self.routes: + for _item in self.routes: + if _item: + _items.append(_item.to_dict()) + _dict['routes'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisDetailTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "startTime": obj.get("startTime"), + "endTime": obj.get("endTime"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "server": obj.get("server"), + "serverIp": obj.get("serverIp"), + "sourceIp": obj.get("sourceIp"), + "sourcePrefix": obj.get("sourcePrefix"), + "targetIsProxy": obj.get("targetIsProxy"), + "direction": obj.get("direction"), + "routes": [PathVisRoute.from_dict(_item) for _item in obj.get("routes")] if obj.get("routes") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/path_vis_detail_test_results.py b/test_results_api/test_results_api/models/path_vis_detail_test_results.py new file mode 100644 index 00000000..8d96b22c --- /dev/null +++ b/test_results_api/test_results_api/models/path_vis_detail_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.path_vis_detail_test_result import PathVisDetailTestResult +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisDetailTestResults(BaseModel): + """ + PathVisDetailTestResults + """ # noqa: E501 + results: Optional[List[PathVisDetailTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 PathVisDetailTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisDetailTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisDetailTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/path_vis_endpoint.py b/test_results_api/test_results_api/models/path_vis_endpoint.py new file mode 100644 index 00000000..834ce904 --- /dev/null +++ b/test_results_api/test_results_api/models/path_vis_endpoint.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 PathVisEndpoint(BaseModel): + """ + PathVisEndpoint + """ # noqa: E501 + ip_address: Optional[StrictStr] = Field(default=None, description="IP address of the hop", alias="ipAddress") + mss: Optional[StrictInt] = Field(default=None, description="Maximum segment size in bytes") + number_of_hops: Optional[StrictInt] = Field(default=None, description="Number of hops for path trace to destination", alias="numberOfHops") + path_id: Optional[StrictStr] = Field(default=None, description="Unique ID of path trace", alias="pathId") + path_mtu: Optional[StrictStr] = Field(default=None, description="Location information for the hop", alias="pathMtu") + response_time: Optional[StrictInt] = Field(default=None, description="RTT of the path trace to the destination in milliseconds", alias="responseTime") + __properties: ClassVar[List[str]] = ["ipAddress", "mss", "numberOfHops", "pathId", "pathMtu", "responseTime"] + + 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 PathVisEndpoint 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "ip_address", + "mss", + "number_of_hops", + "path_id", + "path_mtu", + "response_time", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisEndpoint from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ipAddress": obj.get("ipAddress"), + "mss": obj.get("mss"), + "numberOfHops": obj.get("numberOfHops"), + "pathId": obj.get("pathId"), + "pathMtu": obj.get("pathMtu"), + "responseTime": obj.get("responseTime") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/path_vis_hop.py b/test_results_api/test_results_api/models/path_vis_hop.py new file mode 100644 index 00000000..c3ff44ee --- /dev/null +++ b/test_results_api/test_results_api/models/path_vis_hop.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 PathVisHop(BaseModel): + """ + PathVisHop + """ # noqa: E501 + hop: Optional[StrictInt] = Field(default=None, description="Hop index") + ip_address: Optional[StrictStr] = Field(default=None, description="IP address of the hop", alias="ipAddress") + prefix: Optional[StrictStr] = Field(default=None, description="Prefix of IP address shown in CIDR") + rdns: Optional[StrictStr] = Field(default=None, description="Reverse DNS entry of IP, if available") + network: Optional[StrictStr] = Field(default=None, description="Autonomous System originating the prefix") + response_time: Optional[StrictInt] = Field(default=None, description="RTT to the hop’s IP in milliseconds", alias="responseTime") + location: Optional[StrictStr] = Field(default=None, description="Location information for the hop") + mpls: Optional[StrictStr] = Field(default=None, description="Multiprotocol Label Switching information, if available") + __properties: ClassVar[List[str]] = ["hop", "ipAddress", "prefix", "rdns", "network", "responseTime", "location", "mpls"] + + 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 PathVisHop 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={ + "hop", + "ip_address", + "prefix", + "rdns", + "network", + "response_time", + "location", + "mpls", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisHop from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "hop": obj.get("hop"), + "ipAddress": obj.get("ipAddress"), + "prefix": obj.get("prefix"), + "rdns": obj.get("rdns"), + "network": obj.get("network"), + "responseTime": obj.get("responseTime"), + "location": obj.get("location"), + "mpls": obj.get("mpls") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/path_vis_route.py b/test_results_api/test_results_api/models/path_vis_route.py new file mode 100644 index 00000000..d31594fd --- /dev/null +++ b/test_results_api/test_results_api/models/path_vis_route.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.path_vis_hop import PathVisHop +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisRoute(BaseModel): + """ + PathVisRoute + """ # noqa: E501 + path_id: Optional[StrictStr] = Field(default=None, description="Unique ID of path trace", alias="pathId") + hops: Optional[List[PathVisHop]] = Field(default=None, description="Array of hop objects indicating each step in the traceroute") + __properties: ClassVar[List[str]] = ["pathId", "hops"] + + 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 PathVisRoute 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={ + "path_id", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in hops (list) + _items = [] + if self.hops: + for _item in self.hops: + if _item: + _items.append(_item.to_dict()) + _dict['hops'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisRoute from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pathId": obj.get("pathId"), + "hops": [PathVisHop.from_dict(_item) for _item in obj.get("hops")] if obj.get("hops") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/path_vis_test_result.py b/test_results_api/test_results_api/models/path_vis_test_result.py new file mode 100644 index 00000000..c7cce9fe --- /dev/null +++ b/test_results_api/test_results_api/models/path_vis_test_result.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +from test_results_api.models.path_vis_endpoint import PathVisEndpoint +from test_results_api.models.test_direction import TestDirection +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisTestResult(BaseModel): + """ + PathVisTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") + end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") + agent: Optional[Agent] = None + server: Optional[StrictStr] = Field(default=None, description="Target server, including port (if method used is TCP)") + server_ip: Optional[StrictStr] = Field(default=None, description="IP of target server", alias="serverIp") + source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source agent", alias="sourceIp") + source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source agent", alias="sourcePrefix") + target_is_proxy: Optional[StrictBool] = Field(default=None, alias="targetIsProxy") + direction: Optional[TestDirection] = None + endpoints: Optional[List[PathVisEndpoint]] = Field(default=None, description="Shows all iterations of path trace, with each iteration specified by a pathId") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "startTime", "endTime", "agent", "server", "serverIp", "sourceIp", "sourcePrefix", "targetIsProxy", "direction", "endpoints"] + + 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 PathVisTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "var_date", + "round_id", + "start_time", + "end_time", + "server", + "server_ip", + "source_ip", + "source_prefix", + "target_is_proxy", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in endpoints (list) + _items = [] + if self.endpoints: + for _item in self.endpoints: + if _item: + _items.append(_item.to_dict()) + _dict['endpoints'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "startTime": obj.get("startTime"), + "endTime": obj.get("endTime"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "server": obj.get("server"), + "serverIp": obj.get("serverIp"), + "sourceIp": obj.get("sourceIp"), + "sourcePrefix": obj.get("sourcePrefix"), + "targetIsProxy": obj.get("targetIsProxy"), + "direction": obj.get("direction"), + "endpoints": [PathVisEndpoint.from_dict(_item) for _item in obj.get("endpoints")] if obj.get("endpoints") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/path_vis_test_results.py b/test_results_api/test_results_api/models/path_vis_test_results.py new file mode 100644 index 00000000..f764bbfb --- /dev/null +++ b/test_results_api/test_results_api/models/path_vis_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.path_vis_test_result import PathVisTestResult +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PathVisTestResults(BaseModel): + """ + PathVisTestResults + """ # noqa: E501 + results: Optional[List[PathVisTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 PathVisTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PathVisTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/query_window.py b/test_results_api/test_results_api/models/query_window.py new file mode 100644 index 00000000..c68faf04 --- /dev/null +++ b/test_results_api/test_results_api/models/query_window.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class QueryWindow(BaseModel): + """ + QueryWindow + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + __properties: ClassVar[List[str]] = ["startDate", "endDate"] + + 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 QueryWindow 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={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of QueryWindow from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/rtp_stream_test_result.py b/test_results_api/test_results_api/models/rtp_stream_test_result.py new file mode 100644 index 00000000..1f525ec4 --- /dev/null +++ b/test_results_api/test_results_api/models/rtp_stream_test_result.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RtpStreamTestResult(BaseModel): + """ + RtpStreamTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + agent: Optional[Agent] = None + server_ip: Optional[StrictStr] = Field(default=None, description="Target agent IP address", alias="serverIp") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP value received by the server from the agent") + dscp_name: Optional[StrictStr] = Field(default=None, description="Name of DSCP value received by the server from the agent", alias="dscpName") + mos: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Mean opinion score for agent’s stream") + codec_name: Optional[StrictStr] = Field(default=None, description="Name of codec used by agen", alias="codecName") + codec_max_mos: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum value of Mean Opinion Score based on codec selection", alias="codecMaxMos") + loss: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percentage value of packets sent from agent not received by server") + discards: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percentage of packets discarded") + latency: Optional[StrictInt] = Field(default=None, description="Time to send packets from source to server in milliseconds") + pdv: Optional[StrictInt] = Field(default=None, description="Variation in packet delay in milliseconds") + error_detail: Optional[StrictStr] = Field(default=None, description="Error details, if an error was encountered", alias="errorDetail") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "agent", "serverIp", "dscp", "dscpName", "mos", "codecName", "codecMaxMos", "loss", "discards", "latency", "pdv", "errorDetail"] + + 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 RtpStreamTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "var_date", + "round_id", + "server_ip", + "dscp", + "dscp_name", + "mos", + "codec_name", + "codec_max_mos", + "loss", + "discards", + "latency", + "pdv", + "error_detail", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RtpStreamTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "serverIp": obj.get("serverIp"), + "dscp": obj.get("dscp"), + "dscpName": obj.get("dscpName"), + "mos": obj.get("mos"), + "codecName": obj.get("codecName"), + "codecMaxMos": obj.get("codecMaxMos"), + "loss": obj.get("loss"), + "discards": obj.get("discards"), + "latency": obj.get("latency"), + "pdv": obj.get("pdv"), + "errorDetail": obj.get("errorDetail") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/rtp_stream_test_results.py b/test_results_api/test_results_api/models/rtp_stream_test_results.py new file mode 100644 index 00000000..6cd0ad1e --- /dev/null +++ b/test_results_api/test_results_api/models/rtp_stream_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.rtp_stream_test_result import RtpStreamTestResult +from test_results_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RtpStreamTestResults(BaseModel): + """ + RtpStreamTestResults + """ # noqa: E501 + results: Optional[List[RtpStreamTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 RtpStreamTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of RtpStreamTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [RtpStreamTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/self_links.py b/test_results_api/test_results_api/models/self_links.py new file mode 100644 index 00000000..4b02e080 --- /dev/null +++ b/test_results_api/test_results_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_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 + + diff --git a/test_results_api/test_results_api/models/self_links_links.py b/test_results_api/test_results_api/models/self_links_links.py new file mode 100644 index 00000000..545ba627 --- /dev/null +++ b/test_results_api/test_results_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_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 + + diff --git a/test_results_api/test_results_api/models/simple_test.py b/test_results_api/test_results_api/models/simple_test.py new file mode 100644 index 00000000..c31e9e54 --- /dev/null +++ b/test_results_api/test_results_api/models/simple_test.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.test_interval import TestInterval +from test_results_api.models.test_type import TestType +from test_results_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 + + diff --git a/test_results_api/test_results_api/models/sip_server_error_type.py b/test_results_api/test_results_api/models/sip_server_error_type.py new file mode 100644 index 00000000..b590e9e8 --- /dev/null +++ b/test_results_api/test_results_api/models/sip_server_error_type.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 SipServerErrorType(str, Enum): + """ + Error type, none if there is no error + """ + + """ + allowed enum values + """ + NONE = 'none' + DNS = 'dns' + CONNECT = 'connect' + REGISTER = 'register' + INVITE = 'invite' + OPTION = 'option' + SERVER = 'server' + SSL = 'ssl' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SipServerErrorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/test_results_api/test_results_api/models/sip_server_test_result.py b/test_results_api/test_results_api/models/sip_server_test_result.py new file mode 100644 index 00000000..2a5ac099 --- /dev/null +++ b/test_results_api/test_results_api/models/sip_server_test_result.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +from test_results_api.models.sip_server_error_type import SipServerErrorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SipServerTestResult(BaseModel): + """ + SipServerTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + server_ip: Optional[StrictStr] = Field(default=None, description="Target agent IP address", alias="serverIp") + agent: Optional[Agent] = None + availability: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="availability of the service") + connect_time: Optional[StrictInt] = Field(default=None, description="Time required to establish a TCP connection to the server in milliseconds, only available when TCP is configured as protocol", alias="connectTime") + dns_time: Optional[StrictInt] = Field(default=None, description="Time required to resolve DNS in milliseconds", alias="dnsTime") + invite_time: Optional[StrictInt] = Field(default=None, description="Time to complete INVITE in milliseconds", alias="inviteTime") + options_time: Optional[StrictInt] = Field(default=None, description="Time to complete OPTIONS in milliseconds", alias="optionsTime") + num_redirects: Optional[StrictInt] = Field(default=None, description="Number of redirects", alias="numRedirects") + options_request: Optional[StrictStr] = Field(default=None, description="Entire OPTIONS request", alias="optionsRequest") + options_response: Optional[StrictStr] = Field(default=None, description="Entire OPTIONS response", alias="optionsResponse") + register_time: Optional[StrictInt] = Field(default=None, description="Time to complete REGISTER in milliseconds", alias="registerTime") + response_code: Optional[StrictInt] = Field(default=None, description="SIP server response code", alias="responseCode") + response_time: Optional[StrictInt] = Field(default=None, description="Time to first byte", alias="responseTime") + total_time: Optional[StrictInt] = Field(default=None, description="Total time", alias="totalTime") + wait_time: Optional[StrictInt] = Field(default=None, description="Time elapsed between completion of request and first byte of response", alias="waitTime") + error_type: Optional[SipServerErrorType] = Field(default=None, alias="errorType") + problem_detail: Optional[StrictStr] = Field(default=None, description="Error details, if an error was encountered", alias="problemDetail") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "serverIp", "agent", "availability", "connectTime", "dnsTime", "inviteTime", "optionsTime", "numRedirects", "optionsRequest", "optionsResponse", "registerTime", "responseCode", "responseTime", "totalTime", "waitTime", "errorType", "problemDetail"] + + 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 SipServerTestResult 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. + * OpenAPI `readOnly` fields are excluded. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "var_date", + "round_id", + "server_ip", + "availability", + "connect_time", + "dns_time", + "invite_time", + "options_time", + "num_redirects", + "options_request", + "options_response", + "register_time", + "response_code", + "response_time", + "total_time", + "wait_time", + "problem_detail", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SipServerTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "serverIp": obj.get("serverIp"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "availability": obj.get("availability"), + "connectTime": obj.get("connectTime"), + "dnsTime": obj.get("dnsTime"), + "inviteTime": obj.get("inviteTime"), + "optionsTime": obj.get("optionsTime"), + "numRedirects": obj.get("numRedirects"), + "optionsRequest": obj.get("optionsRequest"), + "optionsResponse": obj.get("optionsResponse"), + "registerTime": obj.get("registerTime"), + "responseCode": obj.get("responseCode"), + "responseTime": obj.get("responseTime"), + "totalTime": obj.get("totalTime"), + "waitTime": obj.get("waitTime"), + "errorType": obj.get("errorType"), + "problemDetail": obj.get("problemDetail") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/sip_server_test_results.py b/test_results_api/test_results_api/models/sip_server_test_results.py new file mode 100644 index 00000000..2522d7ee --- /dev/null +++ b/test_results_api/test_results_api/models/sip_server_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.simple_test import SimpleTest +from test_results_api.models.sip_server_test_result import SipServerTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SipServerTestResults(BaseModel): + """ + SipServerTestResults + """ # noqa: E501 + results: Optional[List[SipServerTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 SipServerTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SipServerTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [SipServerTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/ssl_cert.py b/test_results_api/test_results_api/models/ssl_cert.py new file mode 100644 index 00000000..86f39c2a --- /dev/null +++ b/test_results_api/test_results_api/models/ssl_cert.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SslCert(BaseModel): + """ + SslCert + """ # noqa: E501 + days_until_expiry: Optional[StrictInt] = Field(default=None, description="Days until certificate expires, rounded down. 0 is shown if there are less than 24 hours remaining. Calculated when the test was executed.", alias="daysUntilExpiry") + is_fetch_date_in_valid_cert_date_range: Optional[StrictStr] = Field(default=None, description="True when certificate fetch date is within the valid certificate date range, false otherwise", alias="isFetchDateInValidCertDateRange") + has_valid_signing_cert: Optional[StrictStr] = Field(default=None, description="This field is implicitly true; it is output only when false. false indicates this certificate was missing a valid signing certificate in the chain.", alias="hasValidSigningCert") + issuer_name: Optional[StrictStr] = Field(default=None, description="Certificate issuer", alias="issuerName") + valid_before: Optional[datetime] = Field(default=None, description="Certificate is not valid after this date", alias="validBefore") + valid_after: Optional[datetime] = Field(default=None, description="Certificate is not valid before this date", alias="validAfter") + subject_alternative_names: Optional[List[StrictStr]] = Field(default=None, description="Alternative name(s) of the certificate subject, extracted from the Subject Alternative Name (SAN) X.509 certificate extension, for example example.com, www2.example.com", alias="subjectAlternativeNames") + subject_name: Optional[StrictStr] = Field(default=None, description="certificate’s subject name - a value of the common name (CN) RDN from the certificate’s Subject attribute, for example www.example.com", alias="subjectName") + __properties: ClassVar[List[str]] = ["daysUntilExpiry", "isFetchDateInValidCertDateRange", "hasValidSigningCert", "issuerName", "validBefore", "validAfter", "subjectAlternativeNames", "subjectName"] + + 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 SslCert 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 SslCert from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "daysUntilExpiry": obj.get("daysUntilExpiry"), + "isFetchDateInValidCertDateRange": obj.get("isFetchDateInValidCertDateRange"), + "hasValidSigningCert": obj.get("hasValidSigningCert"), + "issuerName": obj.get("issuerName"), + "validBefore": obj.get("validBefore"), + "validAfter": obj.get("validAfter"), + "subjectAlternativeNames": obj.get("subjectAlternativeNames"), + "subjectName": obj.get("subjectName") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/test_direction.py b/test_results_api/test_results_api/models/test_direction.py new file mode 100644 index 00000000..1945b73e --- /dev/null +++ b/test_results_api/test_results_api/models/test_direction.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 TestDirection(str, Enum): + """ + Direction of the test, which affects how results are shown. + """ + + """ + allowed enum values + """ + TO_MINUS_TARGET = 'to-target' + FROM_MINUS_TARGET = 'from-target' + BIDIRECTIONAL = 'bidirectional' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestDirection from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/test_results_api/test_results_api/models/test_interval.py b/test_results_api/test_results_api/models/test_interval.py new file mode 100644 index 00000000..eb3b527a --- /dev/null +++ b/test_results_api/test_results_api/models/test_interval.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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)) + + diff --git a/test_results_api/test_results_api/models/test_result.py b/test_results_api/test_results_api/models/test_result.py new file mode 100644 index 00000000..2422f92e --- /dev/null +++ b/test_results_api/test_results_api/models/test_result.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictInt +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestResult(BaseModel): + """ + TestResult + """ # noqa: E501 + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + __properties: ClassVar[List[str]] = ["_links", "date", "roundId"] + + 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 TestResult 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={ + "var_date", + "round_id", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of TestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": obj.get("_links"), + "date": obj.get("date"), + "roundId": obj.get("roundId") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/test_result_app_links.py b/test_results_api/test_results_api/models/test_result_app_links.py new file mode 100644 index 00000000..97674850 --- /dev/null +++ b/test_results_api/test_results_api/models/test_result_app_links.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestResultAppLinks(BaseModel): + """ + TestResultAppLinks + """ # noqa: E501 + links: Optional[Any] = 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 TestResultAppLinks 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, + ) + # set to None if links (nullable) is None + # and model_fields_set contains the field + if self.links is None and "links" in self.model_fields_set: + _dict['_links'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of TestResultAppLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": obj.get("_links") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/test_type.py b/test_results_api/test_results_api/models/test_type.py new file mode 100644 index 00000000..d5387473 --- /dev/null +++ b/test_results_api/test_results_api/models/test_type.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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)) + + diff --git a/test_results_api/test_results_api/models/unauthorized_error.py b/test_results_api/test_results_api/models/unauthorized_error.py new file mode 100644 index 00000000..9bcb49b0 --- /dev/null +++ b/test_results_api/test_results_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 + + diff --git a/test_results_api/test_results_api/models/unexpanded_instant_test.py b/test_results_api/test_results_api/models/unexpanded_instant_test.py new file mode 100644 index 00000000..5cc41002 --- /dev/null +++ b/test_results_api/test_results_api/models/unexpanded_instant_test.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.test_type import TestType +from test_results_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 + + diff --git a/test_results_api/test_results_api/models/unexpanded_instant_test_links.py b/test_results_api/test_results_api/models/unexpanded_instant_test_links.py new file mode 100644 index 00000000..4a24e5cd --- /dev/null +++ b/test_results_api/test_results_api/models/unexpanded_instant_test_links.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf +from test_results_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 + + diff --git a/test_results_api/test_results_api/models/unexpanded_instant_test_links_self.py b/test_results_api/test_results_api/models/unexpanded_instant_test_links_self.py new file mode 100644 index 00000000..6db102dd --- /dev/null +++ b/test_results_api/test_results_api/models/unexpanded_instant_test_links_self.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 + + diff --git a/test_results_api/test_results_api/models/unexpanded_instant_test_links_test_results.py b/test_results_api/test_results_api/models/unexpanded_instant_test_links_test_results.py new file mode 100644 index 00000000..15ce5d8e --- /dev/null +++ b/test_results_api/test_results_api/models/unexpanded_instant_test_links_test_results.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_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()) + + diff --git a/test_results_api/test_results_api/models/unexpanded_test.py b/test_results_api/test_results_api/models/unexpanded_test.py new file mode 100644 index 00000000..9ae6a898 --- /dev/null +++ b/test_results_api/test_results_api/models/unexpanded_test.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_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 + + diff --git a/test_results_api/test_results_api/models/web_transaction_detail_test_result.py b/test_results_api/test_results_api/models/web_transaction_detail_test_result.py new file mode 100644 index 00000000..b68449ee --- /dev/null +++ b/test_results_api/test_results_api/models/web_transaction_detail_test_result.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +from test_results_api.models.marker import Marker +from test_results_api.models.page import Page +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class WebTransactionDetailTestResult(BaseModel): + """ + WebTransactionDetailTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + agent: Optional[Agent] = None + component_errors: Optional[StrictInt] = Field(default=None, description="Number of components which did not successfully load", alias="componentErrors") + transaction_time: Optional[StrictInt] = Field(default=None, description="Elapsed execution time of the web transaction script in milliseconds", alias="transactionTime") + error_type: Optional[StrictStr] = Field(default=None, description="Type of error encountered; corresponds to phase of connection", alias="errorType") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error were encountered", alias="errorDetails") + markers: Optional[List[Marker]] = None + pages: Optional[List[Page]] = None + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "agent", "componentErrors", "transactionTime", "errorType", "errorDetails", "markers", "pages"] + + 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 WebTransactionDetailTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "var_date", + "round_id", + "component_errors", + "transaction_time", + "error_type", + "error_details", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in markers (list) + _items = [] + if self.markers: + for _item in self.markers: + if _item: + _items.append(_item.to_dict()) + _dict['markers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in pages (list) + _items = [] + if self.pages: + for _item in self.pages: + if _item: + _items.append(_item.to_dict()) + _dict['pages'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of WebTransactionDetailTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "componentErrors": obj.get("componentErrors"), + "transactionTime": obj.get("transactionTime"), + "errorType": obj.get("errorType"), + "errorDetails": obj.get("errorDetails"), + "markers": [Marker.from_dict(_item) for _item in obj.get("markers")] if obj.get("markers") is not None else None, + "pages": [Page.from_dict(_item) for _item in obj.get("pages")] if obj.get("pages") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/web_transaction_detail_test_results.py b/test_results_api/test_results_api/models/web_transaction_detail_test_results.py new file mode 100644 index 00000000..c56c401e --- /dev/null +++ b/test_results_api/test_results_api/models/web_transaction_detail_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.simple_test import SimpleTest +from test_results_api.models.web_transaction_detail_test_result import WebTransactionDetailTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class WebTransactionDetailTestResults(BaseModel): + """ + WebTransactionDetailTestResults + """ # noqa: E501 + results: Optional[List[WebTransactionDetailTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 WebTransactionDetailTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of WebTransactionDetailTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [WebTransactionDetailTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/web_transaction_page_detail_test_result.py b/test_results_api/test_results_api/models/web_transaction_page_detail_test_result.py new file mode 100644 index 00000000..d69fad45 --- /dev/null +++ b/test_results_api/test_results_api/models/web_transaction_page_detail_test_result.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +from test_results_api.models.marker import Marker +from test_results_api.models.page import Page +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class WebTransactionPageDetailTestResult(BaseModel): + """ + WebTransactionPageDetailTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + agent: Optional[Agent] = None + component_errors: Optional[StrictInt] = Field(default=None, description="Number of components which did not successfully load", alias="componentErrors") + transaction_time: Optional[StrictInt] = Field(default=None, description="Elapsed execution time of the web transaction script in milliseconds", alias="transactionTime") + error_type: Optional[StrictStr] = Field(default=None, description="Type of error encountered; corresponds to phase of connection", alias="errorType") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error were encountered", alias="errorDetails") + markers: Optional[List[Marker]] = None + pages: Optional[List[Page]] = None + har: Optional[Union[str, Any]] = Field(default=None, description="See [HAR specification](http://www.softwareishard.com/blog/har-12-spec/) for details") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "agent", "componentErrors", "transactionTime", "errorType", "errorDetails", "markers", "pages", "har"] + + 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 WebTransactionPageDetailTestResult 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={ + "var_date", + "round_id", + "component_errors", + "transaction_time", + "error_type", + "error_details", + "har", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in markers (list) + _items = [] + if self.markers: + for _item in self.markers: + if _item: + _items.append(_item.to_dict()) + _dict['markers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in pages (list) + _items = [] + if self.pages: + for _item in self.pages: + if _item: + _items.append(_item.to_dict()) + _dict['pages'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of WebTransactionPageDetailTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "componentErrors": obj.get("componentErrors"), + "transactionTime": obj.get("transactionTime"), + "errorType": obj.get("errorType"), + "errorDetails": obj.get("errorDetails"), + "markers": [Marker.from_dict(_item) for _item in obj.get("markers")] if obj.get("markers") is not None else None, + "pages": [Page.from_dict(_item) for _item in obj.get("pages")] if obj.get("pages") is not None else None, + "har": obj.get("har") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/web_transaction_page_detail_test_results.py b/test_results_api/test_results_api/models/web_transaction_page_detail_test_results.py new file mode 100644 index 00000000..de4e58ae --- /dev/null +++ b/test_results_api/test_results_api/models/web_transaction_page_detail_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.simple_test import SimpleTest +from test_results_api.models.web_transaction_page_detail_test_result import WebTransactionPageDetailTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class WebTransactionPageDetailTestResults(BaseModel): + """ + WebTransactionPageDetailTestResults + """ # noqa: E501 + results: Optional[List[WebTransactionPageDetailTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 WebTransactionPageDetailTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of WebTransactionPageDetailTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [WebTransactionPageDetailTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/web_transaction_test_result.py b/test_results_api/test_results_api/models/web_transaction_test_result.py new file mode 100644 index 00000000..051b58dd --- /dev/null +++ b/test_results_api/test_results_api/models/web_transaction_test_result.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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, Union +from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import Field +from test_results_api.models.agent import Agent +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class WebTransactionTestResult(BaseModel): + """ + WebTransactionTestResult + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") + links: Optional[Union[str, Any]] = Field(default=None, alias="_links") + agent: Optional[Agent] = None + component_errors: Optional[StrictInt] = Field(default=None, description="Number of components which did not successfully load", alias="componentErrors") + transaction_time: Optional[StrictInt] = Field(default=None, description="Elapsed execution time of the web transaction script in milliseconds", alias="transactionTime") + error_type: Optional[StrictStr] = Field(default=None, description="Type of error encountered; corresponds to phase of connection", alias="errorType") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error were encountered", alias="errorDetails") + __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "agent", "componentErrors", "transactionTime", "errorType", "errorDetails"] + + 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 WebTransactionTestResult 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "var_date", + "round_id", + "component_errors", + "transaction_time", + "error_type", + "error_details", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of WebTransactionTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "roundId": obj.get("roundId"), + "_links": obj.get("_links"), + "agent": Agent.from_dict(obj.get("agent")) if obj.get("agent") is not None else None, + "componentErrors": obj.get("componentErrors"), + "transactionTime": obj.get("transactionTime"), + "errorType": obj.get("errorType"), + "errorDetails": obj.get("errorDetails") + }) + return _obj + + diff --git a/test_results_api/test_results_api/models/web_transaction_test_results.py b/test_results_api/test_results_api/models/web_transaction_test_results.py new file mode 100644 index 00000000..7bb9bb33 --- /dev/null +++ b/test_results_api/test_results_api/models/web_transaction_test_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_api.models.simple_test import SimpleTest +from test_results_api.models.web_transaction_test_result import WebTransactionTestResult +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class WebTransactionTestResults(BaseModel): + """ + WebTransactionTestResults + """ # noqa: E501 + results: Optional[List[WebTransactionTestResult]] = None + test: Optional[SimpleTest] = None + __properties: ClassVar[List[str]] = ["results", "test"] + + 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 WebTransactionTestResults 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 results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of WebTransactionTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [WebTransactionTestResult.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + "test": SimpleTest.from_dict(obj.get("test")) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/test_results_api/test_results_api/py.typed b/test_results_api/test_results_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/test_results_api/test_results_api/rest.py b/test_results_api/test_results_api/rest.py new file mode 100644 index 00000000..21646dd3 --- /dev/null +++ b/test_results_api/test_results_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + 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 test_results_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) diff --git a/test_results_api/tox.ini b/test_results_api/tox.ini new file mode 100644 index 00000000..a8148126 --- /dev/null +++ b/test_results_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=test_results_api diff --git a/test_templates_api/.github/workflows/python.yml b/test_templates_api/.github/workflows/python.yml new file mode 100644 index 00000000..abf80d0f --- /dev/null +++ b/test_templates_api/.github/workflows/python.yml @@ -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: test_templates_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 diff --git a/test_templates_api/.gitignore b/test_templates_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/test_templates_api/.gitignore @@ -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 diff --git a/test_templates_api/.gitlab-ci.yml b/test_templates_api/.gitlab-ci.yml new file mode 100644 index 00000000..009f493e --- /dev/null +++ b/test_templates_api/.gitlab-ci.yml @@ -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=test_templates_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 diff --git a/test_templates_api/.openapi-generator-ignore b/test_templates_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/test_templates_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/test_templates_api/.openapi-generator/FILES b/test_templates_api/.openapi-generator/FILES new file mode 100644 index 00000000..1408a5c0 --- /dev/null +++ b/test_templates_api/.openapi-generator/FILES @@ -0,0 +1,77 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/ApiError.md +docs/BadRequestError.md +docs/DeployTestTemplate.md +docs/DeployTestTemplateTests.md +docs/DeployTestTemplateUserInputValues.md +docs/DeploymentStrategy.md +docs/Link.md +docs/NotFoundError.md +docs/TestTemplate.md +docs/TestTemplateCollection.md +docs/TestTemplateCollectionLinks.md +docs/TestTemplateCollectionLinksSelf.md +docs/TestTemplateEndpointsApi.md +docs/TestTemplateUpsert.md +docs/UnauthorizedError.md +docs/UserInput.md +docs/UserInputDefaultValue.md +docs/UserInputType.md +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_api_error.py +test/test_bad_request_error.py +test/test_deploy_test_template.py +test/test_deploy_test_template_tests.py +test/test_deploy_test_template_user_input_values.py +test/test_deployment_strategy.py +test/test_link.py +test/test_not_found_error.py +test/test_test_template.py +test/test_test_template_collection.py +test/test_test_template_collection_links.py +test/test_test_template_collection_links_self.py +test/test_test_template_endpoints_api.py +test/test_test_template_upsert.py +test/test_unauthorized_error.py +test/test_user_input.py +test/test_user_input_default_value.py +test/test_user_input_type.py +test_templates_api/__init__.py +test_templates_api/api/__init__.py +test_templates_api/api/test_template_endpoints_api.py +test_templates_api/api_client.py +test_templates_api/api_response.py +test_templates_api/configuration.py +test_templates_api/exceptions.py +test_templates_api/models/__init__.py +test_templates_api/models/api_error.py +test_templates_api/models/bad_request_error.py +test_templates_api/models/deploy_test_template.py +test_templates_api/models/deploy_test_template_tests.py +test_templates_api/models/deploy_test_template_user_input_values.py +test_templates_api/models/deployment_strategy.py +test_templates_api/models/link.py +test_templates_api/models/not_found_error.py +test_templates_api/models/test_template.py +test_templates_api/models/test_template_collection.py +test_templates_api/models/test_template_collection_links.py +test_templates_api/models/test_template_collection_links_self.py +test_templates_api/models/test_template_upsert.py +test_templates_api/models/unauthorized_error.py +test_templates_api/models/user_input.py +test_templates_api/models/user_input_default_value.py +test_templates_api/models/user_input_type.py +test_templates_api/py.typed +test_templates_api/rest.py +tox.ini diff --git a/test_templates_api/.openapi-generator/VERSION b/test_templates_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/test_templates_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/test_templates_api/.travis.yml b/test_templates_api/.travis.yml new file mode 100644 index 00000000..4133fed3 --- /dev/null +++ b/test_templates_api/.travis.yml @@ -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=test_templates_api diff --git a/test_templates_api/README.md b/test_templates_api/README.md new file mode 100644 index 00000000..f430bcff --- /dev/null +++ b/test_templates_api/README.md @@ -0,0 +1,167 @@ +# test-templates-api + +## Overview + +Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. + + +The following applies to test templates: + +* You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. + +* Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. + +* Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. + +* Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). + +* The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. + +* To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: + + 1. Labels + 2. Tests + 3. Alert rules + 4. Dashboards + + For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 7.0.1 +- 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 test_templates_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 test_templates_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 test_templates_api +from test_templates_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 = test_templates_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 = test_templates_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with test_templates_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_templates_api.TestTemplateEndpointsApi(api_client) + test_template_upsert = test_templates_api.TestTemplateUpsert() # TestTemplateUpsert | The test template to create or update. + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create a test template. + api_response = api_instance.create_test_template(test_template_upsert, aid=aid) + print("The response of TestTemplateEndpointsApi->create_test_template:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling TestTemplateEndpointsApi->create_test_template: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*TestTemplateEndpointsApi* | [**create_test_template**](docs/TestTemplateEndpointsApi.md#create_test_template) | **POST** /v7/tests/templates | Create a test template. +*TestTemplateEndpointsApi* | [**delete_test_template**](docs/TestTemplateEndpointsApi.md#delete_test_template) | **DELETE** /v7/tests/templates/{id} | Delete a test template +*TestTemplateEndpointsApi* | [**deploy_user_template**](docs/TestTemplateEndpointsApi.md#deploy_user_template) | **POST** /v7/tests/templates/{id}/deploy | Deploy a test template. +*TestTemplateEndpointsApi* | [**get_user_org_test_template**](docs/TestTemplateEndpointsApi.md#get_user_org_test_template) | **GET** /v7/tests/templates/{id} | Retrieve a test template +*TestTemplateEndpointsApi* | [**get_user_org_test_templates**](docs/TestTemplateEndpointsApi.md#get_user_org_test_templates) | **GET** /v7/tests/templates | List all test templates. +*TestTemplateEndpointsApi* | [**update_test_template**](docs/TestTemplateEndpointsApi.md#update_test_template) | **PUT** /v7/tests/templates/{id} | Update a test template + + +## Documentation For Models + + - [ApiError](docs/ApiError.md) + - [BadRequestError](docs/BadRequestError.md) + - [DeployTestTemplate](docs/DeployTestTemplate.md) + - [DeployTestTemplateTests](docs/DeployTestTemplateTests.md) + - [DeployTestTemplateUserInputValues](docs/DeployTestTemplateUserInputValues.md) + - [DeploymentStrategy](docs/DeploymentStrategy.md) + - [Link](docs/Link.md) + - [NotFoundError](docs/NotFoundError.md) + - [TestTemplate](docs/TestTemplate.md) + - [TestTemplateCollection](docs/TestTemplateCollection.md) + - [TestTemplateCollectionLinks](docs/TestTemplateCollectionLinks.md) + - [TestTemplateCollectionLinksSelf](docs/TestTemplateCollectionLinksSelf.md) + - [TestTemplateUpsert](docs/TestTemplateUpsert.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + - [UserInput](docs/UserInput.md) + - [UserInputDefaultValue](docs/UserInputDefaultValue.md) + - [UserInputType](docs/UserInputType.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/test_templates_api/docs/ApiError.md b/test_templates_api/docs/ApiError.md new file mode 100644 index 00000000..ce16f06d --- /dev/null +++ b/test_templates_api/docs/ApiError.md @@ -0,0 +1,29 @@ +# ApiError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | [optional] +**errors** | **List[str]** | | [optional] + +## Example + +```python +from test_templates_api.models.api_error import ApiError + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiError from a JSON string +api_error_instance = ApiError.from_json(json) +# print the JSON string representation of the object +print ApiError.to_json() + +# convert the object into a dict +api_error_dict = api_error_instance.to_dict() +# create an instance of ApiError from a dict +api_error_form_dict = api_error.from_dict(api_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/BadRequestError.md b/test_templates_api/docs/BadRequestError.md new file mode 100644 index 00000000..7d5f2ca7 --- /dev/null +++ b/test_templates_api/docs/BadRequestError.md @@ -0,0 +1,31 @@ +# BadRequestError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | | [optional] +**status** | **int** | | [optional] +**error** | **str** | | [optional] +**path** | **str** | | [optional] + +## Example + +```python +from test_templates_api.models.bad_request_error import BadRequestError + +# TODO update the JSON string below +json = "{}" +# create an instance of BadRequestError from a JSON string +bad_request_error_instance = BadRequestError.from_json(json) +# print the JSON string representation of the object +print BadRequestError.to_json() + +# convert the object into a dict +bad_request_error_dict = bad_request_error_instance.to_dict() +# create an instance of BadRequestError from a dict +bad_request_error_form_dict = bad_request_error.from_dict(bad_request_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/DeployTestTemplate.md b/test_templates_api/docs/DeployTestTemplate.md new file mode 100644 index 00000000..958d8e6f --- /dev/null +++ b/test_templates_api/docs/DeployTestTemplate.md @@ -0,0 +1,30 @@ +# DeployTestTemplate + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_input_values** | [**DeployTestTemplateUserInputValues**](DeployTestTemplateUserInputValues.md) | | [optional] +**name** | **str** | | [optional] +**tests** | [**DeployTestTemplateTests**](DeployTestTemplateTests.md) | | [optional] + +## Example + +```python +from test_templates_api.models.deploy_test_template import DeployTestTemplate + +# TODO update the JSON string below +json = "{}" +# create an instance of DeployTestTemplate from a JSON string +deploy_test_template_instance = DeployTestTemplate.from_json(json) +# print the JSON string representation of the object +print DeployTestTemplate.to_json() + +# convert the object into a dict +deploy_test_template_dict = deploy_test_template_instance.to_dict() +# create an instance of DeployTestTemplate from a dict +deploy_test_template_form_dict = deploy_test_template.from_dict(deploy_test_template_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/DeployTestTemplateTests.md b/test_templates_api/docs/DeployTestTemplateTests.md new file mode 100644 index 00000000..402ce7fc --- /dev/null +++ b/test_templates_api/docs/DeployTestTemplateTests.md @@ -0,0 +1,28 @@ +# DeployTestTemplateTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | **int** | | [optional] + +## Example + +```python +from test_templates_api.models.deploy_test_template_tests import DeployTestTemplateTests + +# TODO update the JSON string below +json = "{}" +# create an instance of DeployTestTemplateTests from a JSON string +deploy_test_template_tests_instance = DeployTestTemplateTests.from_json(json) +# print the JSON string representation of the object +print DeployTestTemplateTests.to_json() + +# convert the object into a dict +deploy_test_template_tests_dict = deploy_test_template_tests_instance.to_dict() +# create an instance of DeployTestTemplateTests from a dict +deploy_test_template_tests_form_dict = deploy_test_template_tests.from_dict(deploy_test_template_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/DeployTestTemplateUserInputValues.md b/test_templates_api/docs/DeployTestTemplateUserInputValues.md new file mode 100644 index 00000000..d5547b2c --- /dev/null +++ b/test_templates_api/docs/DeployTestTemplateUserInputValues.md @@ -0,0 +1,31 @@ +# DeployTestTemplateUserInputValues + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | **int** | | [optional] +**target** | **str** | | [optional] +**agents** | **str** | | [optional] +**domain** | **str** | | [optional] + +## Example + +```python +from test_templates_api.models.deploy_test_template_user_input_values import DeployTestTemplateUserInputValues + +# TODO update the JSON string below +json = "{}" +# create an instance of DeployTestTemplateUserInputValues from a JSON string +deploy_test_template_user_input_values_instance = DeployTestTemplateUserInputValues.from_json(json) +# print the JSON string representation of the object +print DeployTestTemplateUserInputValues.to_json() + +# convert the object into a dict +deploy_test_template_user_input_values_dict = deploy_test_template_user_input_values_instance.to_dict() +# create an instance of DeployTestTemplateUserInputValues from a dict +deploy_test_template_user_input_values_form_dict = deploy_test_template_user_input_values.from_dict(deploy_test_template_user_input_values_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/DeploymentStrategy.md b/test_templates_api/docs/DeploymentStrategy.md new file mode 100644 index 00000000..19079c36 --- /dev/null +++ b/test_templates_api/docs/DeploymentStrategy.md @@ -0,0 +1,11 @@ +# DeploymentStrategy + +The `deploymentStrategy` field defines how the system behaves when an asset (test, label, dashboard) defined in the template already exists. For tests, the system uses the test type and name to determine if a test already exists. For example, if a template contains an http-server test named `Test123` and an http-server test with the same name already exists, the system assumes that this test already exists. If the test had a different type (for example, page-load), then the system would not consider the test to already exist because the types are different. For Labels and Dashboards, the system uses only the name. (Note that current Test Templates only consider \"test\" Labels). Alert Rules do not currently support `deploymentStrategy`. Below are the possible deployment strategies and their behaviors: * `Create Always` - The system will always attempt to create the asset. If an asset of the same name and type already exists, the system will generate an error. This behavior ensures that each asset created from a template is unique. This is the default behavior. * `Update on Change` - If an asset of the same type and name already exists, the existing asset is used instead of creating a new asset. If the configuration of the asset in the template is different from the existing one, the latest configuration is applied. * `Ignore on Change` - If an asset of the same type and name already exists, the existing asset is used instead of creating a new asset. If the configuration of the asset in the template is different from the existing one, the configuration of the existing asset is used and the configuration in the template is ignored. The `Update on Change` and `Ignore on Change` strategies essentially allow assets to be shared across templates. For example, the built-in \"Custom Web Page\", \"Custom Web Server\", and \"Custom Device\" templates all contain a Dashboard asset called \"Health Overview\". It's `deploymentStrategy` is set to `Ignore on Change`, which means that the first deployment of a template such as the \"Custom Web Page\" template creates the \"Health Overview\" dashboard. Subsequent deployments of the \"Custom Web Page\" template do not attempt to recreate the \"Health Overview\" dashboard. Instead, the existing dashboard is reused. Note: Assets that were not created using a template are not included when the system searches for existing assets; they are not used with `Update on Change` or `Ignore on Change`. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/Link.md b/test_templates_api/docs/Link.md new file mode 100644 index 00000000..2f810b68 --- /dev/null +++ b/test_templates_api/docs/Link.md @@ -0,0 +1,35 @@ +# Link + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**hreflang** | **str** | | [optional] +**title** | **str** | | [optional] +**type** | **str** | | [optional] +**deprecation** | **str** | | [optional] +**profile** | **str** | | [optional] +**name** | **str** | | [optional] +**templated** | **bool** | | [optional] + +## Example + +```python +from test_templates_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/NotFoundError.md b/test_templates_api/docs/NotFoundError.md new file mode 100644 index 00000000..03d555c6 --- /dev/null +++ b/test_templates_api/docs/NotFoundError.md @@ -0,0 +1,28 @@ +# NotFoundError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | [optional] + +## Example + +```python +from test_templates_api.models.not_found_error import NotFoundError + +# TODO update the JSON string below +json = "{}" +# create an instance of NotFoundError from a JSON string +not_found_error_instance = NotFoundError.from_json(json) +# print the JSON string representation of the object +print NotFoundError.to_json() + +# convert the object into a dict +not_found_error_dict = not_found_error_instance.to_dict() +# create an instance of NotFoundError from a dict +not_found_error_form_dict = not_found_error.from_dict(not_found_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/TestTemplate.md b/test_templates_api/docs/TestTemplate.md new file mode 100644 index 00000000..d9853009 --- /dev/null +++ b/test_templates_api/docs/TestTemplate.md @@ -0,0 +1,41 @@ +# TestTemplate + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The ID of the test template. | [optional] +**name** | **str** | The name of the test template. | [optional] +**description** | **str** | Text that describes the test template. | [optional] +**icon** | **str** | Icon for the test template; will be displayed in the UI. | [optional] +**is_built_in** | **bool** | Indicates whether the test template is a built-in template. Note that built-in test templates are read-only. | [optional] +**certification_level** | **str** | | [optional] +**date_created** | **str** | The date and time the test template was created. | [optional] +**user_inputs** | [**Dict[str, UserInput]**](UserInput.md) | | [optional] +**labels** | **object** | A map of <labelKey, labelConfiguration>. | [optional] +**tests** | **object** | A map of <testKey, testConfiguration>. | [optional] +**alert_rules** | **object** | A map of <alertRuleKey, alertRuleConfiguration>. | [optional] +**dashboards** | **object** | A map of <dashboardKey, dashboardConfiguration>. | [optional] +**deployment_strategy** | [**Dict[str, DeploymentStrategy]**](DeploymentStrategy.md) | A map of <assetKey, deploymentStrategy>. | [optional] +**links** | [**Dict[str, Link]**](Link.md) | | [optional] + +## Example + +```python +from test_templates_api.models.test_template import TestTemplate + +# TODO update the JSON string below +json = "{}" +# create an instance of TestTemplate from a JSON string +test_template_instance = TestTemplate.from_json(json) +# print the JSON string representation of the object +print TestTemplate.to_json() + +# convert the object into a dict +test_template_dict = test_template_instance.to_dict() +# create an instance of TestTemplate from a dict +test_template_form_dict = test_template.from_dict(test_template_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/TestTemplateCollection.md b/test_templates_api/docs/TestTemplateCollection.md new file mode 100644 index 00000000..616e554f --- /dev/null +++ b/test_templates_api/docs/TestTemplateCollection.md @@ -0,0 +1,29 @@ +# TestTemplateCollection + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**templates** | [**List[TestTemplate]**](TestTemplate.md) | | [optional] +**links** | [**TestTemplateCollectionLinks**](TestTemplateCollectionLinks.md) | | [optional] + +## Example + +```python +from test_templates_api.models.test_template_collection import TestTemplateCollection + +# TODO update the JSON string below +json = "{}" +# create an instance of TestTemplateCollection from a JSON string +test_template_collection_instance = TestTemplateCollection.from_json(json) +# print the JSON string representation of the object +print TestTemplateCollection.to_json() + +# convert the object into a dict +test_template_collection_dict = test_template_collection_instance.to_dict() +# create an instance of TestTemplateCollection from a dict +test_template_collection_form_dict = test_template_collection.from_dict(test_template_collection_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/TestTemplateCollectionLinks.md b/test_templates_api/docs/TestTemplateCollectionLinks.md new file mode 100644 index 00000000..f263f25e --- /dev/null +++ b/test_templates_api/docs/TestTemplateCollectionLinks.md @@ -0,0 +1,28 @@ +# TestTemplateCollectionLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**TestTemplateCollectionLinksSelf**](TestTemplateCollectionLinksSelf.md) | | [optional] + +## Example + +```python +from test_templates_api.models.test_template_collection_links import TestTemplateCollectionLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of TestTemplateCollectionLinks from a JSON string +test_template_collection_links_instance = TestTemplateCollectionLinks.from_json(json) +# print the JSON string representation of the object +print TestTemplateCollectionLinks.to_json() + +# convert the object into a dict +test_template_collection_links_dict = test_template_collection_links_instance.to_dict() +# create an instance of TestTemplateCollectionLinks from a dict +test_template_collection_links_form_dict = test_template_collection_links.from_dict(test_template_collection_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/TestTemplateCollectionLinksSelf.md b/test_templates_api/docs/TestTemplateCollectionLinksSelf.md new file mode 100644 index 00000000..4f4fa584 --- /dev/null +++ b/test_templates_api/docs/TestTemplateCollectionLinksSelf.md @@ -0,0 +1,28 @@ +# TestTemplateCollectionLinksSelf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] + +## Example + +```python +from test_templates_api.models.test_template_collection_links_self import TestTemplateCollectionLinksSelf + +# TODO update the JSON string below +json = "{}" +# create an instance of TestTemplateCollectionLinksSelf from a JSON string +test_template_collection_links_self_instance = TestTemplateCollectionLinksSelf.from_json(json) +# print the JSON string representation of the object +print TestTemplateCollectionLinksSelf.to_json() + +# convert the object into a dict +test_template_collection_links_self_dict = test_template_collection_links_self_instance.to_dict() +# create an instance of TestTemplateCollectionLinksSelf from a dict +test_template_collection_links_self_form_dict = test_template_collection_links_self.from_dict(test_template_collection_links_self_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/TestTemplateEndpointsApi.md b/test_templates_api/docs/TestTemplateEndpointsApi.md new file mode 100644 index 00000000..2bfce3a9 --- /dev/null +++ b/test_templates_api/docs/TestTemplateEndpointsApi.md @@ -0,0 +1,517 @@ +# test_templates_api.TestTemplateEndpointsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_test_template**](TestTemplateEndpointsApi.md#create_test_template) | **POST** /v7/tests/templates | Create a test template. +[**delete_test_template**](TestTemplateEndpointsApi.md#delete_test_template) | **DELETE** /v7/tests/templates/{id} | Delete a test template +[**deploy_user_template**](TestTemplateEndpointsApi.md#deploy_user_template) | **POST** /v7/tests/templates/{id}/deploy | Deploy a test template. +[**get_user_org_test_template**](TestTemplateEndpointsApi.md#get_user_org_test_template) | **GET** /v7/tests/templates/{id} | Retrieve a test template +[**get_user_org_test_templates**](TestTemplateEndpointsApi.md#get_user_org_test_templates) | **GET** /v7/tests/templates | List all test templates. +[**update_test_template**](TestTemplateEndpointsApi.md#update_test_template) | **PUT** /v7/tests/templates/{id} | Update a test template + + +# **create_test_template** +> TestTemplate create_test_template(test_template_upsert, aid=aid) + +Create a test template. + +Creates a test template. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_templates_api +from test_templates_api.models.test_template import TestTemplate +from test_templates_api.models.test_template_upsert import TestTemplateUpsert +from test_templates_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 = test_templates_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 = test_templates_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_templates_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_templates_api.TestTemplateEndpointsApi(api_client) + test_template_upsert = test_templates_api.TestTemplateUpsert() # TestTemplateUpsert | The test template to create or update. + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create a test template. + api_response = api_instance.create_test_template(test_template_upsert, aid=aid) + print("The response of TestTemplateEndpointsApi->create_test_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TestTemplateEndpointsApi->create_test_template: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_template_upsert** | [**TestTemplateUpsert**](TestTemplateUpsert.md)| The test template to create or update. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**TestTemplate**](TestTemplate.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**500** | Internal Server Error | - | + +[[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) + +# **delete_test_template** +> delete_test_template(id, aid=aid) + +Delete a test template + +Deletes a test template using its ID. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_templates_api +from test_templates_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 = test_templates_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 = test_templates_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_templates_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_templates_api.TestTemplateEndpointsApi(api_client) + id = 'fcbb89a7-61cf-4616-9c4f-828fa3cb4684' # str | The ID of the test template + 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 a test template + api_instance.delete_test_template(id, aid=aid) + except Exception as e: + print("Exception when calling TestTemplateEndpointsApi->delete_test_template: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The ID of the test template | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**500** | Internal Server Error | - | + +[[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) + +# **deploy_user_template** +> deploy_user_template(id, deploy_test_template, aid=aid) + +Deploy a test template. + +Deploys a test template to create tests, alert rules, and dashboards defined by the template. You can deploy templates to easily create new tests. To deploy test templates, you must specify `userInputValues` required by the template in the request body. `userInputValues` enables you to specify a minimum set of user values required to configure the tests from a test template. This way, you do not have to edit all the details of each test configuration. If necessary, you can edit the test details directly in the template. ### Considerations Consider the following when deploying a test template: * To deploy a test template, you must first create the template or use one of ThousandEyes' predefined test templates. * The deployment strategy allows you to specify what should happen to a particular asset in the event that a test template is redeployed. When you attempt to deploy a test template that has already been deployed, the API service compares any assets that have not yet been deployed with the assets that were deployed in the previous deployment (the comparison is done using the **asset key**; the asset keys are simply the object keys used in the `tests`, `labels`, `alertRules`, and `dashboards` fields). By default, if the configuration of a particular asset has not changed from the previous deployment, that asset is ignored. If a change is detected: * If the asset is a test, a new test is created with the new configuration. * If the asset is not a test, the asset is updated. * You can create new resources such as tests, alert rules, labels, dashboards, and modify existing resources defined in test templates, overwriting the default configurations. * You can also use existing resources (such as those created outside the test template deployment flow) by adding their ID either in the raw test template or using the overrides when deploying the template. See example usage below for the raw test template sample. **Note**: The test template API does not currently track \"live\" configuration of assets. Any changes made to assets outside of the test template API will not be considered when comparing changes during the redeployment scenario. ### Example usage: ```POST /v7/tests/templates/fcbb89a7-61cf-4616-9c4f-828fa3cb4684/deploy { \"userInputValues\": { \"interval\": 120, \"target\": \"https://microsoft.com\", \"agents\": [{\"agentId\":11}], \"domain\": \"microsoft.com\" }, \"name\":\"Microsoft Suite\", \"tests\": { \"secondPageLoadTest\": { \"httpInterval\": 120, \"interval\": 120, \"testId\": 182481, \"type\": \"page-load\", \"url\": \"https://microsoft.com\", \"testName\": \"Microsoft Suite - Second Page Load\", \"agents\": [ { \"agentId\": 11 } ] } } } ``` #### Raw Test Template Sample ``` { ... \"tests\": { \"existingTest\": { \"testId\": \"123\", //The API will only try to update this test; will never create it \"type\": \"http-server\", .... }, ... }, ... } ``` + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_templates_api +from test_templates_api.models.deploy_test_template import DeployTestTemplate +from test_templates_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 = test_templates_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 = test_templates_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_templates_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_templates_api.TestTemplateEndpointsApi(api_client) + id = 'fcbb89a7-61cf-4616-9c4f-828fa3cb4684' # str | The ID of the test template + deploy_test_template = test_templates_api.DeployTestTemplate() # DeployTestTemplate | Deploy test template + 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: + # Deploy a test template. + api_instance.deploy_user_template(id, deploy_test_template, aid=aid) + except Exception as e: + print("Exception when calling TestTemplateEndpointsApi->deploy_user_template: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The ID of the test template | + **deploy_test_template** | [**DeployTestTemplate**](DeployTestTemplate.md)| Deploy test template | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**500** | Internal Server Error | - | + +[[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_user_org_test_template** +> TestTemplate get_user_org_test_template(id, aid=aid) + +Retrieve a test template + +Retrieves a test template using its ID. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_templates_api +from test_templates_api.models.test_template import TestTemplate +from test_templates_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 = test_templates_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 = test_templates_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_templates_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_templates_api.TestTemplateEndpointsApi(api_client) + id = 'fcbb89a7-61cf-4616-9c4f-828fa3cb4684' # str | The ID of the test template + 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 a test template + api_response = api_instance.get_user_org_test_template(id, aid=aid) + print("The response of TestTemplateEndpointsApi->get_user_org_test_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TestTemplateEndpointsApi->get_user_org_test_template: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The ID of the test template | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**TestTemplate**](TestTemplate.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**500** | Internal Server Error | - | + +[[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_user_org_test_templates** +> TestTemplateCollection get_user_org_test_templates(aid=aid) + +List all test templates. + +Retrieves a list of all your test templates + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_templates_api +from test_templates_api.models.test_template_collection import TestTemplateCollection +from test_templates_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 = test_templates_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 = test_templates_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_templates_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_templates_api.TestTemplateEndpointsApi(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 all test templates. + api_response = api_instance.get_user_org_test_templates(aid=aid) + print("The response of TestTemplateEndpointsApi->get_user_org_test_templates:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TestTemplateEndpointsApi->get_user_org_test_templates: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**TestTemplateCollection**](TestTemplateCollection.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 | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**500** | Internal Server Error | - | + +[[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_test_template** +> TestTemplate update_test_template(id, test_template_upsert, aid=aid) + +Update a test template + +Updates an existing test template. This operation overwrites the existing test template object with the object sent in the request. If a partial update is required, it is recommended that you retrieve the test template and modify the test template object before updating it. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import test_templates_api +from test_templates_api.models.test_template import TestTemplate +from test_templates_api.models.test_template_upsert import TestTemplateUpsert +from test_templates_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 = test_templates_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 = test_templates_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with test_templates_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = test_templates_api.TestTemplateEndpointsApi(api_client) + id = 'fcbb89a7-61cf-4616-9c4f-828fa3cb4684' # str | The ID of the test template + test_template_upsert = test_templates_api.TestTemplateUpsert() # TestTemplateUpsert | The test template to create or update. + 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: + # Update a test template + api_response = api_instance.update_test_template(id, test_template_upsert, aid=aid) + print("The response of TestTemplateEndpointsApi->update_test_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TestTemplateEndpointsApi->update_test_template: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The ID of the test template | + **test_template_upsert** | [**TestTemplateUpsert**](TestTemplateUpsert.md)| The test template to create or update. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**TestTemplate**](TestTemplate.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/test_templates_api/docs/TestTemplateUpsert.md b/test_templates_api/docs/TestTemplateUpsert.md new file mode 100644 index 00000000..4edeca55 --- /dev/null +++ b/test_templates_api/docs/TestTemplateUpsert.md @@ -0,0 +1,38 @@ +# TestTemplateUpsert + +The test template to create or update. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the test template. | +**description** | **str** | Text that describes the test template. | [optional] +**icon** | **str** | Icon for the test template; will be displayed in the UI. | [optional] +**is_built_in** | **bool** | Indicates whether the test template is a built-in template. Note that built-in test templates are read-only. | [optional] +**user_inputs** | [**Dict[str, UserInput]**](UserInput.md) | | [optional] +**labels** | **object** | A map of <labelKey, labelConfiguration>. | [optional] +**tests** | **object** | A map of <testKey, testConfiguration>. | [optional] +**alert_rules** | **object** | A map of <alertRuleKey, alertRuleConfiguration>. | [optional] +**dashboards** | **object** | A map of <dashboardKey, dashboardConfiguration>. | [optional] +**deployment_strategy** | [**Dict[str, DeploymentStrategy]**](DeploymentStrategy.md) | A map of <assetKey, deploymentStrategy>. | [optional] + +## Example + +```python +from test_templates_api.models.test_template_upsert import TestTemplateUpsert + +# TODO update the JSON string below +json = "{}" +# create an instance of TestTemplateUpsert from a JSON string +test_template_upsert_instance = TestTemplateUpsert.from_json(json) +# print the JSON string representation of the object +print TestTemplateUpsert.to_json() + +# convert the object into a dict +test_template_upsert_dict = test_template_upsert_instance.to_dict() +# create an instance of TestTemplateUpsert from a dict +test_template_upsert_form_dict = test_template_upsert.from_dict(test_template_upsert_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/UnauthorizedError.md b/test_templates_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..550d0405 --- /dev/null +++ b/test_templates_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from test_templates_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/UserInput.md b/test_templates_api/docs/UserInput.md new file mode 100644 index 00000000..79a67dd2 --- /dev/null +++ b/test_templates_api/docs/UserInput.md @@ -0,0 +1,33 @@ +# UserInput + +The set of inputs that the user must fill in to use the test template. These inputs are provided by the user when creating a set of tests via the test template API or via the UI. The UI dynamically displays these user inputs for the user to input. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the user input field. | +**title** | **str** | The title of the user input field; may be used by UI. | [optional] +**description** | **str** | Description of the user input field; used by UI. | [optional] +**default_value** | [**UserInputDefaultValue**](UserInputDefaultValue.md) | | [optional] +**type** | [**UserInputType**](UserInputType.md) | | + +## Example + +```python +from test_templates_api.models.user_input import UserInput + +# TODO update the JSON string below +json = "{}" +# create an instance of UserInput from a JSON string +user_input_instance = UserInput.from_json(json) +# print the JSON string representation of the object +print UserInput.to_json() + +# convert the object into a dict +user_input_dict = user_input_instance.to_dict() +# create an instance of UserInput from a dict +user_input_form_dict = user_input.from_dict(user_input_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/UserInputDefaultValue.md b/test_templates_api/docs/UserInputDefaultValue.md new file mode 100644 index 00000000..732a34b0 --- /dev/null +++ b/test_templates_api/docs/UserInputDefaultValue.md @@ -0,0 +1,28 @@ +# UserInputDefaultValue + +Default value of user input field. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from test_templates_api.models.user_input_default_value import UserInputDefaultValue + +# TODO update the JSON string below +json = "{}" +# create an instance of UserInputDefaultValue from a JSON string +user_input_default_value_instance = UserInputDefaultValue.from_json(json) +# print the JSON string representation of the object +print UserInputDefaultValue.to_json() + +# convert the object into a dict +user_input_default_value_dict = user_input_default_value_instance.to_dict() +# create an instance of UserInputDefaultValue from a dict +user_input_default_value_form_dict = user_input_default_value.from_dict(user_input_default_value_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/docs/UserInputType.md b/test_templates_api/docs/UserInputType.md new file mode 100644 index 00000000..0d9ba350 --- /dev/null +++ b/test_templates_api/docs/UserInputType.md @@ -0,0 +1,11 @@ +# UserInputType + +The type of user input field. This is used to validate the user values provided when deploying a template. - \"string\": A string based user input. E.g., `\"https://google.com\"` - \"number\": A number based user input. E.g., `25.8` - \"boolean\": A boolean based user input. E.g., `false` - \"string[]\": A list of string based user inputs. E.g., `[\"someId\", \"someOtherId\"]` - \"number[]\": A list of number based user inputs. E.g., `[1, 2.3, 5000]` - \"boolean[]\": A list of boolean based user inputs. E.g., `[true, false]` - \"any\": For any other user inputs that don't belong to the types listed above. E.g., `[{\"agentId\": 22}]` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/test_templates_api/git_push.sh b/test_templates_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/test_templates_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/test_templates_api/pyproject.toml b/test_templates_api/pyproject.toml new file mode 100644 index 00000000..8284309d --- /dev/null +++ b/test_templates_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "test_templates_api" +version = "1.0.0" +description = "Test Template" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Test Template"] +include = ["test_templates_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/test_templates_api/requirements.txt b/test_templates_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/test_templates_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/test_templates_api/setup.cfg b/test_templates_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/test_templates_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/test_templates_api/setup.py b/test_templates_api/setup.py new file mode 100644 index 00000000..35bf9d10 --- /dev/null +++ b/test_templates_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "test-templates-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Test Template", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Test Template"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + """, # noqa: E501 + package_data={"test_templates_api": ["py.typed"]}, +) diff --git a/test_templates_api/test-requirements.txt b/test_templates_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/test_templates_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/test_templates_api/test/__init__.py b/test_templates_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test_templates_api/test/test_api_error.py b/test_templates_api/test/test_api_error.py new file mode 100644 index 00000000..c9b3aa96 --- /dev/null +++ b/test_templates_api/test/test_api_error.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.api_error import ApiError + +class TestApiError(unittest.TestCase): + """ApiError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApiError: + """Test ApiError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApiError` + """ + model = ApiError() + if include_optional: + return ApiError( + message = '', + errors = [ + '' + ] + ) + else: + return ApiError( + ) + """ + + def testApiError(self): + """Test ApiError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_bad_request_error.py b/test_templates_api/test/test_bad_request_error.py new file mode 100644 index 00000000..3c7fcce0 --- /dev/null +++ b/test_templates_api/test/test_bad_request_error.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.bad_request_error import BadRequestError + +class TestBadRequestError(unittest.TestCase): + """BadRequestError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BadRequestError: + """Test BadRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BadRequestError` + """ + model = BadRequestError() + if include_optional: + return BadRequestError( + timestamp = 1680006221517, + status = 400, + error = 'Bad Request', + path = '/v1/tests/templates' + ) + else: + return BadRequestError( + ) + """ + + def testBadRequestError(self): + """Test BadRequestError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_deploy_test_template.py b/test_templates_api/test/test_deploy_test_template.py new file mode 100644 index 00000000..66efc71f --- /dev/null +++ b/test_templates_api/test/test_deploy_test_template.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.deploy_test_template import DeployTestTemplate + +class TestDeployTestTemplate(unittest.TestCase): + """DeployTestTemplate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeployTestTemplate: + """Test DeployTestTemplate + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DeployTestTemplate` + """ + model = DeployTestTemplate() + if include_optional: + return DeployTestTemplate( + user_input_values = test_templates_api.models.deploy_test_template_user_input_values.DeployTestTemplate_userInputValues( + interval = 56, + target = '', + agents = '', + domain = '', ), + name = '', + tests = test_templates_api.models.deploy_test_template_tests.DeployTestTemplate_tests( + interval = 56, ) + ) + else: + return DeployTestTemplate( + ) + """ + + def testDeployTestTemplate(self): + """Test DeployTestTemplate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_deploy_test_template_tests.py b/test_templates_api/test/test_deploy_test_template_tests.py new file mode 100644 index 00000000..6b20e75b --- /dev/null +++ b/test_templates_api/test/test_deploy_test_template_tests.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.deploy_test_template_tests import DeployTestTemplateTests + +class TestDeployTestTemplateTests(unittest.TestCase): + """DeployTestTemplateTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeployTestTemplateTests: + """Test DeployTestTemplateTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DeployTestTemplateTests` + """ + model = DeployTestTemplateTests() + if include_optional: + return DeployTestTemplateTests( + interval = 56 + ) + else: + return DeployTestTemplateTests( + ) + """ + + def testDeployTestTemplateTests(self): + """Test DeployTestTemplateTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_deploy_test_template_user_input_values.py b/test_templates_api/test/test_deploy_test_template_user_input_values.py new file mode 100644 index 00000000..45304e76 --- /dev/null +++ b/test_templates_api/test/test_deploy_test_template_user_input_values.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.deploy_test_template_user_input_values import DeployTestTemplateUserInputValues + +class TestDeployTestTemplateUserInputValues(unittest.TestCase): + """DeployTestTemplateUserInputValues unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeployTestTemplateUserInputValues: + """Test DeployTestTemplateUserInputValues + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DeployTestTemplateUserInputValues` + """ + model = DeployTestTemplateUserInputValues() + if include_optional: + return DeployTestTemplateUserInputValues( + interval = 56, + target = '', + agents = '', + domain = '' + ) + else: + return DeployTestTemplateUserInputValues( + ) + """ + + def testDeployTestTemplateUserInputValues(self): + """Test DeployTestTemplateUserInputValues""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_deployment_strategy.py b/test_templates_api/test/test_deployment_strategy.py new file mode 100644 index 00000000..fd6df649 --- /dev/null +++ b/test_templates_api/test/test_deployment_strategy.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.deployment_strategy import DeploymentStrategy + +class TestDeploymentStrategy(unittest.TestCase): + """DeploymentStrategy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDeploymentStrategy(self): + """Test DeploymentStrategy""" + # inst = DeploymentStrategy() + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_link.py b/test_templates_api/test/test_link.py new file mode 100644 index 00000000..de4da664 --- /dev/null +++ b/test_templates_api/test/test_link.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = '', + hreflang = '', + title = '', + type = '', + deprecation = '', + profile = '', + name = '', + templated = True + ) + else: + return Link( + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_not_found_error.py b/test_templates_api/test/test_not_found_error.py new file mode 100644 index 00000000..8303801e --- /dev/null +++ b/test_templates_api/test/test_not_found_error.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.not_found_error import NotFoundError + +class TestNotFoundError(unittest.TestCase): + """NotFoundError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NotFoundError: + """Test NotFoundError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NotFoundError` + """ + model = NotFoundError() + if include_optional: + return NotFoundError( + message = '' + ) + else: + return NotFoundError( + ) + """ + + def testNotFoundError(self): + """Test NotFoundError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_test_template.py b/test_templates_api/test/test_test_template.py new file mode 100644 index 00000000..28a27b8c --- /dev/null +++ b/test_templates_api/test/test_test_template.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.test_template import TestTemplate + +class TestTestTemplate(unittest.TestCase): + """TestTemplate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestTemplate: + """Test TestTemplate + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestTemplate` + """ + model = TestTemplate() + if include_optional: + return TestTemplate( + id = 'fcbb89a7-61cf-4616-9c4f-828fa3cb4684', + name = 'OneDrive Template', + description = 'OneDrive Template', + icon = 'oneDrive.svg', + is_built_in = False, + certification_level = 'User', + date_created = '2022-09-28 13:25:15', + user_inputs = {"tenantName":{"title":"Tenant Name","description":"Name of OneDrive tenant; will be used in OneDrive URL","type":"string"},"agents":{"name":"Agent List","type":"any"}}, + labels = {"templateLabel":{"name":"OneDrive Template"}}, + tests = {"dnsTest":{"type":"object","example":{"domain":"{{userInputs.domain}} A","groups":[{"groupId":"{{labels.webHealthDashLabel.groupId}}"},{"groupId":"{{labels.templateLabel.groupId}}"}],"interval":"{{userInputs.interval}}","type":"dns-server","dnsServers":"{{userInputs.dnsServers}}","testName":"{{name}} - DNS","agents":"{{userInputs.agents}}"}},"httpServerTest":{"groups":[{"groupId":"{{labels.webHealthDashLabel.groupId}}"},{"groupId":"{{labels.templateLabel.groupId}}"}],"interval":"{{userInputs.interval}}","type":"http-server","url":"https://{{userInputs.domain}}","testName":"{{name}} - HTTP Server","agents":"{{userInputs.agents}}"},"networkTest":{"server":"{{userInputs.domain}}","protocol":"TCP","port":"{{userInputs.port}}","groups":{"groupId":"{{labels.webHealthDashLabel.groupId}}"},"interval":"{{userInputs.interval}}","type":"agent-to-server","url":"https://{{userInputs.domain}}","testName":"{{name}} - Network","agents":"{{userInputs.agents}}"},"pageLoadTest":{"name":"OneDrive PageLoad Test","type":"page-load","target":"https://{{tenantName}}-my.sharepoint.com","agents":"{{userInputs.agents}}"},"dnsServerTest":{"name":"OneDrive Dns Server Test","type":"dns-server","domain":"{{tenantName}}-my.sharepoint.com CNAME","agents":"{{userInputs.agents}}"}}, + alert_rules = {"httpAlert":{"testIds":["{{tests.pageLoadTest.testId}}"],"severity":"MINOR","roundsViolatingRequired":1,"roundsViolatingOutOf":1,"alertType":"HTTP Server","expression":"((totalTime >= 500 ms) && (responseTime >= 500 ms))","ruleName":"{{name}} - HTTP Alert","minimumSources":1}}, + dashboards = {"webHealthDashboard":{"title":"Web Health Overview","widgets":[{"metricGroup":"Web - HTTP Server","measure":{"type":"Mean"},"metric":"Total Time","filters":{"Test Labels":"[{{labels.webHealthDashLabel.groupId}}]"},"groupBy":"Tests","type":"Time Series: Line","title":"HTTP Response Times","dataSource":"Cloud & Enterprise Agents"}]}}, + deployment_strategy = {"testVoiceLabel":"Update on Change","testVideoLabel":"Update on Change","testLabel":"Update on Change","dnsTest":"Ignore on Change","webexDashboard":"Ignore on Change","serverTest":"Ignore on Change"}, + links = { + 'key' : test_templates_api.models.link.Link( + href = '', + hreflang = '', + title = '', + type = '', + deprecation = '', + profile = '', + name = '', + templated = True, ) + } + ) + else: + return TestTemplate( + ) + """ + + def testTestTemplate(self): + """Test TestTemplate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_test_template_collection.py b/test_templates_api/test/test_test_template_collection.py new file mode 100644 index 00000000..4ff41cf1 --- /dev/null +++ b/test_templates_api/test/test_test_template_collection.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.test_template_collection import TestTemplateCollection + +class TestTestTemplateCollection(unittest.TestCase): + """TestTemplateCollection unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestTemplateCollection: + """Test TestTemplateCollection + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestTemplateCollection` + """ + model = TestTemplateCollection() + if include_optional: + return TestTemplateCollection( + templates = [ + test_templates_api.models.test_template.TestTemplate( + id = 'fcbb89a7-61cf-4616-9c4f-828fa3cb4684', + name = 'OneDrive Template', + description = 'OneDrive Template', + icon = 'oneDrive.svg', + is_built_in = False, + certification_level = 'User', + date_created = '2022-09-28 13:25:15', + user_inputs = {"tenantName":{"title":"Tenant Name","description":"Name of OneDrive tenant; will be used in OneDrive URL","type":"string"},"agents":{"name":"Agent List","type":"any"}}, + labels = {"templateLabel":{"name":"OneDrive Template"}}, + tests = {"dnsTest":{"type":"object","example":{"domain":"{{userInputs.domain}} A","groups":[{"groupId":"{{labels.webHealthDashLabel.groupId}}"},{"groupId":"{{labels.templateLabel.groupId}}"}],"interval":"{{userInputs.interval}}","type":"dns-server","dnsServers":"{{userInputs.dnsServers}}","testName":"{{name}} - DNS","agents":"{{userInputs.agents}}"}},"httpServerTest":{"groups":[{"groupId":"{{labels.webHealthDashLabel.groupId}}"},{"groupId":"{{labels.templateLabel.groupId}}"}],"interval":"{{userInputs.interval}}","type":"http-server","url":"https://{{userInputs.domain}}","testName":"{{name}} - HTTP Server","agents":"{{userInputs.agents}}"},"networkTest":{"server":"{{userInputs.domain}}","protocol":"TCP","port":"{{userInputs.port}}","groups":{"groupId":"{{labels.webHealthDashLabel.groupId}}"},"interval":"{{userInputs.interval}}","type":"agent-to-server","url":"https://{{userInputs.domain}}","testName":"{{name}} - Network","agents":"{{userInputs.agents}}"},"pageLoadTest":{"name":"OneDrive PageLoad Test","type":"page-load","target":"https://{{tenantName}}-my.sharepoint.com","agents":"{{userInputs.agents}}"},"dnsServerTest":{"name":"OneDrive Dns Server Test","type":"dns-server","domain":"{{tenantName}}-my.sharepoint.com CNAME","agents":"{{userInputs.agents}}"}}, + alert_rules = {"httpAlert":{"testIds":["{{tests.pageLoadTest.testId}}"],"severity":"MINOR","roundsViolatingRequired":1,"roundsViolatingOutOf":1,"alertType":"HTTP Server","expression":"((totalTime >= 500 ms) && (responseTime >= 500 ms))","ruleName":"{{name}} - HTTP Alert","minimumSources":1}}, + dashboards = {"webHealthDashboard":{"title":"Web Health Overview","widgets":[{"metricGroup":"Web - HTTP Server","measure":{"type":"Mean"},"metric":"Total Time","filters":{"Test Labels":"[{{labels.webHealthDashLabel.groupId}}]"},"groupBy":"Tests","type":"Time Series: Line","title":"HTTP Response Times","dataSource":"Cloud & Enterprise Agents"}]}}, + deployment_strategy = {"testVoiceLabel":"Update on Change","testVideoLabel":"Update on Change","testLabel":"Update on Change","dnsTest":"Ignore on Change","webexDashboard":"Ignore on Change","serverTest":"Ignore on Change"}, + _links = { + 'key' : test_templates_api.models.link.Link( + href = '', + hreflang = '', + title = '', + type = '', + deprecation = '', + profile = '', + name = '', + templated = True, ) + }, ) + ], + links = test_templates_api.models.test_template_collection__links.TestTemplateCollection__links( + self = test_templates_api.models.test_template_collection__links_self.TestTemplateCollection__links_self( + href = 'https://api.thousandeyes.com/v7/tests/templates/6c6bc11c-0332-4e28-9efb-f171a14be824', ), ) + ) + else: + return TestTemplateCollection( + ) + """ + + def testTestTemplateCollection(self): + """Test TestTemplateCollection""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_test_template_collection_links.py b/test_templates_api/test/test_test_template_collection_links.py new file mode 100644 index 00000000..767d42fe --- /dev/null +++ b/test_templates_api/test/test_test_template_collection_links.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.test_template_collection_links import TestTemplateCollectionLinks + +class TestTestTemplateCollectionLinks(unittest.TestCase): + """TestTemplateCollectionLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestTemplateCollectionLinks: + """Test TestTemplateCollectionLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestTemplateCollectionLinks` + """ + model = TestTemplateCollectionLinks() + if include_optional: + return TestTemplateCollectionLinks( + var_self = test_templates_api.models.test_template_collection__links_self.TestTemplateCollection__links_self( + href = 'https://api.thousandeyes.com/v7/tests/templates/6c6bc11c-0332-4e28-9efb-f171a14be824', ) + ) + else: + return TestTemplateCollectionLinks( + ) + """ + + def testTestTemplateCollectionLinks(self): + """Test TestTemplateCollectionLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_test_template_collection_links_self.py b/test_templates_api/test/test_test_template_collection_links_self.py new file mode 100644 index 00000000..32174390 --- /dev/null +++ b/test_templates_api/test/test_test_template_collection_links_self.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.test_template_collection_links_self import TestTemplateCollectionLinksSelf + +class TestTestTemplateCollectionLinksSelf(unittest.TestCase): + """TestTemplateCollectionLinksSelf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestTemplateCollectionLinksSelf: + """Test TestTemplateCollectionLinksSelf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestTemplateCollectionLinksSelf` + """ + model = TestTemplateCollectionLinksSelf() + if include_optional: + return TestTemplateCollectionLinksSelf( + href = 'https://api.thousandeyes.com/v7/tests/templates/6c6bc11c-0332-4e28-9efb-f171a14be824' + ) + else: + return TestTemplateCollectionLinksSelf( + ) + """ + + def testTestTemplateCollectionLinksSelf(self): + """Test TestTemplateCollectionLinksSelf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_test_template_endpoints_api.py b/test_templates_api/test/test_test_template_endpoints_api.py new file mode 100644 index 00000000..e6b73158 --- /dev/null +++ b/test_templates_api/test/test_test_template_endpoints_api.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from test_templates_api.api.test_template_endpoints_api import TestTemplateEndpointsApi + + +class TestTestTemplateEndpointsApi(unittest.TestCase): + """TestTemplateEndpointsApi unit test stubs""" + + def setUp(self) -> None: + self.api = TestTemplateEndpointsApi() + + def tearDown(self) -> None: + pass + + def test_create_test_template(self) -> None: + """Test case for create_test_template + + Create a test template. + """ + pass + + def test_delete_test_template(self) -> None: + """Test case for delete_test_template + + Delete a test template + """ + pass + + def test_deploy_user_template(self) -> None: + """Test case for deploy_user_template + + Deploy a test template. + """ + pass + + def test_get_user_org_test_template(self) -> None: + """Test case for get_user_org_test_template + + Retrieve a test template + """ + pass + + def test_get_user_org_test_templates(self) -> None: + """Test case for get_user_org_test_templates + + List all test templates. + """ + pass + + def test_update_test_template(self) -> None: + """Test case for update_test_template + + Update a test template + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_test_template_upsert.py b/test_templates_api/test/test_test_template_upsert.py new file mode 100644 index 00000000..f49c3f86 --- /dev/null +++ b/test_templates_api/test/test_test_template_upsert.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.test_template_upsert import TestTemplateUpsert + +class TestTestTemplateUpsert(unittest.TestCase): + """TestTemplateUpsert unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestTemplateUpsert: + """Test TestTemplateUpsert + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestTemplateUpsert` + """ + model = TestTemplateUpsert() + if include_optional: + return TestTemplateUpsert( + name = 'OneDrive Template', + description = 'OneDrive Template', + icon = 'oneDrive.svg', + is_built_in = False, + user_inputs = { + 'key' : {"tenantName":{"title":"Tenant Name","description":"Name of OneDrive tenant; will be used in OneDrive URL","type":"string"},"agents":{"name":"Agent List","type":"any"}} + }, + labels = {"templateLabel":{"name":"OneDrive Template"}}, + tests = {"pageLoadTest":{"name":"OneDrive PageLoad Test","type":"page-load","target":"https://{{tenantName}}-my.sharepoint.com","agents":"{{userInputs.agents}}"},"dnsServerTest":{"name":"OneDrive Dns Server Test","type":"dns-server","domain":"{{tenantName}}-my.sharepoint.com CNAME","agents":"{{userInputs.agents}}"}}, + alert_rules = {"httpAlert":{"alertType":"HTTP Serverr","ruleName":"An Http alert rule","expression":"((totalTime >= 500 ms) && (responseTime >= 500 ms))","roundsViolatingRequired":1,"roundsViolatingOutOf":1,"testIds":["{{tests.pageLoadTest.testId}}"]}}, + dashboards = {"myDashboard":{"title":"Test Dashboard 12","widgets":[{"filters":{"Test Labels":"[{{labels.templateLabel.groupId}}]"},"type":"Bar Chart: Stacked","title":"A Bar Chart: Stacked widget","metricGroup":"Web - HTTP Server","measure":{"type":"Median"},"metric":"Response Time","axisGroupBy":"Continents","dataSource":"Cloud & Enterprise Agents"}]}}, + deployment_strategy = {"pageLoadTest":"Create Always","httpAlert":"Ignore on Change"} + ) + else: + return TestTemplateUpsert( + name = 'OneDrive Template', + ) + """ + + def testTestTemplateUpsert(self): + """Test TestTemplateUpsert""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_unauthorized_error.py b/test_templates_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..747f7cfe --- /dev/null +++ b/test_templates_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_user_input.py b/test_templates_api/test/test_user_input.py new file mode 100644 index 00000000..fa5115b9 --- /dev/null +++ b/test_templates_api/test/test_user_input.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.user_input import UserInput + +class TestUserInput(unittest.TestCase): + """UserInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserInput: + """Test UserInput + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UserInput` + """ + model = UserInput() + if include_optional: + return UserInput( + name = 'target', + title = 'Test Target', + description = 'The target of the Tests', + default_value = https://google.com, + type = 'string' + ) + else: + return UserInput( + name = 'target', + type = 'string', + ) + """ + + def testUserInput(self): + """Test UserInput""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_user_input_default_value.py b/test_templates_api/test/test_user_input_default_value.py new file mode 100644 index 00000000..ce6be6ea --- /dev/null +++ b/test_templates_api/test/test_user_input_default_value.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.user_input_default_value import UserInputDefaultValue + +class TestUserInputDefaultValue(unittest.TestCase): + """UserInputDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserInputDefaultValue: + """Test UserInputDefaultValue + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UserInputDefaultValue` + """ + model = UserInputDefaultValue() + if include_optional: + return UserInputDefaultValue( + ) + else: + return UserInputDefaultValue( + ) + """ + + def testUserInputDefaultValue(self): + """Test UserInputDefaultValue""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test/test_user_input_type.py b/test_templates_api/test/test_user_input_type.py new file mode 100644 index 00000000..c64d0d82 --- /dev/null +++ b/test_templates_api/test/test_user_input_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from test_templates_api.models.user_input_type import UserInputType + +class TestUserInputType(unittest.TestCase): + """UserInputType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUserInputType(self): + """Test UserInputType""" + # inst = UserInputType() + +if __name__ == '__main__': + unittest.main() diff --git a/test_templates_api/test_templates_api/__init__.py b/test_templates_api/test_templates_api/__init__.py new file mode 100644 index 00000000..95643891 --- /dev/null +++ b/test_templates_api/test_templates_api/__init__.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 test_templates_api.api.test_template_endpoints_api import TestTemplateEndpointsApi + +# import ApiClient +from test_templates_api.api_response import ApiResponse +from test_templates_api.api_client import ApiClient +from test_templates_api.configuration import Configuration +from test_templates_api.exceptions import OpenApiException +from test_templates_api.exceptions import ApiTypeError +from test_templates_api.exceptions import ApiValueError +from test_templates_api.exceptions import ApiKeyError +from test_templates_api.exceptions import ApiAttributeError +from test_templates_api.exceptions import ApiException + +# import models into sdk package +from test_templates_api.models.api_error import ApiError +from test_templates_api.models.bad_request_error import BadRequestError +from test_templates_api.models.deploy_test_template import DeployTestTemplate +from test_templates_api.models.deploy_test_template_tests import DeployTestTemplateTests +from test_templates_api.models.deploy_test_template_user_input_values import DeployTestTemplateUserInputValues +from test_templates_api.models.deployment_strategy import DeploymentStrategy +from test_templates_api.models.link import Link +from test_templates_api.models.not_found_error import NotFoundError +from test_templates_api.models.test_template import TestTemplate +from test_templates_api.models.test_template_collection import TestTemplateCollection +from test_templates_api.models.test_template_collection_links import TestTemplateCollectionLinks +from test_templates_api.models.test_template_collection_links_self import TestTemplateCollectionLinksSelf +from test_templates_api.models.test_template_upsert import TestTemplateUpsert +from test_templates_api.models.unauthorized_error import UnauthorizedError +from test_templates_api.models.user_input import UserInput +from test_templates_api.models.user_input_default_value import UserInputDefaultValue +from test_templates_api.models.user_input_type import UserInputType diff --git a/test_templates_api/test_templates_api/api/__init__.py b/test_templates_api/test_templates_api/api/__init__.py new file mode 100644 index 00000000..2c783da3 --- /dev/null +++ b/test_templates_api/test_templates_api/api/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa + +# import apis into api package +from test_templates_api.api.test_template_endpoints_api import TestTemplateEndpointsApi + diff --git a/test_templates_api/test_templates_api/api/test_template_endpoints_api.py b/test_templates_api/test_templates_api/api/test_template_endpoints_api.py new file mode 100644 index 00000000..d7450617 --- /dev/null +++ b/test_templates_api/test_templates_api/api/test_template_endpoints_api.py @@ -0,0 +1,1840 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 test_templates_api.models.deploy_test_template import DeployTestTemplate +from test_templates_api.models.test_template import TestTemplate +from test_templates_api.models.test_template_collection import TestTemplateCollection +from test_templates_api.models.test_template_upsert import TestTemplateUpsert + +from test_templates_api.api_client import ApiClient +from test_templates_api.api_response import ApiResponse +from test_templates_api.rest import RESTResponseType + + +class TestTemplateEndpointsApi: + """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 create_test_template( + self, + test_template_upsert: Annotated[TestTemplateUpsert, Field(description="The test template to create or update.")], + 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, + ) -> TestTemplate: + """Create a test template. + + Creates a test template. + + :param test_template_upsert: The test template to create or update. (required) + :type test_template_upsert: TestTemplateUpsert + :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._create_test_template_serialize( + test_template_upsert=test_template_upsert, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TestTemplate", + '400': "BadRequestError", + '401': "UnauthorizedError", + '403': "ApiError", + '404': "ApiError", + '500': "ApiError" + + } + 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 create_test_template_with_http_info( + self, + test_template_upsert: Annotated[TestTemplateUpsert, Field(description="The test template to create or update.")], + 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[TestTemplate]: + """Create a test template. + + Creates a test template. + + :param test_template_upsert: The test template to create or update. (required) + :type test_template_upsert: TestTemplateUpsert + :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._create_test_template_serialize( + test_template_upsert=test_template_upsert, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TestTemplate", + '400': "BadRequestError", + '401': "UnauthorizedError", + '403': "ApiError", + '404': "ApiError", + '500': "ApiError" + + } + 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 create_test_template_without_preload_content( + self, + test_template_upsert: Annotated[TestTemplateUpsert, Field(description="The test template to create or update.")], + 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: + """Create a test template. + + Creates a test template. + + :param test_template_upsert: The test template to create or update. (required) + :type test_template_upsert: TestTemplateUpsert + :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._create_test_template_serialize( + test_template_upsert=test_template_upsert, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TestTemplate", + '400': "BadRequestError", + '401': "UnauthorizedError", + '403': "ApiError", + '404': "ApiError", + '500': "ApiError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_test_template_serialize( + self, + test_template_upsert, + 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 + if test_template_upsert is not None: + _body_params = test_template_upsert + + + # 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/tests/templates', + 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 delete_test_template( + self, + id: Annotated[str, Field(min_length=10, strict=True, max_length=36, description="The ID of the test template")], + 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, + ) -> None: + """Delete a test template + + Deletes a test template using its ID. + + :param id: The ID of the test template (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_test_template_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_test_template_with_http_info( + self, + id: Annotated[str, Field(min_length=10, strict=True, max_length=36, description="The ID of the test template")], + 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[None]: + """Delete a test template + + Deletes a test template using its ID. + + :param id: The ID of the test template (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_test_template_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_test_template_without_preload_content( + self, + id: Annotated[str, Field(min_length=10, strict=True, max_length=36, description="The ID of the test template")], + 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: + """Delete a test template + + Deletes a test template using its ID. + + :param id: The ID of the test template (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_test_template_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_test_template_serialize( + self, + 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 id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/tests/templates/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def deploy_user_template( + self, + id: Annotated[str, Field(min_length=10, strict=True, max_length=36, description="The ID of the test template")], + deploy_test_template: Annotated[DeployTestTemplate, Field(description="Deploy test template")], + 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, + ) -> None: + """Deploy a test template. + + Deploys a test template to create tests, alert rules, and dashboards defined by the template. You can deploy templates to easily create new tests. To deploy test templates, you must specify `userInputValues` required by the template in the request body. `userInputValues` enables you to specify a minimum set of user values required to configure the tests from a test template. This way, you do not have to edit all the details of each test configuration. If necessary, you can edit the test details directly in the template. ### Considerations Consider the following when deploying a test template: * To deploy a test template, you must first create the template or use one of ThousandEyes' predefined test templates. * The deployment strategy allows you to specify what should happen to a particular asset in the event that a test template is redeployed. When you attempt to deploy a test template that has already been deployed, the API service compares any assets that have not yet been deployed with the assets that were deployed in the previous deployment (the comparison is done using the **asset key**; the asset keys are simply the object keys used in the `tests`, `labels`, `alertRules`, and `dashboards` fields). By default, if the configuration of a particular asset has not changed from the previous deployment, that asset is ignored. If a change is detected: * If the asset is a test, a new test is created with the new configuration. * If the asset is not a test, the asset is updated. * You can create new resources such as tests, alert rules, labels, dashboards, and modify existing resources defined in test templates, overwriting the default configurations. * You can also use existing resources (such as those created outside the test template deployment flow) by adding their ID either in the raw test template or using the overrides when deploying the template. See example usage below for the raw test template sample. **Note**: The test template API does not currently track \"live\" configuration of assets. Any changes made to assets outside of the test template API will not be considered when comparing changes during the redeployment scenario. ### Example usage: ```POST /v7/tests/templates/fcbb89a7-61cf-4616-9c4f-828fa3cb4684/deploy { \"userInputValues\": { \"interval\": 120, \"target\": \"https://microsoft.com\", \"agents\": [{\"agentId\":11}], \"domain\": \"microsoft.com\" }, \"name\":\"Microsoft Suite\", \"tests\": { \"secondPageLoadTest\": { \"httpInterval\": 120, \"interval\": 120, \"testId\": 182481, \"type\": \"page-load\", \"url\": \"https://microsoft.com\", \"testName\": \"Microsoft Suite - Second Page Load\", \"agents\": [ { \"agentId\": 11 } ] } } } ``` #### Raw Test Template Sample ``` { ... \"tests\": { \"existingTest\": { \"testId\": \"123\", //The API will only try to update this test; will never create it \"type\": \"http-server\", .... }, ... }, ... } ``` + + :param id: The ID of the test template (required) + :type id: str + :param deploy_test_template: Deploy test template (required) + :type deploy_test_template: DeployTestTemplate + :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._deploy_user_template_serialize( + id=id, + deploy_test_template=deploy_test_template, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 deploy_user_template_with_http_info( + self, + id: Annotated[str, Field(min_length=10, strict=True, max_length=36, description="The ID of the test template")], + deploy_test_template: Annotated[DeployTestTemplate, Field(description="Deploy test template")], + 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[None]: + """Deploy a test template. + + Deploys a test template to create tests, alert rules, and dashboards defined by the template. You can deploy templates to easily create new tests. To deploy test templates, you must specify `userInputValues` required by the template in the request body. `userInputValues` enables you to specify a minimum set of user values required to configure the tests from a test template. This way, you do not have to edit all the details of each test configuration. If necessary, you can edit the test details directly in the template. ### Considerations Consider the following when deploying a test template: * To deploy a test template, you must first create the template or use one of ThousandEyes' predefined test templates. * The deployment strategy allows you to specify what should happen to a particular asset in the event that a test template is redeployed. When you attempt to deploy a test template that has already been deployed, the API service compares any assets that have not yet been deployed with the assets that were deployed in the previous deployment (the comparison is done using the **asset key**; the asset keys are simply the object keys used in the `tests`, `labels`, `alertRules`, and `dashboards` fields). By default, if the configuration of a particular asset has not changed from the previous deployment, that asset is ignored. If a change is detected: * If the asset is a test, a new test is created with the new configuration. * If the asset is not a test, the asset is updated. * You can create new resources such as tests, alert rules, labels, dashboards, and modify existing resources defined in test templates, overwriting the default configurations. * You can also use existing resources (such as those created outside the test template deployment flow) by adding their ID either in the raw test template or using the overrides when deploying the template. See example usage below for the raw test template sample. **Note**: The test template API does not currently track \"live\" configuration of assets. Any changes made to assets outside of the test template API will not be considered when comparing changes during the redeployment scenario. ### Example usage: ```POST /v7/tests/templates/fcbb89a7-61cf-4616-9c4f-828fa3cb4684/deploy { \"userInputValues\": { \"interval\": 120, \"target\": \"https://microsoft.com\", \"agents\": [{\"agentId\":11}], \"domain\": \"microsoft.com\" }, \"name\":\"Microsoft Suite\", \"tests\": { \"secondPageLoadTest\": { \"httpInterval\": 120, \"interval\": 120, \"testId\": 182481, \"type\": \"page-load\", \"url\": \"https://microsoft.com\", \"testName\": \"Microsoft Suite - Second Page Load\", \"agents\": [ { \"agentId\": 11 } ] } } } ``` #### Raw Test Template Sample ``` { ... \"tests\": { \"existingTest\": { \"testId\": \"123\", //The API will only try to update this test; will never create it \"type\": \"http-server\", .... }, ... }, ... } ``` + + :param id: The ID of the test template (required) + :type id: str + :param deploy_test_template: Deploy test template (required) + :type deploy_test_template: DeployTestTemplate + :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._deploy_user_template_serialize( + id=id, + deploy_test_template=deploy_test_template, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 deploy_user_template_without_preload_content( + self, + id: Annotated[str, Field(min_length=10, strict=True, max_length=36, description="The ID of the test template")], + deploy_test_template: Annotated[DeployTestTemplate, Field(description="Deploy test template")], + 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: + """Deploy a test template. + + Deploys a test template to create tests, alert rules, and dashboards defined by the template. You can deploy templates to easily create new tests. To deploy test templates, you must specify `userInputValues` required by the template in the request body. `userInputValues` enables you to specify a minimum set of user values required to configure the tests from a test template. This way, you do not have to edit all the details of each test configuration. If necessary, you can edit the test details directly in the template. ### Considerations Consider the following when deploying a test template: * To deploy a test template, you must first create the template or use one of ThousandEyes' predefined test templates. * The deployment strategy allows you to specify what should happen to a particular asset in the event that a test template is redeployed. When you attempt to deploy a test template that has already been deployed, the API service compares any assets that have not yet been deployed with the assets that were deployed in the previous deployment (the comparison is done using the **asset key**; the asset keys are simply the object keys used in the `tests`, `labels`, `alertRules`, and `dashboards` fields). By default, if the configuration of a particular asset has not changed from the previous deployment, that asset is ignored. If a change is detected: * If the asset is a test, a new test is created with the new configuration. * If the asset is not a test, the asset is updated. * You can create new resources such as tests, alert rules, labels, dashboards, and modify existing resources defined in test templates, overwriting the default configurations. * You can also use existing resources (such as those created outside the test template deployment flow) by adding their ID either in the raw test template or using the overrides when deploying the template. See example usage below for the raw test template sample. **Note**: The test template API does not currently track \"live\" configuration of assets. Any changes made to assets outside of the test template API will not be considered when comparing changes during the redeployment scenario. ### Example usage: ```POST /v7/tests/templates/fcbb89a7-61cf-4616-9c4f-828fa3cb4684/deploy { \"userInputValues\": { \"interval\": 120, \"target\": \"https://microsoft.com\", \"agents\": [{\"agentId\":11}], \"domain\": \"microsoft.com\" }, \"name\":\"Microsoft Suite\", \"tests\": { \"secondPageLoadTest\": { \"httpInterval\": 120, \"interval\": 120, \"testId\": 182481, \"type\": \"page-load\", \"url\": \"https://microsoft.com\", \"testName\": \"Microsoft Suite - Second Page Load\", \"agents\": [ { \"agentId\": 11 } ] } } } ``` #### Raw Test Template Sample ``` { ... \"tests\": { \"existingTest\": { \"testId\": \"123\", //The API will only try to update this test; will never create it \"type\": \"http-server\", .... }, ... }, ... } ``` + + :param id: The ID of the test template (required) + :type id: str + :param deploy_test_template: Deploy test template (required) + :type deploy_test_template: DeployTestTemplate + :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._deploy_user_template_serialize( + id=id, + deploy_test_template=deploy_test_template, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _deploy_user_template_serialize( + self, + id, + deploy_test_template, + 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 id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if deploy_test_template is not None: + _body_params = deploy_test_template + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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/tests/templates/{id}/deploy', + 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_user_org_test_template( + self, + id: Annotated[str, Field(min_length=10, strict=True, max_length=36, description="The ID of the test template")], + 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, + ) -> TestTemplate: + """Retrieve a test template + + Retrieves a test template using its ID. + + :param id: The ID of the test template (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_org_test_template_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestTemplate", + '400': "ApiError", + '401': "UnauthorizedError", + '403': "ApiError", + '404': "NotFoundError", + '500': "ApiError" + + } + 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_user_org_test_template_with_http_info( + self, + id: Annotated[str, Field(min_length=10, strict=True, max_length=36, description="The ID of the test template")], + 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[TestTemplate]: + """Retrieve a test template + + Retrieves a test template using its ID. + + :param id: The ID of the test template (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_org_test_template_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestTemplate", + '400': "ApiError", + '401': "UnauthorizedError", + '403': "ApiError", + '404': "NotFoundError", + '500': "ApiError" + + } + 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_user_org_test_template_without_preload_content( + self, + id: Annotated[str, Field(min_length=10, strict=True, max_length=36, description="The ID of the test template")], + 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 a test template + + Retrieves a test template using its ID. + + :param id: The ID of the test template (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_org_test_template_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestTemplate", + '400': "ApiError", + '401': "UnauthorizedError", + '403': "ApiError", + '404': "NotFoundError", + '500': "ApiError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_user_org_test_template_serialize( + self, + 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 id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/tests/templates/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_user_org_test_templates( + 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, + ) -> TestTemplateCollection: + """List all test templates. + + Retrieves a list of all your test templates + + :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_user_org_test_templates_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': "TestTemplateCollection", + '400': "ApiError", + '401': "UnauthorizedError", + '403': "ApiError", + '404': "ApiError", + '500': "ApiError" + + } + 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_user_org_test_templates_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[TestTemplateCollection]: + """List all test templates. + + Retrieves a list of all your test templates + + :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_user_org_test_templates_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': "TestTemplateCollection", + '400': "ApiError", + '401': "UnauthorizedError", + '403': "ApiError", + '404': "ApiError", + '500': "ApiError" + + } + 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_user_org_test_templates_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 all test templates. + + Retrieves a list of all your test templates + + :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_user_org_test_templates_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': "TestTemplateCollection", + '400': "ApiError", + '401': "UnauthorizedError", + '403': "ApiError", + '404': "ApiError", + '500': "ApiError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_user_org_test_templates_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/tests/templates', + 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 update_test_template( + self, + id: Annotated[str, Field(min_length=10, strict=True, max_length=36, description="The ID of the test template")], + test_template_upsert: Annotated[TestTemplateUpsert, Field(description="The test template to create or update.")], + 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, + ) -> TestTemplate: + """Update a test template + + Updates an existing test template. This operation overwrites the existing test template object with the object sent in the request. If a partial update is required, it is recommended that you retrieve the test template and modify the test template object before updating it. + + :param id: The ID of the test template (required) + :type id: str + :param test_template_upsert: The test template to create or update. (required) + :type test_template_upsert: TestTemplateUpsert + :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._update_test_template_serialize( + id=id, + test_template_upsert=test_template_upsert, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestTemplate", + '400': "BadRequestError", + '401': "UnauthorizedError", + '403': "ApiError", + '404': "NotFoundError", + '500': "ApiError" + + } + 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 update_test_template_with_http_info( + self, + id: Annotated[str, Field(min_length=10, strict=True, max_length=36, description="The ID of the test template")], + test_template_upsert: Annotated[TestTemplateUpsert, Field(description="The test template to create or update.")], + 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[TestTemplate]: + """Update a test template + + Updates an existing test template. This operation overwrites the existing test template object with the object sent in the request. If a partial update is required, it is recommended that you retrieve the test template and modify the test template object before updating it. + + :param id: The ID of the test template (required) + :type id: str + :param test_template_upsert: The test template to create or update. (required) + :type test_template_upsert: TestTemplateUpsert + :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._update_test_template_serialize( + id=id, + test_template_upsert=test_template_upsert, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestTemplate", + '400': "BadRequestError", + '401': "UnauthorizedError", + '403': "ApiError", + '404': "NotFoundError", + '500': "ApiError" + + } + 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 update_test_template_without_preload_content( + self, + id: Annotated[str, Field(min_length=10, strict=True, max_length=36, description="The ID of the test template")], + test_template_upsert: Annotated[TestTemplateUpsert, Field(description="The test template to create or update.")], + 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: + """Update a test template + + Updates an existing test template. This operation overwrites the existing test template object with the object sent in the request. If a partial update is required, it is recommended that you retrieve the test template and modify the test template object before updating it. + + :param id: The ID of the test template (required) + :type id: str + :param test_template_upsert: The test template to create or update. (required) + :type test_template_upsert: TestTemplateUpsert + :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._update_test_template_serialize( + id=id, + test_template_upsert=test_template_upsert, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestTemplate", + '400': "BadRequestError", + '401': "UnauthorizedError", + '403': "ApiError", + '404': "NotFoundError", + '500': "ApiError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_test_template_serialize( + self, + id, + test_template_upsert, + 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 id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if test_template_upsert is not None: + _body_params = test_template_upsert + + + # 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='PUT', + resource_path='/v7/tests/templates/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/test_templates_api/test_templates_api/api_client.py b/test_templates_api/test_templates_api/api_client.py new file mode 100644 index 00000000..2e78e91a --- /dev/null +++ b/test_templates_api/test_templates_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 test_templates_api.configuration import Configuration +from test_templates_api.api_response import ApiResponse +import test_templates_api.models +from test_templates_api import rest +from test_templates_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(test_templates_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) diff --git a/test_templates_api/test_templates_api/api_response.py b/test_templates_api/test_templates_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/test_templates_api/test_templates_api/api_response.py @@ -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 + } diff --git a/test_templates_api/test_templates_api/configuration.py b/test_templates_api/test_templates_api/configuration.py new file mode 100644 index 00000000..07be2fd1 --- /dev/null +++ b/test_templates_api/test_templates_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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("test_templates_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.1\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 diff --git a/test_templates_api/test_templates_api/exceptions.py b/test_templates_api/test_templates_api/exceptions.py new file mode 100644 index 00000000..b4df2d30 --- /dev/null +++ b/test_templates_api/test_templates_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 diff --git a/test_templates_api/test_templates_api/models/__init__.py b/test_templates_api/test_templates_api/models/__init__.py new file mode 100644 index 00000000..b3e6b12c --- /dev/null +++ b/test_templates_api/test_templates_api/models/__init__.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +# flake8: noqa +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from test_templates_api.models.api_error import ApiError +from test_templates_api.models.bad_request_error import BadRequestError +from test_templates_api.models.deploy_test_template import DeployTestTemplate +from test_templates_api.models.deploy_test_template_tests import DeployTestTemplateTests +from test_templates_api.models.deploy_test_template_user_input_values import DeployTestTemplateUserInputValues +from test_templates_api.models.deployment_strategy import DeploymentStrategy +from test_templates_api.models.link import Link +from test_templates_api.models.not_found_error import NotFoundError +from test_templates_api.models.test_template import TestTemplate +from test_templates_api.models.test_template_collection import TestTemplateCollection +from test_templates_api.models.test_template_collection_links import TestTemplateCollectionLinks +from test_templates_api.models.test_template_collection_links_self import TestTemplateCollectionLinksSelf +from test_templates_api.models.test_template_upsert import TestTemplateUpsert +from test_templates_api.models.unauthorized_error import UnauthorizedError +from test_templates_api.models.user_input import UserInput +from test_templates_api.models.user_input_default_value import UserInputDefaultValue +from test_templates_api.models.user_input_type import UserInputType diff --git a/test_templates_api/test_templates_api/models/api_error.py b/test_templates_api/test_templates_api/models/api_error.py new file mode 100644 index 00000000..ae84f1aa --- /dev/null +++ b/test_templates_api/test_templates_api/models/api_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 ApiError(BaseModel): + """ + ApiError + """ # noqa: E501 + message: Optional[StrictStr] = None + errors: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["message", "errors"] + + 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 ApiError 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 ApiError 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"), + "errors": obj.get("errors") + }) + return _obj + + diff --git a/test_templates_api/test_templates_api/models/bad_request_error.py b/test_templates_api/test_templates_api/models/bad_request_error.py new file mode 100644 index 00000000..f50f869b --- /dev/null +++ b/test_templates_api/test_templates_api/models/bad_request_error.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class BadRequestError(BaseModel): + """ + BadRequestError + """ # noqa: E501 + timestamp: Optional[StrictInt] = None + status: Optional[StrictInt] = None + error: Optional[StrictStr] = None + path: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["timestamp", "status", "error", "path"] + + 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 BadRequestError 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 BadRequestError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "status": obj.get("status"), + "error": obj.get("error"), + "path": obj.get("path") + }) + return _obj + + diff --git a/test_templates_api/test_templates_api/models/deploy_test_template.py b/test_templates_api/test_templates_api/models/deploy_test_template.py new file mode 100644 index 00000000..95f00fe6 --- /dev/null +++ b/test_templates_api/test_templates_api/models/deploy_test_template.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 test_templates_api.models.deploy_test_template_tests import DeployTestTemplateTests +from test_templates_api.models.deploy_test_template_user_input_values import DeployTestTemplateUserInputValues +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DeployTestTemplate(BaseModel): + """ + DeployTestTemplate + """ # noqa: E501 + user_input_values: Optional[DeployTestTemplateUserInputValues] = Field(default=None, alias="userInputValues") + name: Optional[StrictStr] = None + tests: Optional[DeployTestTemplateTests] = None + __properties: ClassVar[List[str]] = ["userInputValues", "name", "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 DeployTestTemplate 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 user_input_values + if self.user_input_values: + _dict['userInputValues'] = self.user_input_values.to_dict() + # override the default output from pydantic by calling `to_dict()` of tests + if self.tests: + _dict['tests'] = self.tests.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DeployTestTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "userInputValues": DeployTestTemplateUserInputValues.from_dict(obj.get("userInputValues")) if obj.get("userInputValues") is not None else None, + "name": obj.get("name"), + "tests": DeployTestTemplateTests.from_dict(obj.get("tests")) if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/test_templates_api/test_templates_api/models/deploy_test_template_tests.py b/test_templates_api/test_templates_api/models/deploy_test_template_tests.py new file mode 100644 index 00000000..8ef635e6 --- /dev/null +++ b/test_templates_api/test_templates_api/models/deploy_test_template_tests.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DeployTestTemplateTests(BaseModel): + """ + DeployTestTemplateTests + """ # noqa: E501 + interval: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["interval"] + + 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 DeployTestTemplateTests 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 DeployTestTemplateTests 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") + }) + return _obj + + diff --git a/test_templates_api/test_templates_api/models/deploy_test_template_user_input_values.py b/test_templates_api/test_templates_api/models/deploy_test_template_user_input_values.py new file mode 100644 index 00000000..62e50aa6 --- /dev/null +++ b/test_templates_api/test_templates_api/models/deploy_test_template_user_input_values.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DeployTestTemplateUserInputValues(BaseModel): + """ + DeployTestTemplateUserInputValues + """ # noqa: E501 + interval: Optional[StrictInt] = None + target: Optional[StrictStr] = None + agents: Optional[StrictStr] = None + domain: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["interval", "target", "agents", "domain"] + + 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 DeployTestTemplateUserInputValues 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 DeployTestTemplateUserInputValues 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"), + "target": obj.get("target"), + "agents": obj.get("agents"), + "domain": obj.get("domain") + }) + return _obj + + diff --git a/test_templates_api/test_templates_api/models/deployment_strategy.py b/test_templates_api/test_templates_api/models/deployment_strategy.py new file mode 100644 index 00000000..5d6e3115 --- /dev/null +++ b/test_templates_api/test_templates_api/models/deployment_strategy.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 DeploymentStrategy(str, Enum): + """ + The `deploymentStrategy` field defines how the system behaves when an asset (test, label, dashboard) defined in the template already exists. For tests, the system uses the test type and name to determine if a test already exists. For example, if a template contains an http-server test named `Test123` and an http-server test with the same name already exists, the system assumes that this test already exists. If the test had a different type (for example, page-load), then the system would not consider the test to already exist because the types are different. For Labels and Dashboards, the system uses only the name. (Note that current Test Templates only consider \"test\" Labels). Alert Rules do not currently support `deploymentStrategy`. Below are the possible deployment strategies and their behaviors: * `Create Always` - The system will always attempt to create the asset. If an asset of the same name and type already exists, the system will generate an error. This behavior ensures that each asset created from a template is unique. This is the default behavior. * `Update on Change` - If an asset of the same type and name already exists, the existing asset is used instead of creating a new asset. If the configuration of the asset in the template is different from the existing one, the latest configuration is applied. * `Ignore on Change` - If an asset of the same type and name already exists, the existing asset is used instead of creating a new asset. If the configuration of the asset in the template is different from the existing one, the configuration of the existing asset is used and the configuration in the template is ignored. The `Update on Change` and `Ignore on Change` strategies essentially allow assets to be shared across templates. For example, the built-in \"Custom Web Page\", \"Custom Web Server\", and \"Custom Device\" templates all contain a Dashboard asset called \"Health Overview\". It's `deploymentStrategy` is set to `Ignore on Change`, which means that the first deployment of a template such as the \"Custom Web Page\" template creates the \"Health Overview\" dashboard. Subsequent deployments of the \"Custom Web Page\" template do not attempt to recreate the \"Health Overview\" dashboard. Instead, the existing dashboard is reused. Note: Assets that were not created using a template are not included when the system searches for existing assets; they are not used with `Update on Change` or `Ignore on Change`. + """ + + """ + allowed enum values + """ + CREATE_ON_CHANGE = 'Create on Change' + UPDATE_ON_CHANGE = 'Update on Change' + IGNORE_ON_CHANGE = 'Ignore on Change' + CREATE_ALWAYS = 'Create Always' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DeploymentStrategy from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/test_templates_api/test_templates_api/models/link.py b/test_templates_api/test_templates_api/models/link.py new file mode 100644 index 00000000..39e7ed88 --- /dev/null +++ b/test_templates_api/test_templates_api/models/link.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Link(BaseModel): + """ + Link + """ # noqa: E501 + href: Optional[StrictStr] = None + hreflang: Optional[StrictStr] = None + title: Optional[StrictStr] = None + type: Optional[StrictStr] = None + deprecation: Optional[StrictStr] = None + profile: Optional[StrictStr] = None + name: Optional[StrictStr] = None + templated: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["href", "hreflang", "title", "type", "deprecation", "profile", "name", "templated"] + + 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"), + "hreflang": obj.get("hreflang"), + "title": obj.get("title"), + "type": obj.get("type"), + "deprecation": obj.get("deprecation"), + "profile": obj.get("profile"), + "name": obj.get("name"), + "templated": obj.get("templated") + }) + return _obj + + diff --git a/test_templates_api/test_templates_api/models/not_found_error.py b/test_templates_api/test_templates_api/models/not_found_error.py new file mode 100644 index 00000000..f5a504b0 --- /dev/null +++ b/test_templates_api/test_templates_api/models/not_found_error.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 NotFoundError(BaseModel): + """ + NotFoundError + """ # noqa: E501 + message: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["message"] + + 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 NotFoundError 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 NotFoundError 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") + }) + return _obj + + diff --git a/test_templates_api/test_templates_api/models/test_template.py b/test_templates_api/test_templates_api/models/test_template.py new file mode 100644 index 00000000..80092dc7 --- /dev/null +++ b/test_templates_api/test_templates_api/models/test_template.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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, Union +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from test_templates_api.models.deployment_strategy import DeploymentStrategy +from test_templates_api.models.link import Link +from test_templates_api.models.user_input import UserInput +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestTemplate(BaseModel): + """ + TestTemplate + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The ID of the test template.") + name: Optional[StrictStr] = Field(default=None, description="The name of the test template.") + description: Optional[StrictStr] = Field(default=None, description="Text that describes the test template.") + icon: Optional[StrictStr] = Field(default=None, description="Icon for the test template; will be displayed in the UI.") + is_built_in: Optional[StrictBool] = Field(default=None, description="Indicates whether the test template is a built-in template. Note that built-in test templates are read-only.", alias="isBuiltIn") + certification_level: Optional[StrictStr] = Field(default=None, alias="certificationLevel") + date_created: Optional[StrictStr] = Field(default=None, description="The date and time the test template was created.", alias="dateCreated") + user_inputs: Optional[Dict[str, UserInput]] = Field(default=None, alias="userInputs") + labels: Optional[Union[str, Any]] = Field(default=None, description="A map of .") + tests: Optional[Union[str, Any]] = Field(default=None, description="A map of .") + alert_rules: Optional[Union[str, Any]] = Field(default=None, description="A map of .", alias="alertRules") + dashboards: Optional[Union[str, Any]] = Field(default=None, description="A map of .") + deployment_strategy: Optional[Dict[str, DeploymentStrategy]] = Field(default=None, description="A map of .", alias="deploymentStrategy") + links: Optional[Dict[str, Link]] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["id", "name", "description", "icon", "isBuiltIn", "certificationLevel", "dateCreated", "userInputs", "labels", "tests", "alertRules", "dashboards", "deploymentStrategy", "_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 TestTemplate 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 value in user_inputs (dict) + _field_dict = {} + if self.user_inputs: + for _key in self.user_inputs: + if self.user_inputs[_key]: + _field_dict[_key] = self.user_inputs[_key].to_dict() + _dict['userInputs'] = _field_dict + # override the default output from pydantic by calling `to_dict()` of each value in links (dict) + _field_dict = {} + if self.links: + for _key in self.links: + if self.links[_key]: + _field_dict[_key] = self.links[_key].to_dict() + _dict['_links'] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of TestTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "description": obj.get("description"), + "icon": obj.get("icon"), + "isBuiltIn": obj.get("isBuiltIn"), + "certificationLevel": obj.get("certificationLevel"), + "dateCreated": obj.get("dateCreated"), + "userInputs": dict( + (_k, UserInput.from_dict(_v)) + for _k, _v in obj.get("userInputs").items() + ) + if obj.get("userInputs") is not None + else None, + "labels": obj.get("labels"), + "tests": obj.get("tests"), + "alertRules": obj.get("alertRules"), + "dashboards": obj.get("dashboards"), + "deploymentStrategy": dict((_k, _v) for _k, _v in obj.get("deploymentStrategy").items()), + "_links": dict( + (_k, Link.from_dict(_v)) + for _k, _v in obj.get("_links").items() + ) + if obj.get("_links") is not None + else None + }) + return _obj + + diff --git a/test_templates_api/test_templates_api/models/test_template_collection.py b/test_templates_api/test_templates_api/models/test_template_collection.py new file mode 100644 index 00000000..e0f97b28 --- /dev/null +++ b/test_templates_api/test_templates_api/models/test_template_collection.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 test_templates_api.models.test_template import TestTemplate +from test_templates_api.models.test_template_collection_links import TestTemplateCollectionLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestTemplateCollection(BaseModel): + """ + TestTemplateCollection + """ # noqa: E501 + templates: Optional[List[TestTemplate]] = None + links: Optional[TestTemplateCollectionLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["templates", "_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 TestTemplateCollection 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 templates (list) + _items = [] + if self.templates: + for _item in self.templates: + if _item: + _items.append(_item.to_dict()) + _dict['templates'] = _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 TestTemplateCollection from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "templates": [TestTemplate.from_dict(_item) for _item in obj.get("templates")] if obj.get("templates") is not None else None, + "_links": TestTemplateCollectionLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/test_templates_api/test_templates_api/models/test_template_collection_links.py b/test_templates_api/test_templates_api/models/test_template_collection_links.py new file mode 100644 index 00000000..7094a110 --- /dev/null +++ b/test_templates_api/test_templates_api/models/test_template_collection_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 test_templates_api.models.test_template_collection_links_self import TestTemplateCollectionLinksSelf +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestTemplateCollectionLinks(BaseModel): + """ + TestTemplateCollectionLinks + """ # noqa: E501 + var_self: Optional[TestTemplateCollectionLinksSelf] = 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 TestTemplateCollectionLinks 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 TestTemplateCollectionLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": TestTemplateCollectionLinksSelf.from_dict(obj.get("self")) if obj.get("self") is not None else None + }) + return _obj + + diff --git a/test_templates_api/test_templates_api/models/test_template_collection_links_self.py b/test_templates_api/test_templates_api/models/test_template_collection_links_self.py new file mode 100644 index 00000000..cc30a1c0 --- /dev/null +++ b/test_templates_api/test_templates_api/models/test_template_collection_links_self.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 TestTemplateCollectionLinksSelf(BaseModel): + """ + TestTemplateCollectionLinksSelf + """ # noqa: E501 + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href"] + + 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 TestTemplateCollectionLinksSelf 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 TestTemplateCollectionLinksSelf 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") + }) + return _obj + + diff --git a/test_templates_api/test_templates_api/models/test_template_upsert.py b/test_templates_api/test_templates_api/models/test_template_upsert.py new file mode 100644 index 00000000..1e19221c --- /dev/null +++ b/test_templates_api/test_templates_api/models/test_template_upsert.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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, Union +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from test_templates_api.models.deployment_strategy import DeploymentStrategy +from test_templates_api.models.user_input import UserInput +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestTemplateUpsert(BaseModel): + """ + The test template to create or update. + """ # noqa: E501 + name: StrictStr = Field(description="The name of the test template.") + description: Optional[StrictStr] = Field(default=None, description="Text that describes the test template.") + icon: Optional[StrictStr] = Field(default=None, description="Icon for the test template; will be displayed in the UI.") + is_built_in: Optional[StrictBool] = Field(default=None, description="Indicates whether the test template is a built-in template. Note that built-in test templates are read-only.", alias="isBuiltIn") + user_inputs: Optional[Dict[str, UserInput]] = Field(default=None, alias="userInputs") + labels: Optional[Union[str, Any]] = Field(default=None, description="A map of .") + tests: Optional[Union[str, Any]] = Field(default=None, description="A map of .") + alert_rules: Optional[Union[str, Any]] = Field(default=None, description="A map of .", alias="alertRules") + dashboards: Optional[Union[str, Any]] = Field(default=None, description="A map of .") + deployment_strategy: Optional[Dict[str, DeploymentStrategy]] = Field(default=None, description="A map of .", alias="deploymentStrategy") + __properties: ClassVar[List[str]] = ["name", "description", "icon", "isBuiltIn", "userInputs", "labels", "tests", "alertRules", "dashboards", "deploymentStrategy"] + + 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 TestTemplateUpsert 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 value in user_inputs (dict) + _field_dict = {} + if self.user_inputs: + for _key in self.user_inputs: + if self.user_inputs[_key]: + _field_dict[_key] = self.user_inputs[_key].to_dict() + _dict['userInputs'] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of TestTemplateUpsert from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "description": obj.get("description"), + "icon": obj.get("icon"), + "isBuiltIn": obj.get("isBuiltIn"), + "userInputs": dict( + (_k, UserInput.from_dict(_v)) + for _k, _v in obj.get("userInputs").items() + ) + if obj.get("userInputs") is not None + else None, + "labels": obj.get("labels"), + "tests": obj.get("tests"), + "alertRules": obj.get("alertRules"), + "dashboards": obj.get("dashboards"), + "deploymentStrategy": dict((_k, _v) for _k, _v in obj.get("deploymentStrategy").items()) + }) + return _obj + + diff --git a/test_templates_api/test_templates_api/models/unauthorized_error.py b/test_templates_api/test_templates_api/models/unauthorized_error.py new file mode 100644 index 00000000..0da3f7db --- /dev/null +++ b/test_templates_api/test_templates_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 + + diff --git a/test_templates_api/test_templates_api/models/user_input.py b/test_templates_api/test_templates_api/models/user_input.py new file mode 100644 index 00000000..0f653d5e --- /dev/null +++ b/test_templates_api/test_templates_api/models/user_input.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 test_templates_api.models.user_input_default_value import UserInputDefaultValue +from test_templates_api.models.user_input_type import UserInputType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UserInput(BaseModel): + """ + The set of inputs that the user must fill in to use the test template. These inputs are provided by the user when creating a set of tests via the test template API or via the UI. The UI dynamically displays these user inputs for the user to input. + """ # noqa: E501 + name: StrictStr = Field(description="The name of the user input field.") + title: Optional[StrictStr] = Field(default=None, description="The title of the user input field; may be used by UI.") + description: Optional[StrictStr] = Field(default=None, description="Description of the user input field; used by UI.") + default_value: Optional[UserInputDefaultValue] = Field(default=None, alias="defaultValue") + type: UserInputType + __properties: ClassVar[List[str]] = ["name", "title", "description", "defaultValue", "type"] + + 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 UserInput 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 default_value + if self.default_value: + _dict['defaultValue'] = self.default_value.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of UserInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "title": obj.get("title"), + "description": obj.get("description"), + "defaultValue": UserInputDefaultValue.from_dict(obj.get("defaultValue")) if obj.get("defaultValue") is not None else None, + "type": obj.get("type") + }) + return _obj + + diff --git a/test_templates_api/test_templates_api/models/user_input_default_value.py b/test_templates_api/test_templates_api/models/user_input_default_value.py new file mode 100644 index 00000000..2f1cb529 --- /dev/null +++ b/test_templates_api/test_templates_api/models/user_input_default_value.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +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 + +USERINPUTDEFAULTVALUE_ONE_OF_SCHEMAS = ["float", "str"] + +class UserInputDefaultValue(BaseModel): + """ + Default value of user input field. + """ + # data type: str + oneof_schema_1_validator: Optional[StrictStr] = None + # data type: float + oneof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None + actual_instance: Optional[Union[float, str]] = None + one_of_schemas: List[str] = Literal["float", "str"] + + 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 = UserInputDefaultValue.model_construct() + error_messages = [] + match = 0 + # validate data type: str + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: float + try: + instance.oneof_schema_2_validator = v + 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 setting `actual_instance` in UserInputDefaultValue with oneOf schemas: float, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in UserInputDefaultValue with oneOf schemas: float, str. 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 str + 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 float + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + 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 UserInputDefaultValue with oneOf schemas: float, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into UserInputDefaultValue with oneOf schemas: float, str. 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()) + + diff --git a/test_templates_api/test_templates_api/models/user_input_type.py b/test_templates_api/test_templates_api/models/user_input_type.py new file mode 100644 index 00000000..3f558355 --- /dev/null +++ b/test_templates_api/test_templates_api/models/user_input_type.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 UserInputType(str, Enum): + """ + The type of user input field. This is used to validate the user values provided when deploying a template. - \"string\": A string based user input. E.g., `\"https://google.com\"` - \"number\": A number based user input. E.g., `25.8` - \"boolean\": A boolean based user input. E.g., `false` - \"string[]\": A list of string based user inputs. E.g., `[\"someId\", \"someOtherId\"]` - \"number[]\": A list of number based user inputs. E.g., `[1, 2.3, 5000]` - \"boolean[]\": A list of boolean based user inputs. E.g., `[true, false]` - \"any\": For any other user inputs that don't belong to the types listed above. E.g., `[{\"agentId\": 22}]` + """ + + """ + allowed enum values + """ + STRING = 'string' + NUMBER = 'number' + BOOLEAN = 'boolean' + STRING_LEFT_SQUARE_BRACKET_RIGHT_SQUARE_BRACKET = 'string[]' + NUMBER_LEFT_SQUARE_BRACKET_RIGHT_SQUARE_BRACKET = 'number[]' + BOOLEAN_LEFT_SQUARE_BRACKET_RIGHT_SQUARE_BRACKET = 'boolean[]' + AGENTSELECTIONCONFIG = 'agentSelectionConfig' + ANY = 'any' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of UserInputType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/test_templates_api/test_templates_api/py.typed b/test_templates_api/test_templates_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/test_templates_api/test_templates_api/rest.py b/test_templates_api/test_templates_api/rest.py new file mode 100644 index 00000000..48d6c718 --- /dev/null +++ b/test_templates_api/test_templates_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Test Template + + ## Overview Test templates allow you create a set of tests, alert rules, dashboards, and labels from a single template configuration file. The following applies to test templates: * You can create tests for monitoring common services and applications such as Microsoft 365, Webex, and others using a predefined set of certified templates. * Test templates reduce the time and complexity of creating tests for common SaaS or other services by providing a set of templates for creating tests, alert rules, and other assets within the ThousandEyes platform. * Templates created with an account group in a particular organization are visible to all account groups in that organization, provided they have the `View Test Templates` permission. * Credentials (usernames, passwords, tokens, etc.) can be included in a test template only as placeholders whose value is provided by user input when the template is deployed. Creating or updating a test template that contains a credentials field in plain text will result in a bad request (HTTP 400). * The schemas to use for `labels`, `tests`, `alertRules` and `dashboards` are defined at https://developer.thousandeyes.com/v7/. * To support referencing an asset from another asset of a different type (for example, defining the `testId` field of an `alertRule` by referencing the ID of a test defined in the template itself), the deployment of assets is done in a specific order: 1. Labels 2. Tests 3. Alert rules 4. Dashboards For a given asset type, you can reference any asset type with a higher order. (For example, labels cannot reference other assets in the template; tests can only reference labels; alert rules can reference tests and labels, etc.) + + The version of the OpenAPI document: 7.0.1 + 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 test_templates_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) diff --git a/test_templates_api/tox.ini b/test_templates_api/tox.ini new file mode 100644 index 00000000..dbc059b4 --- /dev/null +++ b/test_templates_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=test_templates_api diff --git a/tests_api/.github/workflows/python.yml b/tests_api/.github/workflows/python.yml new file mode 100644 index 00000000..939fd9f1 --- /dev/null +++ b/tests_api/.github/workflows/python.yml @@ -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: tests_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 diff --git a/tests_api/.gitignore b/tests_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/tests_api/.gitignore @@ -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 diff --git a/tests_api/.gitlab-ci.yml b/tests_api/.gitlab-ci.yml new file mode 100644 index 00000000..7e659eac --- /dev/null +++ b/tests_api/.gitlab-ci.yml @@ -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=tests_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 diff --git a/tests_api/.openapi-generator-ignore b/tests_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/tests_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/tests_api/.openapi-generator/FILES b/tests_api/.openapi-generator/FILES new file mode 100644 index 00000000..0380ddb5 --- /dev/null +++ b/tests_api/.openapi-generator/FILES @@ -0,0 +1,452 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/Agent.md +docs/AgentBase.md +docs/AgentToAgentApi.md +docs/AgentToAgentInstantTest.md +docs/AgentToAgentTest.md +docs/AgentToAgentTestProtocol.md +docs/AgentToAgentTests.md +docs/AgentToServerApi.md +docs/AgentToServerInstantTest.md +docs/AgentToServerTest.md +docs/AgentToServerTests.md +docs/AlertRoundsViolationMode.md +docs/AlertRule.md +docs/AlertType.md +docs/AllTestTypesApi.md +docs/BGPApi.md +docs/BaseRequest.md +docs/BaseTest.md +docs/BgpTest.md +docs/BgpTests.md +docs/CloudEnterpriseAgentType.md +docs/DNSSECApi.md +docs/DNSServerApi.md +docs/DNSTraceApi.md +docs/DnsQueryClass.md +docs/DnsSecInstantTest.md +docs/DnsSecTest.md +docs/DnsSecTests.md +docs/DnsServerInstantTest.md +docs/DnsServerTest.md +docs/DnsServerTests.md +docs/DnsTraceInstantTest.md +docs/DnsTraceTest.md +docs/DnsTraceTests.md +docs/Error.md +docs/Expand.md +docs/FTPServerApi.md +docs/FtpServerInstantTest.md +docs/FtpServerRequestType.md +docs/FtpServerTest.md +docs/FtpServerTests.md +docs/GetAgentToAgentTest200Response.md +docs/GetAgentToAgentTests200Response.md +docs/GetAgentToServerTest200Response.md +docs/GetAgentToServerTests200Response.md +docs/GetBgpTest200Response.md +docs/GetBgpTests200Response.md +docs/GetDNSServerTest200Response.md +docs/GetDNSServerTests200Response.md +docs/GetDnsSecTest200Response.md +docs/GetDnsSecTests200Response.md +docs/GetDnsTraceTest200Response.md +docs/GetDnsTraceTests200Response.md +docs/GetFtpServerTest200Response.md +docs/GetFtpServerTests200Response.md +docs/GetHttpServerTest200Response.md +docs/GetHttpServerTests200Response.md +docs/GetPageLoadTest200Response.md +docs/GetPageLoadTests200Response.md +docs/GetPathVisInterfaceGroups200Response.md +docs/GetSipServerTest200Response.md +docs/GetSipServerTests200Response.md +docs/GetTests200Response.md +docs/GetVoiceTest200Response.md +docs/GetVoiceTests200Response.md +docs/GetWebTransactionsTest200Response.md +docs/GetWebTransactionsTests200Response.md +docs/HTTPServerApi.md +docs/HttpServerInstantTest.md +docs/HttpServerTest.md +docs/HttpServerTests.md +docs/InstantTest.md +docs/InterfaceGroup.md +docs/InterfaceGroups.md +docs/Link.md +docs/MapItem.md +docs/Monitor.md +docs/MonitorType.md +docs/MonitorsRequest.md +docs/PageLoadApi.md +docs/PageLoadInstantTest.md +docs/PageLoadTest.md +docs/PageLoadTests.md +docs/PathVisualizationInterfaceGroupsApi.md +docs/SIPServerApi.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/SimpleTest.md +docs/SipServerInstantTest.md +docs/SipServerTest.md +docs/SipServerTests.md +docs/SipTestProtocol.md +docs/TestAuthType.md +docs/TestCustomHeaders.md +docs/TestCustomHeadersAll.md +docs/TestCustomHeadersRoot.md +docs/TestDirection.md +docs/TestDnsServer.md +docs/TestDnsTransportProtocol.md +docs/TestDscpId.md +docs/TestHttpInterval.md +docs/TestInterval.md +docs/TestIpv6Policy.md +docs/TestLabelsInner.md +docs/TestPageLoadingStrategy.md +docs/TestPathTraceMode.md +docs/TestProbeMode.md +docs/TestProtocol.md +docs/TestRequest.md +docs/TestRequestAllOfAgents.md +docs/TestSharedAccountsInner.md +docs/TestSipCredentials.md +docs/TestSslVersionId.md +docs/TestSubInterval.md +docs/TestType.md +docs/Tests.md +docs/UnauthorizedError.md +docs/UnexpandedInstantTest.md +docs/UnexpandedInstantTestLinks.md +docs/UnexpandedInstantTestLinksSelf.md +docs/UnexpandedInstantTestLinksTestResults.md +docs/UnexpandedTest.md +docs/UpdateAgentToAgentTest.md +docs/UpdateAgentToServerTest.md +docs/UpdateBgpTest.md +docs/UpdateDnsSecTest.md +docs/UpdateDnsServerTest.md +docs/UpdateDnsTraceTest.md +docs/UpdateFtpServerTest.md +docs/UpdateHttpServerTest.md +docs/UpdatePageLoadTest.md +docs/UpdatePathVisInterfaceGroup200Response.md +docs/UpdateSipServerTest.md +docs/UpdateVoiceTest.md +docs/UpdateWebTransactionTest.md +docs/VoiceApi.md +docs/VoiceInstantTest.md +docs/VoiceTest.md +docs/VoiceTests.md +docs/WebTransactionApi.md +docs/WebTransactionInstantTest.md +docs/WebTransactionTest.md +docs/WebTransactionTests.md +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_agent.py +test/test_agent_base.py +test/test_agent_to_agent_api.py +test/test_agent_to_agent_instant_test.py +test/test_agent_to_agent_test.py +test/test_agent_to_agent_test_protocol.py +test/test_agent_to_agent_tests.py +test/test_agent_to_server_api.py +test/test_agent_to_server_instant_test.py +test/test_agent_to_server_test.py +test/test_agent_to_server_tests.py +test/test_alert_rounds_violation_mode.py +test/test_alert_rule.py +test/test_alert_type.py +test/test_all_test_types_api.py +test/test_base_request.py +test/test_base_test.py +test/test_bgp_api.py +test/test_bgp_test.py +test/test_bgp_tests.py +test/test_cloud_enterprise_agent_type.py +test/test_dns_query_class.py +test/test_dns_sec_instant_test.py +test/test_dns_sec_test.py +test/test_dns_sec_tests.py +test/test_dns_server_api.py +test/test_dns_server_instant_test.py +test/test_dns_server_test.py +test/test_dns_server_tests.py +test/test_dns_trace_api.py +test/test_dns_trace_instant_test.py +test/test_dns_trace_test.py +test/test_dns_trace_tests.py +test/test_dnssec_api.py +test/test_error.py +test/test_expand.py +test/test_ftp_server_api.py +test/test_ftp_server_instant_test.py +test/test_ftp_server_request_type.py +test/test_ftp_server_test.py +test/test_ftp_server_tests.py +test/test_get_agent_to_agent_test200_response.py +test/test_get_agent_to_agent_tests200_response.py +test/test_get_agent_to_server_test200_response.py +test/test_get_agent_to_server_tests200_response.py +test/test_get_bgp_test200_response.py +test/test_get_bgp_tests200_response.py +test/test_get_dns_sec_test200_response.py +test/test_get_dns_sec_tests200_response.py +test/test_get_dns_server_test200_response.py +test/test_get_dns_server_tests200_response.py +test/test_get_dns_trace_test200_response.py +test/test_get_dns_trace_tests200_response.py +test/test_get_ftp_server_test200_response.py +test/test_get_ftp_server_tests200_response.py +test/test_get_http_server_test200_response.py +test/test_get_http_server_tests200_response.py +test/test_get_page_load_test200_response.py +test/test_get_page_load_tests200_response.py +test/test_get_path_vis_interface_groups200_response.py +test/test_get_sip_server_test200_response.py +test/test_get_sip_server_tests200_response.py +test/test_get_tests200_response.py +test/test_get_voice_test200_response.py +test/test_get_voice_tests200_response.py +test/test_get_web_transactions_test200_response.py +test/test_get_web_transactions_tests200_response.py +test/test_http_server_api.py +test/test_http_server_instant_test.py +test/test_http_server_test.py +test/test_http_server_tests.py +test/test_instant_test.py +test/test_interface_group.py +test/test_interface_groups.py +test/test_link.py +test/test_map_item.py +test/test_monitor.py +test/test_monitor_type.py +test/test_monitors_request.py +test/test_page_load_api.py +test/test_page_load_instant_test.py +test/test_page_load_test.py +test/test_page_load_tests.py +test/test_path_visualization_interface_groups_api.py +test/test_self_links.py +test/test_self_links_links.py +test/test_simple_test.py +test/test_sip_server_api.py +test/test_sip_server_instant_test.py +test/test_sip_server_test.py +test/test_sip_server_tests.py +test/test_sip_test_protocol.py +test/test_test_auth_type.py +test/test_test_custom_headers.py +test/test_test_custom_headers_all.py +test/test_test_custom_headers_root.py +test/test_test_direction.py +test/test_test_dns_server.py +test/test_test_dns_transport_protocol.py +test/test_test_dscp_id.py +test/test_test_http_interval.py +test/test_test_interval.py +test/test_test_ipv6_policy.py +test/test_test_labels_inner.py +test/test_test_page_loading_strategy.py +test/test_test_path_trace_mode.py +test/test_test_probe_mode.py +test/test_test_protocol.py +test/test_test_request.py +test/test_test_request_all_of_agents.py +test/test_test_shared_accounts_inner.py +test/test_test_sip_credentials.py +test/test_test_ssl_version_id.py +test/test_test_sub_interval.py +test/test_test_type.py +test/test_tests.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_agent_to_agent_test.py +test/test_update_agent_to_server_test.py +test/test_update_bgp_test.py +test/test_update_dns_sec_test.py +test/test_update_dns_server_test.py +test/test_update_dns_trace_test.py +test/test_update_ftp_server_test.py +test/test_update_http_server_test.py +test/test_update_page_load_test.py +test/test_update_path_vis_interface_group200_response.py +test/test_update_sip_server_test.py +test/test_update_voice_test.py +test/test_update_web_transaction_test.py +test/test_voice_api.py +test/test_voice_instant_test.py +test/test_voice_test.py +test/test_voice_tests.py +test/test_web_transaction_api.py +test/test_web_transaction_instant_test.py +test/test_web_transaction_test.py +test/test_web_transaction_tests.py +tests_api/__init__.py +tests_api/api/__init__.py +tests_api/api/agent_to_agent_api.py +tests_api/api/agent_to_server_api.py +tests_api/api/all_test_types_api.py +tests_api/api/bgp_api.py +tests_api/api/dns_server_api.py +tests_api/api/dns_trace_api.py +tests_api/api/dnssec_api.py +tests_api/api/ftp_server_api.py +tests_api/api/http_server_api.py +tests_api/api/page_load_api.py +tests_api/api/path_visualization_interface_groups_api.py +tests_api/api/sip_server_api.py +tests_api/api/voice_api.py +tests_api/api/web_transaction_api.py +tests_api/api_client.py +tests_api/api_response.py +tests_api/configuration.py +tests_api/exceptions.py +tests_api/models/__init__.py +tests_api/models/agent.py +tests_api/models/agent_base.py +tests_api/models/agent_to_agent_instant_test.py +tests_api/models/agent_to_agent_test.py +tests_api/models/agent_to_agent_test_protocol.py +tests_api/models/agent_to_agent_tests.py +tests_api/models/agent_to_server_instant_test.py +tests_api/models/agent_to_server_test.py +tests_api/models/agent_to_server_tests.py +tests_api/models/alert_rounds_violation_mode.py +tests_api/models/alert_rule.py +tests_api/models/alert_type.py +tests_api/models/base_request.py +tests_api/models/base_test.py +tests_api/models/bgp_test.py +tests_api/models/bgp_tests.py +tests_api/models/cloud_enterprise_agent_type.py +tests_api/models/dns_query_class.py +tests_api/models/dns_sec_instant_test.py +tests_api/models/dns_sec_test.py +tests_api/models/dns_sec_tests.py +tests_api/models/dns_server_instant_test.py +tests_api/models/dns_server_test.py +tests_api/models/dns_server_tests.py +tests_api/models/dns_trace_instant_test.py +tests_api/models/dns_trace_test.py +tests_api/models/dns_trace_tests.py +tests_api/models/error.py +tests_api/models/expand.py +tests_api/models/ftp_server_instant_test.py +tests_api/models/ftp_server_request_type.py +tests_api/models/ftp_server_test.py +tests_api/models/ftp_server_tests.py +tests_api/models/get_agent_to_agent_test200_response.py +tests_api/models/get_agent_to_agent_tests200_response.py +tests_api/models/get_agent_to_server_test200_response.py +tests_api/models/get_agent_to_server_tests200_response.py +tests_api/models/get_bgp_test200_response.py +tests_api/models/get_bgp_tests200_response.py +tests_api/models/get_dns_sec_test200_response.py +tests_api/models/get_dns_sec_tests200_response.py +tests_api/models/get_dns_server_test200_response.py +tests_api/models/get_dns_server_tests200_response.py +tests_api/models/get_dns_trace_test200_response.py +tests_api/models/get_dns_trace_tests200_response.py +tests_api/models/get_ftp_server_test200_response.py +tests_api/models/get_ftp_server_tests200_response.py +tests_api/models/get_http_server_test200_response.py +tests_api/models/get_http_server_tests200_response.py +tests_api/models/get_page_load_test200_response.py +tests_api/models/get_page_load_tests200_response.py +tests_api/models/get_path_vis_interface_groups200_response.py +tests_api/models/get_sip_server_test200_response.py +tests_api/models/get_sip_server_tests200_response.py +tests_api/models/get_tests200_response.py +tests_api/models/get_voice_test200_response.py +tests_api/models/get_voice_tests200_response.py +tests_api/models/get_web_transactions_test200_response.py +tests_api/models/get_web_transactions_tests200_response.py +tests_api/models/http_server_instant_test.py +tests_api/models/http_server_test.py +tests_api/models/http_server_tests.py +tests_api/models/instant_test.py +tests_api/models/interface_group.py +tests_api/models/interface_groups.py +tests_api/models/link.py +tests_api/models/map_item.py +tests_api/models/monitor.py +tests_api/models/monitor_type.py +tests_api/models/monitors_request.py +tests_api/models/page_load_instant_test.py +tests_api/models/page_load_test.py +tests_api/models/page_load_tests.py +tests_api/models/self_links.py +tests_api/models/self_links_links.py +tests_api/models/simple_test.py +tests_api/models/sip_server_instant_test.py +tests_api/models/sip_server_test.py +tests_api/models/sip_server_tests.py +tests_api/models/sip_test_protocol.py +tests_api/models/test_auth_type.py +tests_api/models/test_custom_headers.py +tests_api/models/test_custom_headers_all.py +tests_api/models/test_custom_headers_root.py +tests_api/models/test_direction.py +tests_api/models/test_dns_server.py +tests_api/models/test_dns_transport_protocol.py +tests_api/models/test_dscp_id.py +tests_api/models/test_http_interval.py +tests_api/models/test_interval.py +tests_api/models/test_ipv6_policy.py +tests_api/models/test_labels_inner.py +tests_api/models/test_page_loading_strategy.py +tests_api/models/test_path_trace_mode.py +tests_api/models/test_probe_mode.py +tests_api/models/test_protocol.py +tests_api/models/test_request.py +tests_api/models/test_request_all_of_agents.py +tests_api/models/test_shared_accounts_inner.py +tests_api/models/test_sip_credentials.py +tests_api/models/test_ssl_version_id.py +tests_api/models/test_sub_interval.py +tests_api/models/test_type.py +tests_api/models/tests.py +tests_api/models/unauthorized_error.py +tests_api/models/unexpanded_instant_test.py +tests_api/models/unexpanded_instant_test_links.py +tests_api/models/unexpanded_instant_test_links_self.py +tests_api/models/unexpanded_instant_test_links_test_results.py +tests_api/models/unexpanded_test.py +tests_api/models/update_agent_to_agent_test.py +tests_api/models/update_agent_to_server_test.py +tests_api/models/update_bgp_test.py +tests_api/models/update_dns_sec_test.py +tests_api/models/update_dns_server_test.py +tests_api/models/update_dns_trace_test.py +tests_api/models/update_ftp_server_test.py +tests_api/models/update_http_server_test.py +tests_api/models/update_page_load_test.py +tests_api/models/update_path_vis_interface_group200_response.py +tests_api/models/update_sip_server_test.py +tests_api/models/update_voice_test.py +tests_api/models/update_web_transaction_test.py +tests_api/models/voice_instant_test.py +tests_api/models/voice_test.py +tests_api/models/voice_tests.py +tests_api/models/web_transaction_instant_test.py +tests_api/models/web_transaction_test.py +tests_api/models/web_transaction_tests.py +tests_api/py.typed +tests_api/rest.py +tox.ini diff --git a/tests_api/.openapi-generator/VERSION b/tests_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/tests_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/tests_api/.travis.yml b/tests_api/.travis.yml new file mode 100644 index 00000000..df7c4097 --- /dev/null +++ b/tests_api/.travis.yml @@ -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=tests_api diff --git a/tests_api/README.md b/tests_api/README.md new file mode 100644 index 00000000..3d40e9f4 --- /dev/null +++ b/tests_api/README.md @@ -0,0 +1,316 @@ +# tests-api + +### Overview +This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + +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 tests_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 tests_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 tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.AgentToAgentApi(api_client) + update_agent_to_agent_test = tests_api.UpdateAgentToAgentTest() # UpdateAgentToAgentTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create Agent to Agent test + api_response = api_instance.create_agent_to_agent_test(update_agent_to_agent_test, aid=aid, expand=expand) + print("The response of AgentToAgentApi->create_agent_to_agent_test:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling AgentToAgentApi->create_agent_to_agent_test: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AgentToAgentApi* | [**create_agent_to_agent_test**](docs/AgentToAgentApi.md#create_agent_to_agent_test) | **POST** /v7/tests/agent-to-agent | Create Agent to Agent test +*AgentToAgentApi* | [**delete_agent_to_agent_test**](docs/AgentToAgentApi.md#delete_agent_to_agent_test) | **DELETE** /v7/tests/agent-to-agent/{testId} | Delete Agent to Agent test +*AgentToAgentApi* | [**get_agent_to_agent_test**](docs/AgentToAgentApi.md#get_agent_to_agent_test) | **GET** /v7/tests/agent-to-agent/{testId} | Get Agent to Agent test +*AgentToAgentApi* | [**get_agent_to_agent_tests**](docs/AgentToAgentApi.md#get_agent_to_agent_tests) | **GET** /v7/tests/agent-to-agent | List Agent to Agent tests +*AgentToAgentApi* | [**update_agent_to_agent_test**](docs/AgentToAgentApi.md#update_agent_to_agent_test) | **PUT** /v7/tests/agent-to-agent/{testId} | Update Agent to Agent test +*AgentToServerApi* | [**create_agent_to_server_test**](docs/AgentToServerApi.md#create_agent_to_server_test) | **POST** /v7/tests/agent-to-server | Create Agent to Server test +*AgentToServerApi* | [**delete_agent_to_server_test**](docs/AgentToServerApi.md#delete_agent_to_server_test) | **DELETE** /v7/tests/agent-to-server/{testId} | Delete Agent to Server test +*AgentToServerApi* | [**get_agent_to_server_test**](docs/AgentToServerApi.md#get_agent_to_server_test) | **GET** /v7/tests/agent-to-server/{testId} | Get Agent to Server test +*AgentToServerApi* | [**get_agent_to_server_tests**](docs/AgentToServerApi.md#get_agent_to_server_tests) | **GET** /v7/tests/agent-to-server | List Agent to Server tests +*AgentToServerApi* | [**update_agent_to_server_test**](docs/AgentToServerApi.md#update_agent_to_server_test) | **PUT** /v7/tests/agent-to-server/{testId} | Update Agent to Server test +*AllTestTypesApi* | [**get_tests**](docs/AllTestTypesApi.md#get_tests) | **GET** /v7/tests | List configured tests +*BGPApi* | [**create_bgp_test**](docs/BGPApi.md#create_bgp_test) | **POST** /v7/tests/bgp | Create BGP test +*BGPApi* | [**delete_bgp_test**](docs/BGPApi.md#delete_bgp_test) | **DELETE** /v7/tests/bgp/{testId} | Delete BGP test +*BGPApi* | [**get_bgp_test**](docs/BGPApi.md#get_bgp_test) | **GET** /v7/tests/bgp/{testId} | Get BGP test +*BGPApi* | [**get_bgp_tests**](docs/BGPApi.md#get_bgp_tests) | **GET** /v7/tests/bgp | List BGP tests +*BGPApi* | [**update_bgp_test**](docs/BGPApi.md#update_bgp_test) | **PUT** /v7/tests/bgp/{testId} | Update BGP test +*DNSSECApi* | [**create_dns_sec_test**](docs/DNSSECApi.md#create_dns_sec_test) | **POST** /v7/tests/dnssec | Create DNSSEC test +*DNSSECApi* | [**delete_dns_sec_test**](docs/DNSSECApi.md#delete_dns_sec_test) | **DELETE** /v7/tests/dnssec/{testId} | Delete DNSSEC test +*DNSSECApi* | [**get_dns_sec_test**](docs/DNSSECApi.md#get_dns_sec_test) | **GET** /v7/tests/dnssec/{testId} | Get DNSSEC test +*DNSSECApi* | [**get_dns_sec_tests**](docs/DNSSECApi.md#get_dns_sec_tests) | **GET** /v7/tests/dnssec | List DNS Sec tests +*DNSSECApi* | [**update_dns_sec_test**](docs/DNSSECApi.md#update_dns_sec_test) | **PUT** /v7/tests/dnssec/{testId} | Update DNSSEC test +*DNSServerApi* | [**create_dns_server_test**](docs/DNSServerApi.md#create_dns_server_test) | **POST** /v7/tests/dns-server | Create DNS Server test +*DNSServerApi* | [**delete_dns_server_test**](docs/DNSServerApi.md#delete_dns_server_test) | **DELETE** /v7/tests/dns-server/{testId} | Delete DNS Server test +*DNSServerApi* | [**get_dns_server_test**](docs/DNSServerApi.md#get_dns_server_test) | **GET** /v7/tests/dns-server/{testId} | Get DNS Server test +*DNSServerApi* | [**get_dns_server_tests**](docs/DNSServerApi.md#get_dns_server_tests) | **GET** /v7/tests/dns-server | List DNS Server tests +*DNSServerApi* | [**update_dns_server_test**](docs/DNSServerApi.md#update_dns_server_test) | **PUT** /v7/tests/dns-server/{testId} | Update DNS Server test +*DNSTraceApi* | [**create_dns_trace_test**](docs/DNSTraceApi.md#create_dns_trace_test) | **POST** /v7/tests/dns-trace | Create DNS Trace test +*DNSTraceApi* | [**delete_dns_trace_test**](docs/DNSTraceApi.md#delete_dns_trace_test) | **DELETE** /v7/tests/dns-trace/{testId} | Delete DNS Trace test +*DNSTraceApi* | [**get_dns_trace_test**](docs/DNSTraceApi.md#get_dns_trace_test) | **GET** /v7/tests/dns-trace/{testId} | Get DNS Trace test +*DNSTraceApi* | [**get_dns_trace_tests**](docs/DNSTraceApi.md#get_dns_trace_tests) | **GET** /v7/tests/dns-trace | List DNS Trace tests +*DNSTraceApi* | [**update_dns_trace_test**](docs/DNSTraceApi.md#update_dns_trace_test) | **PUT** /v7/tests/dns-trace/{testId} | Update DNS Trace test +*FTPServerApi* | [**create_ftp_server_test**](docs/FTPServerApi.md#create_ftp_server_test) | **POST** /v7/tests/ftp-server | Create FTP Server test +*FTPServerApi* | [**delete_ftp_server_test**](docs/FTPServerApi.md#delete_ftp_server_test) | **DELETE** /v7/tests/ftp-server/{testId} | Delete FTP Server test +*FTPServerApi* | [**get_ftp_server_test**](docs/FTPServerApi.md#get_ftp_server_test) | **GET** /v7/tests/ftp-server/{testId} | Get FTP Server test +*FTPServerApi* | [**get_ftp_server_tests**](docs/FTPServerApi.md#get_ftp_server_tests) | **GET** /v7/tests/ftp-server | List FTP Server tests +*FTPServerApi* | [**update_ftp_server_test**](docs/FTPServerApi.md#update_ftp_server_test) | **PUT** /v7/tests/ftp-server/{testId} | Update FTP Server test +*HTTPServerApi* | [**create_http_server_test**](docs/HTTPServerApi.md#create_http_server_test) | **POST** /v7/tests/http-server | Create HTTP Server test +*HTTPServerApi* | [**delete_http_server_test**](docs/HTTPServerApi.md#delete_http_server_test) | **DELETE** /v7/tests/http-server/{testId} | Delete HTTP Server test +*HTTPServerApi* | [**get_http_server_test**](docs/HTTPServerApi.md#get_http_server_test) | **GET** /v7/tests/http-server/{testId} | Get HTTP Server test +*HTTPServerApi* | [**get_http_server_tests**](docs/HTTPServerApi.md#get_http_server_tests) | **GET** /v7/tests/http-server | List HTTP Server tests +*HTTPServerApi* | [**update_http_server_test**](docs/HTTPServerApi.md#update_http_server_test) | **PUT** /v7/tests/http-server/{testId} | Update HTTP Server test +*PageLoadApi* | [**create_page_load_test**](docs/PageLoadApi.md#create_page_load_test) | **POST** /v7/tests/page-load | Create Page Load test +*PageLoadApi* | [**delete_page_load_test**](docs/PageLoadApi.md#delete_page_load_test) | **DELETE** /v7/tests/page-load/{testId} | Delete Page Load test +*PageLoadApi* | [**get_page_load_test**](docs/PageLoadApi.md#get_page_load_test) | **GET** /v7/tests/page-load/{testId} | Get Page Load test +*PageLoadApi* | [**get_page_load_tests**](docs/PageLoadApi.md#get_page_load_tests) | **GET** /v7/tests/page-load | List Page Load tests +*PageLoadApi* | [**update_page_load_test**](docs/PageLoadApi.md#update_page_load_test) | **PUT** /v7/tests/page-load/{testId} | Update Page Load test +*PathVisualizationInterfaceGroupsApi* | [**create_path_vis_interface_groups**](docs/PathVisualizationInterfaceGroupsApi.md#create_path_vis_interface_groups) | **POST** /v7/network/path-vis/interface-groups | Create interface group for path visualization +*PathVisualizationInterfaceGroupsApi* | [**delete_path_vis_interface_group**](docs/PathVisualizationInterfaceGroupsApi.md#delete_path_vis_interface_group) | **DELETE** /v7/network/path-vis/interface-groups/{interfaceGroupId} | Delete interface group +*PathVisualizationInterfaceGroupsApi* | [**get_path_vis_interface_groups**](docs/PathVisualizationInterfaceGroupsApi.md#get_path_vis_interface_groups) | **GET** /v7/network/path-vis/interface-groups | List interface groups for path visualization +*PathVisualizationInterfaceGroupsApi* | [**update_path_vis_interface_group**](docs/PathVisualizationInterfaceGroupsApi.md#update_path_vis_interface_group) | **PUT** /v7/network/path-vis/interface-groups/{interfaceGroupId} | Update interface group +*SIPServerApi* | [**create_sip_server_test**](docs/SIPServerApi.md#create_sip_server_test) | **POST** /v7/tests/sip-server | Create SIP Server test +*SIPServerApi* | [**delete_sip_server_test**](docs/SIPServerApi.md#delete_sip_server_test) | **DELETE** /v7/tests/sip-server/{testId} | Delete SIP Server test +*SIPServerApi* | [**get_sip_server_test**](docs/SIPServerApi.md#get_sip_server_test) | **GET** /v7/tests/sip-server/{testId} | Get SIP Server test +*SIPServerApi* | [**get_sip_server_tests**](docs/SIPServerApi.md#get_sip_server_tests) | **GET** /v7/tests/sip-server | List SIP Server tests +*SIPServerApi* | [**update_sip_server_test**](docs/SIPServerApi.md#update_sip_server_test) | **PUT** /v7/tests/sip-server/{testId} | Update SIP Server test +*VoiceApi* | [**create_voice_test**](docs/VoiceApi.md#create_voice_test) | **POST** /v7/tests/voice | Create Voice test +*VoiceApi* | [**delete_voice_test**](docs/VoiceApi.md#delete_voice_test) | **DELETE** /v7/tests/voice/{testId} | Delete Voice test +*VoiceApi* | [**get_voice_test**](docs/VoiceApi.md#get_voice_test) | **GET** /v7/tests/voice/{testId} | Get Voice test +*VoiceApi* | [**get_voice_tests**](docs/VoiceApi.md#get_voice_tests) | **GET** /v7/tests/voice | List Voice tests +*VoiceApi* | [**update_voice_test**](docs/VoiceApi.md#update_voice_test) | **PUT** /v7/tests/voice/{testId} | Update Voice test +*WebTransactionApi* | [**create_web_transactions_test**](docs/WebTransactionApi.md#create_web_transactions_test) | **POST** /v7/tests/web-transactions | Create Web Transactions test +*WebTransactionApi* | [**delete_web_transactions_test**](docs/WebTransactionApi.md#delete_web_transactions_test) | **DELETE** /v7/tests/web-transactions/{testId} | Delete Web Transactions test +*WebTransactionApi* | [**get_web_transactions_test**](docs/WebTransactionApi.md#get_web_transactions_test) | **GET** /v7/tests/web-transactions/{testId} | Get Web Transactions test +*WebTransactionApi* | [**get_web_transactions_tests**](docs/WebTransactionApi.md#get_web_transactions_tests) | **GET** /v7/tests/web-transactions | List Web Transactions tests +*WebTransactionApi* | [**update_web_transactions_test**](docs/WebTransactionApi.md#update_web_transactions_test) | **PUT** /v7/tests/web-transactions/{testId} | Update Web Transactions test + + +## Documentation For Models + + - [Agent](docs/Agent.md) + - [AgentBase](docs/AgentBase.md) + - [AgentToAgentInstantTest](docs/AgentToAgentInstantTest.md) + - [AgentToAgentTest](docs/AgentToAgentTest.md) + - [AgentToAgentTestProtocol](docs/AgentToAgentTestProtocol.md) + - [AgentToAgentTests](docs/AgentToAgentTests.md) + - [AgentToServerInstantTest](docs/AgentToServerInstantTest.md) + - [AgentToServerTest](docs/AgentToServerTest.md) + - [AgentToServerTests](docs/AgentToServerTests.md) + - [AlertRoundsViolationMode](docs/AlertRoundsViolationMode.md) + - [AlertRule](docs/AlertRule.md) + - [AlertType](docs/AlertType.md) + - [BaseRequest](docs/BaseRequest.md) + - [BaseTest](docs/BaseTest.md) + - [BgpTest](docs/BgpTest.md) + - [BgpTests](docs/BgpTests.md) + - [CloudEnterpriseAgentType](docs/CloudEnterpriseAgentType.md) + - [DnsQueryClass](docs/DnsQueryClass.md) + - [DnsSecInstantTest](docs/DnsSecInstantTest.md) + - [DnsSecTest](docs/DnsSecTest.md) + - [DnsSecTests](docs/DnsSecTests.md) + - [DnsServerInstantTest](docs/DnsServerInstantTest.md) + - [DnsServerTest](docs/DnsServerTest.md) + - [DnsServerTests](docs/DnsServerTests.md) + - [DnsTraceInstantTest](docs/DnsTraceInstantTest.md) + - [DnsTraceTest](docs/DnsTraceTest.md) + - [DnsTraceTests](docs/DnsTraceTests.md) + - [Error](docs/Error.md) + - [Expand](docs/Expand.md) + - [FtpServerInstantTest](docs/FtpServerInstantTest.md) + - [FtpServerRequestType](docs/FtpServerRequestType.md) + - [FtpServerTest](docs/FtpServerTest.md) + - [FtpServerTests](docs/FtpServerTests.md) + - [GetAgentToAgentTest200Response](docs/GetAgentToAgentTest200Response.md) + - [GetAgentToAgentTests200Response](docs/GetAgentToAgentTests200Response.md) + - [GetAgentToServerTest200Response](docs/GetAgentToServerTest200Response.md) + - [GetAgentToServerTests200Response](docs/GetAgentToServerTests200Response.md) + - [GetBgpTest200Response](docs/GetBgpTest200Response.md) + - [GetBgpTests200Response](docs/GetBgpTests200Response.md) + - [GetDNSServerTest200Response](docs/GetDNSServerTest200Response.md) + - [GetDNSServerTests200Response](docs/GetDNSServerTests200Response.md) + - [GetDnsSecTest200Response](docs/GetDnsSecTest200Response.md) + - [GetDnsSecTests200Response](docs/GetDnsSecTests200Response.md) + - [GetDnsTraceTest200Response](docs/GetDnsTraceTest200Response.md) + - [GetDnsTraceTests200Response](docs/GetDnsTraceTests200Response.md) + - [GetFtpServerTest200Response](docs/GetFtpServerTest200Response.md) + - [GetFtpServerTests200Response](docs/GetFtpServerTests200Response.md) + - [GetHttpServerTest200Response](docs/GetHttpServerTest200Response.md) + - [GetHttpServerTests200Response](docs/GetHttpServerTests200Response.md) + - [GetPageLoadTest200Response](docs/GetPageLoadTest200Response.md) + - [GetPageLoadTests200Response](docs/GetPageLoadTests200Response.md) + - [GetPathVisInterfaceGroups200Response](docs/GetPathVisInterfaceGroups200Response.md) + - [GetSipServerTest200Response](docs/GetSipServerTest200Response.md) + - [GetSipServerTests200Response](docs/GetSipServerTests200Response.md) + - [GetTests200Response](docs/GetTests200Response.md) + - [GetVoiceTest200Response](docs/GetVoiceTest200Response.md) + - [GetVoiceTests200Response](docs/GetVoiceTests200Response.md) + - [GetWebTransactionsTest200Response](docs/GetWebTransactionsTest200Response.md) + - [GetWebTransactionsTests200Response](docs/GetWebTransactionsTests200Response.md) + - [HttpServerInstantTest](docs/HttpServerInstantTest.md) + - [HttpServerTest](docs/HttpServerTest.md) + - [HttpServerTests](docs/HttpServerTests.md) + - [InstantTest](docs/InstantTest.md) + - [InterfaceGroup](docs/InterfaceGroup.md) + - [InterfaceGroups](docs/InterfaceGroups.md) + - [Link](docs/Link.md) + - [MapItem](docs/MapItem.md) + - [Monitor](docs/Monitor.md) + - [MonitorType](docs/MonitorType.md) + - [MonitorsRequest](docs/MonitorsRequest.md) + - [PageLoadInstantTest](docs/PageLoadInstantTest.md) + - [PageLoadTest](docs/PageLoadTest.md) + - [PageLoadTests](docs/PageLoadTests.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [SimpleTest](docs/SimpleTest.md) + - [SipServerInstantTest](docs/SipServerInstantTest.md) + - [SipServerTest](docs/SipServerTest.md) + - [SipServerTests](docs/SipServerTests.md) + - [SipTestProtocol](docs/SipTestProtocol.md) + - [TestAuthType](docs/TestAuthType.md) + - [TestCustomHeaders](docs/TestCustomHeaders.md) + - [TestCustomHeadersAll](docs/TestCustomHeadersAll.md) + - [TestCustomHeadersRoot](docs/TestCustomHeadersRoot.md) + - [TestDirection](docs/TestDirection.md) + - [TestDnsServer](docs/TestDnsServer.md) + - [TestDnsTransportProtocol](docs/TestDnsTransportProtocol.md) + - [TestDscpId](docs/TestDscpId.md) + - [TestHttpInterval](docs/TestHttpInterval.md) + - [TestInterval](docs/TestInterval.md) + - [TestIpv6Policy](docs/TestIpv6Policy.md) + - [TestLabelsInner](docs/TestLabelsInner.md) + - [TestPageLoadingStrategy](docs/TestPageLoadingStrategy.md) + - [TestPathTraceMode](docs/TestPathTraceMode.md) + - [TestProbeMode](docs/TestProbeMode.md) + - [TestProtocol](docs/TestProtocol.md) + - [TestRequest](docs/TestRequest.md) + - [TestRequestAllOfAgents](docs/TestRequestAllOfAgents.md) + - [TestSharedAccountsInner](docs/TestSharedAccountsInner.md) + - [TestSipCredentials](docs/TestSipCredentials.md) + - [TestSslVersionId](docs/TestSslVersionId.md) + - [TestSubInterval](docs/TestSubInterval.md) + - [TestType](docs/TestType.md) + - [Tests](docs/Tests.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) + - [UpdateAgentToAgentTest](docs/UpdateAgentToAgentTest.md) + - [UpdateAgentToServerTest](docs/UpdateAgentToServerTest.md) + - [UpdateBgpTest](docs/UpdateBgpTest.md) + - [UpdateDnsSecTest](docs/UpdateDnsSecTest.md) + - [UpdateDnsServerTest](docs/UpdateDnsServerTest.md) + - [UpdateDnsTraceTest](docs/UpdateDnsTraceTest.md) + - [UpdateFtpServerTest](docs/UpdateFtpServerTest.md) + - [UpdateHttpServerTest](docs/UpdateHttpServerTest.md) + - [UpdatePageLoadTest](docs/UpdatePageLoadTest.md) + - [UpdatePathVisInterfaceGroup200Response](docs/UpdatePathVisInterfaceGroup200Response.md) + - [UpdateSipServerTest](docs/UpdateSipServerTest.md) + - [UpdateVoiceTest](docs/UpdateVoiceTest.md) + - [UpdateWebTransactionTest](docs/UpdateWebTransactionTest.md) + - [VoiceInstantTest](docs/VoiceInstantTest.md) + - [VoiceTest](docs/VoiceTest.md) + - [VoiceTests](docs/VoiceTests.md) + - [WebTransactionInstantTest](docs/WebTransactionInstantTest.md) + - [WebTransactionTest](docs/WebTransactionTest.md) + - [WebTransactionTests](docs/WebTransactionTests.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/tests_api/docs/Agent.md b/tests_api/docs/Agent.md new file mode 100644 index 00000000..b4ef4534 --- /dev/null +++ b/tests_api/docs/Agent.md @@ -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 agent’s 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's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] + +## Example + +```python +from tests_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) + + diff --git a/tests_api/docs/AgentBase.md b/tests_api/docs/AgentBase.md new file mode 100644 index 00000000..7a441cf8 --- /dev/null +++ b/tests_api/docs/AgentBase.md @@ -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 agent’s public IP. | [optional] [readonly] + +## Example + +```python +from tests_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) + + diff --git a/tests_api/docs/AgentToAgentApi.md b/tests_api/docs/AgentToAgentApi.md new file mode 100644 index 00000000..20ae30f3 --- /dev/null +++ b/tests_api/docs/AgentToAgentApi.md @@ -0,0 +1,453 @@ +# tests_api.AgentToAgentApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_agent_to_agent_test**](AgentToAgentApi.md#create_agent_to_agent_test) | **POST** /v7/tests/agent-to-agent | Create Agent to Agent test +[**delete_agent_to_agent_test**](AgentToAgentApi.md#delete_agent_to_agent_test) | **DELETE** /v7/tests/agent-to-agent/{testId} | Delete Agent to Agent test +[**get_agent_to_agent_test**](AgentToAgentApi.md#get_agent_to_agent_test) | **GET** /v7/tests/agent-to-agent/{testId} | Get Agent to Agent test +[**get_agent_to_agent_tests**](AgentToAgentApi.md#get_agent_to_agent_tests) | **GET** /v7/tests/agent-to-agent | List Agent to Agent tests +[**update_agent_to_agent_test**](AgentToAgentApi.md#update_agent_to_agent_test) | **PUT** /v7/tests/agent-to-agent/{testId} | Update Agent to Agent test + + +# **create_agent_to_agent_test** +> AgentToAgentTest create_agent_to_agent_test(update_agent_to_agent_test, aid=aid, expand=expand) + +Create Agent to Agent test + +Creates a new Agent to Agent test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.agent_to_agent_test import AgentToAgentTest +from tests_api.models.expand import Expand +from tests_api.models.update_agent_to_agent_test import UpdateAgentToAgentTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.AgentToAgentApi(api_client) + update_agent_to_agent_test = tests_api.UpdateAgentToAgentTest() # UpdateAgentToAgentTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create Agent to Agent test + api_response = api_instance.create_agent_to_agent_test(update_agent_to_agent_test, aid=aid, expand=expand) + print("The response of AgentToAgentApi->create_agent_to_agent_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToAgentApi->create_agent_to_agent_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_agent_to_agent_test** | [**UpdateAgentToAgentTest**](UpdateAgentToAgentTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**AgentToAgentTest**](AgentToAgentTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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) + +# **delete_agent_to_agent_test** +> delete_agent_to_agent_test(test_id, aid=aid) + +Delete Agent to Agent test + +Deletes the specified Agent to Agent test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.AgentToAgentApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 Agent to Agent test + api_instance.delete_agent_to_agent_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling AgentToAgentApi->delete_agent_to_agent_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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_to_agent_test** +> GetAgentToAgentTest200Response get_agent_to_agent_test(test_id, aid=aid, expand=expand) + +Get Agent to Agent test + +Returns details for a Agent to Agent test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_agent_to_agent_test200_response import GetAgentToAgentTest200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.AgentToAgentApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get Agent to Agent test + api_response = api_instance.get_agent_to_agent_test(test_id, aid=aid, expand=expand) + print("The response of AgentToAgentApi->get_agent_to_agent_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToAgentApi->get_agent_to_agent_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetAgentToAgentTest200Response**](GetAgentToAgentTest200Response.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_agent_to_agent_tests** +> GetAgentToAgentTests200Response get_agent_to_agent_tests(aid=aid) + +List Agent to Agent tests + +Returns a list of Agent to Agent tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_agent_to_agent_tests200_response import GetAgentToAgentTests200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.AgentToAgentApi(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 to Agent tests + api_response = api_instance.get_agent_to_agent_tests(aid=aid) + print("The response of AgentToAgentApi->get_agent_to_agent_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToAgentApi->get_agent_to_agent_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetAgentToAgentTests200Response**](GetAgentToAgentTests200Response.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_agent_to_agent_test** +> GetAgentToAgentTest200Response update_agent_to_agent_test(test_id, update_agent_to_agent_test, aid=aid, expand=expand) + +Update Agent to Agent test + +Updates a Agent to Agent test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_agent_to_agent_test200_response import GetAgentToAgentTest200Response +from tests_api.models.update_agent_to_agent_test import UpdateAgentToAgentTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.AgentToAgentApi(api_client) + test_id = '281474976710706' # str | ID of the test + update_agent_to_agent_test = tests_api.UpdateAgentToAgentTest() # UpdateAgentToAgentTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update Agent to Agent test + api_response = api_instance.update_agent_to_agent_test(test_id, update_agent_to_agent_test, aid=aid, expand=expand) + print("The response of AgentToAgentApi->update_agent_to_agent_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToAgentApi->update_agent_to_agent_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **update_agent_to_agent_test** | [**UpdateAgentToAgentTest**](UpdateAgentToAgentTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetAgentToAgentTest200Response**](GetAgentToAgentTest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/tests_api/docs/AgentToAgentInstantTest.md b/tests_api/docs/AgentToAgentInstantTest.md new file mode 100644 index 00000000..a6214e9f --- /dev/null +++ b/tests_api/docs/AgentToAgentInstantTest.md @@ -0,0 +1,54 @@ +# AgentToAgentInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**mss** | **int** | Maximum segment size, in bytes. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**protocol** | [**AgentToAgentTestProtocol**](AgentToAgentTestProtocol.md) | | [optional] +**target_agent_id** | **str** | `agentId` of the target agent for the test. | +**throughput_measurements** | **bool** | Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent. | [optional] [default to False] +**throughput_duration** | **int** | The throughput duration. | [optional] [default to 10000] +**throughput_rate** | **int** | The throughput rate, only applicable for UDP protocol. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] + +## Example + +```python +from tests_api.models.agent_to_agent_instant_test import AgentToAgentInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToAgentInstantTest from a JSON string +agent_to_agent_instant_test_instance = AgentToAgentInstantTest.from_json(json) +# print the JSON string representation of the object +print AgentToAgentInstantTest.to_json() + +# convert the object into a dict +agent_to_agent_instant_test_dict = agent_to_agent_instant_test_instance.to_dict() +# create an instance of AgentToAgentInstantTest from a dict +agent_to_agent_instant_test_form_dict = agent_to_agent_instant_test.from_dict(agent_to_agent_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/AgentToAgentTest.md b/tests_api/docs/AgentToAgentTest.md new file mode 100644 index 00000000..8a5ed2a6 --- /dev/null +++ b/tests_api/docs/AgentToAgentTest.md @@ -0,0 +1,60 @@ +# AgentToAgentTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**mss** | **int** | Maximum segment size, in bytes. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**protocol** | [**AgentToAgentTestProtocol**](AgentToAgentTestProtocol.md) | | [optional] +**target_agent_id** | **str** | `agentId` of the target agent for the test. | +**throughput_measurements** | **bool** | Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent. | [optional] [default to False] +**throughput_duration** | **int** | The throughput duration. | [optional] [default to 10000] +**throughput_rate** | **int** | The throughput rate, only applicable for UDP protocol. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] + +## Example + +```python +from tests_api.models.agent_to_agent_test import AgentToAgentTest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToAgentTest from a JSON string +agent_to_agent_test_instance = AgentToAgentTest.from_json(json) +# print the JSON string representation of the object +print AgentToAgentTest.to_json() + +# convert the object into a dict +agent_to_agent_test_dict = agent_to_agent_test_instance.to_dict() +# create an instance of AgentToAgentTest from a dict +agent_to_agent_test_form_dict = agent_to_agent_test.from_dict(agent_to_agent_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/AgentToAgentTestProtocol.md b/tests_api/docs/AgentToAgentTestProtocol.md new file mode 100644 index 00000000..ee2d3a70 --- /dev/null +++ b/tests_api/docs/AgentToAgentTestProtocol.md @@ -0,0 +1,10 @@ +# AgentToAgentTestProtocol + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/AgentToAgentTests.md b/tests_api/docs/AgentToAgentTests.md new file mode 100644 index 00000000..e8392f47 --- /dev/null +++ b/tests_api/docs/AgentToAgentTests.md @@ -0,0 +1,28 @@ +# AgentToAgentTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[AgentToAgentTest]**](AgentToAgentTest.md) | | [optional] + +## Example + +```python +from tests_api.models.agent_to_agent_tests import AgentToAgentTests + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToAgentTests from a JSON string +agent_to_agent_tests_instance = AgentToAgentTests.from_json(json) +# print the JSON string representation of the object +print AgentToAgentTests.to_json() + +# convert the object into a dict +agent_to_agent_tests_dict = agent_to_agent_tests_instance.to_dict() +# create an instance of AgentToAgentTests from a dict +agent_to_agent_tests_form_dict = agent_to_agent_tests.from_dict(agent_to_agent_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/AgentToServerApi.md b/tests_api/docs/AgentToServerApi.md new file mode 100644 index 00000000..202a3a2e --- /dev/null +++ b/tests_api/docs/AgentToServerApi.md @@ -0,0 +1,453 @@ +# tests_api.AgentToServerApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_agent_to_server_test**](AgentToServerApi.md#create_agent_to_server_test) | **POST** /v7/tests/agent-to-server | Create Agent to Server test +[**delete_agent_to_server_test**](AgentToServerApi.md#delete_agent_to_server_test) | **DELETE** /v7/tests/agent-to-server/{testId} | Delete Agent to Server test +[**get_agent_to_server_test**](AgentToServerApi.md#get_agent_to_server_test) | **GET** /v7/tests/agent-to-server/{testId} | Get Agent to Server test +[**get_agent_to_server_tests**](AgentToServerApi.md#get_agent_to_server_tests) | **GET** /v7/tests/agent-to-server | List Agent to Server tests +[**update_agent_to_server_test**](AgentToServerApi.md#update_agent_to_server_test) | **PUT** /v7/tests/agent-to-server/{testId} | Update Agent to Server test + + +# **create_agent_to_server_test** +> AgentToServerTest create_agent_to_server_test(update_agent_to_server_test, aid=aid, expand=expand) + +Create Agent to Server test + +Creates a new Agent to Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.agent_to_server_test import AgentToServerTest +from tests_api.models.expand import Expand +from tests_api.models.update_agent_to_server_test import UpdateAgentToServerTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.AgentToServerApi(api_client) + update_agent_to_server_test = tests_api.UpdateAgentToServerTest() # UpdateAgentToServerTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create Agent to Server test + api_response = api_instance.create_agent_to_server_test(update_agent_to_server_test, aid=aid, expand=expand) + print("The response of AgentToServerApi->create_agent_to_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerApi->create_agent_to_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_agent_to_server_test** | [**UpdateAgentToServerTest**](UpdateAgentToServerTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**AgentToServerTest**](AgentToServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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) + +# **delete_agent_to_server_test** +> delete_agent_to_server_test(test_id, aid=aid) + +Delete Agent to Server test + +Deletes an Agent to Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.AgentToServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 Agent to Server test + api_instance.delete_agent_to_server_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling AgentToServerApi->delete_agent_to_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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_to_server_test** +> GetAgentToServerTest200Response get_agent_to_server_test(test_id, aid=aid, expand=expand) + +Get Agent to Server test + +Returns details for a Agent to Server test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_agent_to_server_test200_response import GetAgentToServerTest200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.AgentToServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get Agent to Server test + api_response = api_instance.get_agent_to_server_test(test_id, aid=aid, expand=expand) + print("The response of AgentToServerApi->get_agent_to_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerApi->get_agent_to_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetAgentToServerTest200Response**](GetAgentToServerTest200Response.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_agent_to_server_tests** +> GetAgentToServerTests200Response get_agent_to_server_tests(aid=aid) + +List Agent to Server tests + +Returns a list of Agent to Server tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_agent_to_server_tests200_response import GetAgentToServerTests200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.AgentToServerApi(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 to Server tests + api_response = api_instance.get_agent_to_server_tests(aid=aid) + print("The response of AgentToServerApi->get_agent_to_server_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerApi->get_agent_to_server_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetAgentToServerTests200Response**](GetAgentToServerTests200Response.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_agent_to_server_test** +> GetAgentToServerTest200Response update_agent_to_server_test(test_id, update_agent_to_server_test, aid=aid, expand=expand) + +Update Agent to Server test + +Updates an Agent to Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_agent_to_server_test200_response import GetAgentToServerTest200Response +from tests_api.models.update_agent_to_server_test import UpdateAgentToServerTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.AgentToServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + update_agent_to_server_test = tests_api.UpdateAgentToServerTest() # UpdateAgentToServerTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update Agent to Server test + api_response = api_instance.update_agent_to_server_test(test_id, update_agent_to_server_test, aid=aid, expand=expand) + print("The response of AgentToServerApi->update_agent_to_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerApi->update_agent_to_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **update_agent_to_server_test** | [**UpdateAgentToServerTest**](UpdateAgentToServerTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetAgentToServerTest200Response**](GetAgentToServerTest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/tests_api/docs/AgentToServerInstantTest.md b/tests_api/docs/AgentToServerInstantTest.md new file mode 100644 index 00000000..08b5768b --- /dev/null +++ b/tests_api/docs/AgentToServerInstantTest.md @@ -0,0 +1,56 @@ +# AgentToServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**continuous_mode** | **bool** | To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. | [optional] +**fixed_packet_rate** | **int** | If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1` | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**server** | **str** | Target name or IP address. | +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**ping_payload_size** | **int** | Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests. | [optional] +**network_measurements** | **bool** | View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements. | [optional] [default to False] + +## Example + +```python +from tests_api.models.agent_to_server_instant_test import AgentToServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToServerInstantTest from a JSON string +agent_to_server_instant_test_instance = AgentToServerInstantTest.from_json(json) +# print the JSON string representation of the object +print AgentToServerInstantTest.to_json() + +# convert the object into a dict +agent_to_server_instant_test_dict = agent_to_server_instant_test_instance.to_dict() +# create an instance of AgentToServerInstantTest from a dict +agent_to_server_instant_test_form_dict = agent_to_server_instant_test.from_dict(agent_to_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/AgentToServerTest.md b/tests_api/docs/AgentToServerTest.md new file mode 100644 index 00000000..db8ff552 --- /dev/null +++ b/tests_api/docs/AgentToServerTest.md @@ -0,0 +1,62 @@ +# AgentToServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**continuous_mode** | **bool** | To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. | [optional] +**fixed_packet_rate** | **int** | If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1` | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**server** | **str** | Target name or IP address. | +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**ping_payload_size** | **int** | Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests. | [optional] +**network_measurements** | **bool** | View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements. | [optional] [default to False] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] + +## Example + +```python +from tests_api.models.agent_to_server_test import AgentToServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToServerTest from a JSON string +agent_to_server_test_instance = AgentToServerTest.from_json(json) +# print the JSON string representation of the object +print AgentToServerTest.to_json() + +# convert the object into a dict +agent_to_server_test_dict = agent_to_server_test_instance.to_dict() +# create an instance of AgentToServerTest from a dict +agent_to_server_test_form_dict = agent_to_server_test.from_dict(agent_to_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/AgentToServerTests.md b/tests_api/docs/AgentToServerTests.md new file mode 100644 index 00000000..dd8c3eac --- /dev/null +++ b/tests_api/docs/AgentToServerTests.md @@ -0,0 +1,28 @@ +# AgentToServerTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[AgentToServerTest]**](AgentToServerTest.md) | | [optional] + +## Example + +```python +from tests_api.models.agent_to_server_tests import AgentToServerTests + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToServerTests from a JSON string +agent_to_server_tests_instance = AgentToServerTests.from_json(json) +# print the JSON string representation of the object +print AgentToServerTests.to_json() + +# convert the object into a dict +agent_to_server_tests_dict = agent_to_server_tests_instance.to_dict() +# create an instance of AgentToServerTests from a dict +agent_to_server_tests_form_dict = agent_to_server_tests.from_dict(agent_to_server_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/AlertRoundsViolationMode.md b/tests_api/docs/AlertRoundsViolationMode.md new file mode 100644 index 00000000..a4609630 --- /dev/null +++ b/tests_api/docs/AlertRoundsViolationMode.md @@ -0,0 +1,11 @@ +# AlertRoundsViolationMode + +`exact` requires that the same agent(s) meet the threshold in consecutive rounds; default is `any` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/AlertRule.md b/tests_api/docs/AlertRule.md new file mode 100644 index 00000000..bec80e4e --- /dev/null +++ b/tests_api/docs/AlertRule.md @@ -0,0 +1,38 @@ +# AlertRule + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rule_id** | **str** | Unique ID of the rule | [optional] [readonly] +**rule_name** | **str** | Name of the alert rule | [optional] [readonly] +**expression** | **str** | String expression of alert rule | [optional] [readonly] +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**is_default** | **bool** | Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here | [optional] [readonly] +**alert_type** | [**AlertType**](AlertType.md) | | [optional] +**minimum_sources** | **int** | The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert | [optional] [readonly] +**minimum_sources_pct** | **int** | the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert | [optional] [readonly] +**rounds_violating_mode** | [**AlertRoundsViolationMode**](AlertRoundsViolationMode.md) | | [optional] +**rounds_violating_out_of** | **int** | Specifies the divisor (y value) for the “X of Y times” condition. | [optional] [readonly] +**rounds_violating_required** | **int** | Specifies the numerator (x value) for the “X of Y times” condition | [optional] [readonly] + +## Example + +```python +from tests_api.models.alert_rule import AlertRule + +# TODO update the JSON string below +json = "{}" +# create an instance of AlertRule from a JSON string +alert_rule_instance = AlertRule.from_json(json) +# print the JSON string representation of the object +print AlertRule.to_json() + +# convert the object into a dict +alert_rule_dict = alert_rule_instance.to_dict() +# create an instance of AlertRule from a dict +alert_rule_form_dict = alert_rule.from_dict(alert_rule_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/AlertType.md b/tests_api/docs/AlertType.md new file mode 100644 index 00000000..541a3038 --- /dev/null +++ b/tests_api/docs/AlertType.md @@ -0,0 +1,11 @@ +# AlertType + +Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.thousandeyes.com/v7/alerts/#/alert-details) documentation for a list of possible values + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/AllTestTypesApi.md b/tests_api/docs/AllTestTypesApi.md new file mode 100644 index 00000000..e10dcaeb --- /dev/null +++ b/tests_api/docs/AllTestTypesApi.md @@ -0,0 +1,93 @@ +# tests_api.AllTestTypesApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_tests**](AllTestTypesApi.md#get_tests) | **GET** /v7/tests | List configured tests + + +# **get_tests** +> GetTests200Response get_tests(aid=aid) + +List configured tests + +Returns configured tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_tests200_response import GetTests200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.AllTestTypesApi(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 configured tests + api_response = api_instance.get_tests(aid=aid) + print("The response of AllTestTypesApi->get_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AllTestTypesApi->get_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetTests200Response**](GetTests200Response.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) + diff --git a/tests_api/docs/BGPApi.md b/tests_api/docs/BGPApi.md new file mode 100644 index 00000000..11b8b7fe --- /dev/null +++ b/tests_api/docs/BGPApi.md @@ -0,0 +1,453 @@ +# tests_api.BGPApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_bgp_test**](BGPApi.md#create_bgp_test) | **POST** /v7/tests/bgp | Create BGP test +[**delete_bgp_test**](BGPApi.md#delete_bgp_test) | **DELETE** /v7/tests/bgp/{testId} | Delete BGP test +[**get_bgp_test**](BGPApi.md#get_bgp_test) | **GET** /v7/tests/bgp/{testId} | Get BGP test +[**get_bgp_tests**](BGPApi.md#get_bgp_tests) | **GET** /v7/tests/bgp | List BGP tests +[**update_bgp_test**](BGPApi.md#update_bgp_test) | **PUT** /v7/tests/bgp/{testId} | Update BGP test + + +# **create_bgp_test** +> BgpTest create_bgp_test(update_bgp_test, aid=aid, expand=expand) + +Create BGP test + +Creates a new BGP test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.bgp_test import BgpTest +from tests_api.models.expand import Expand +from tests_api.models.update_bgp_test import UpdateBgpTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.BGPApi(api_client) + update_bgp_test = tests_api.UpdateBgpTest() # UpdateBgpTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create BGP test + api_response = api_instance.create_bgp_test(update_bgp_test, aid=aid, expand=expand) + print("The response of BGPApi->create_bgp_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPApi->create_bgp_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_bgp_test** | [**UpdateBgpTest**](UpdateBgpTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**BgpTest**](BgpTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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) + +# **delete_bgp_test** +> delete_bgp_test(test_id, aid=aid) + +Delete BGP test + +Deletes a BGP test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.BGPApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 BGP test + api_instance.delete_bgp_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling BGPApi->delete_bgp_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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_bgp_test** +> GetBgpTest200Response get_bgp_test(test_id, aid=aid, expand=expand) + +Get BGP test + +Returns details for a BGP test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_bgp_test200_response import GetBgpTest200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.BGPApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get BGP test + api_response = api_instance.get_bgp_test(test_id, aid=aid, expand=expand) + print("The response of BGPApi->get_bgp_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPApi->get_bgp_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetBgpTest200Response**](GetBgpTest200Response.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_bgp_tests** +> GetBgpTests200Response get_bgp_tests(aid=aid) + +List BGP tests + +Returns a list of BGP tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_bgp_tests200_response import GetBgpTests200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.BGPApi(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 BGP tests + api_response = api_instance.get_bgp_tests(aid=aid) + print("The response of BGPApi->get_bgp_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPApi->get_bgp_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetBgpTests200Response**](GetBgpTests200Response.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_bgp_test** +> GetBgpTest200Response update_bgp_test(test_id, update_bgp_test, aid=aid, expand=expand) + +Update BGP test + +Updates a BGP test. This method requires Account Admin permissions. The target test cannot be a live share or saved event. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_bgp_test200_response import GetBgpTest200Response +from tests_api.models.update_bgp_test import UpdateBgpTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.BGPApi(api_client) + test_id = '281474976710706' # str | ID of the test + update_bgp_test = tests_api.UpdateBgpTest() # UpdateBgpTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update BGP test + api_response = api_instance.update_bgp_test(test_id, update_bgp_test, aid=aid, expand=expand) + print("The response of BGPApi->update_bgp_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPApi->update_bgp_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **update_bgp_test** | [**UpdateBgpTest**](UpdateBgpTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetBgpTest200Response**](GetBgpTest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/tests_api/docs/BaseRequest.md b/tests_api/docs/BaseRequest.md new file mode 100644 index 00000000..1209690b --- /dev/null +++ b/tests_api/docs/BaseRequest.md @@ -0,0 +1,30 @@ +# BaseRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] + +## Example + +```python +from tests_api.models.base_request import BaseRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseRequest from a JSON string +base_request_instance = BaseRequest.from_json(json) +# print the JSON string representation of the object +print BaseRequest.to_json() + +# convert the object into a dict +base_request_dict = base_request_instance.to_dict() +# create an instance of BaseRequest from a dict +base_request_form_dict = base_request.from_dict(base_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) + + diff --git a/tests_api/docs/BaseTest.md b/tests_api/docs/BaseTest.md new file mode 100644 index 00000000..cae1cdbb --- /dev/null +++ b/tests_api/docs/BaseTest.md @@ -0,0 +1,31 @@ +# BaseTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] + +## Example + +```python +from tests_api.models.base_test import BaseTest + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseTest from a JSON string +base_test_instance = BaseTest.from_json(json) +# print the JSON string representation of the object +print BaseTest.to_json() + +# convert the object into a dict +base_test_dict = base_test_instance.to_dict() +# create an instance of BaseTest from a dict +base_test_form_dict = base_test.from_dict(base_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/BgpTest.md b/tests_api/docs/BgpTest.md new file mode 100644 index 00000000..6acb02fa --- /dev/null +++ b/tests_api/docs/BgpTest.md @@ -0,0 +1,46 @@ +# BgpTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**include_covered_prefixes** | **bool** | Indicate if queries for subprefixes detected under this prefix should included. | [optional] +**prefix** | **str** | a.b.c.d is a network address, with the prefix length defined as e. Prefixes can be any length from 8 to 24. | +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used. | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | A list of enabled alert rule objects. | [optional] + +## Example + +```python +from tests_api.models.bgp_test import BgpTest + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpTest from a JSON string +bgp_test_instance = BgpTest.from_json(json) +# print the JSON string representation of the object +print BgpTest.to_json() + +# convert the object into a dict +bgp_test_dict = bgp_test_instance.to_dict() +# create an instance of BgpTest from a dict +bgp_test_form_dict = bgp_test.from_dict(bgp_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/BgpTests.md b/tests_api/docs/BgpTests.md new file mode 100644 index 00000000..a1f1d0ad --- /dev/null +++ b/tests_api/docs/BgpTests.md @@ -0,0 +1,28 @@ +# BgpTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[BgpTest]**](BgpTest.md) | | [optional] + +## Example + +```python +from tests_api.models.bgp_tests import BgpTests + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpTests from a JSON string +bgp_tests_instance = BgpTests.from_json(json) +# print the JSON string representation of the object +print BgpTests.to_json() + +# convert the object into a dict +bgp_tests_dict = bgp_tests_instance.to_dict() +# create an instance of BgpTests from a dict +bgp_tests_form_dict = bgp_tests.from_dict(bgp_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/CloudEnterpriseAgentType.md b/tests_api/docs/CloudEnterpriseAgentType.md new file mode 100644 index 00000000..951c803e --- /dev/null +++ b/tests_api/docs/CloudEnterpriseAgentType.md @@ -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) + + diff --git a/tests_api/docs/DNSSECApi.md b/tests_api/docs/DNSSECApi.md new file mode 100644 index 00000000..cdaecc55 --- /dev/null +++ b/tests_api/docs/DNSSECApi.md @@ -0,0 +1,453 @@ +# tests_api.DNSSECApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_dns_sec_test**](DNSSECApi.md#create_dns_sec_test) | **POST** /v7/tests/dnssec | Create DNSSEC test +[**delete_dns_sec_test**](DNSSECApi.md#delete_dns_sec_test) | **DELETE** /v7/tests/dnssec/{testId} | Delete DNSSEC test +[**get_dns_sec_test**](DNSSECApi.md#get_dns_sec_test) | **GET** /v7/tests/dnssec/{testId} | Get DNSSEC test +[**get_dns_sec_tests**](DNSSECApi.md#get_dns_sec_tests) | **GET** /v7/tests/dnssec | List DNS Sec tests +[**update_dns_sec_test**](DNSSECApi.md#update_dns_sec_test) | **PUT** /v7/tests/dnssec/{testId} | Update DNSSEC test + + +# **create_dns_sec_test** +> DnsSecTest create_dns_sec_test(update_dns_sec_test, aid=aid, expand=expand) + +Create DNSSEC test + +Creates a new DNSSEC test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.dns_sec_test import DnsSecTest +from tests_api.models.expand import Expand +from tests_api.models.update_dns_sec_test import UpdateDnsSecTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSSECApi(api_client) + update_dns_sec_test = tests_api.UpdateDnsSecTest() # UpdateDnsSecTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create DNSSEC test + api_response = api_instance.create_dns_sec_test(update_dns_sec_test, aid=aid, expand=expand) + print("The response of DNSSECApi->create_dns_sec_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSSECApi->create_dns_sec_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_dns_sec_test** | [**UpdateDnsSecTest**](UpdateDnsSecTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**DnsSecTest**](DnsSecTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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) + +# **delete_dns_sec_test** +> delete_dns_sec_test(test_id, aid=aid) + +Delete DNSSEC test + +Deletes the specified DNSSEC test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSSECApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 DNSSEC test + api_instance.delete_dns_sec_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling DNSSECApi->delete_dns_sec_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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_dns_sec_test** +> GetDnsSecTest200Response get_dns_sec_test(test_id, aid=aid, expand=expand) + +Get DNSSEC test + +Returns details for a DNSSEC test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_dns_sec_test200_response import GetDnsSecTest200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSSECApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get DNSSEC test + api_response = api_instance.get_dns_sec_test(test_id, aid=aid, expand=expand) + print("The response of DNSSECApi->get_dns_sec_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSSECApi->get_dns_sec_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetDnsSecTest200Response**](GetDnsSecTest200Response.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_dns_sec_tests** +> GetDnsSecTests200Response get_dns_sec_tests(aid=aid) + +List DNS Sec tests + +Returns a list of all DNS Sec tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_dns_sec_tests200_response import GetDnsSecTests200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSSECApi(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 DNS Sec tests + api_response = api_instance.get_dns_sec_tests(aid=aid) + print("The response of DNSSECApi->get_dns_sec_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSSECApi->get_dns_sec_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetDnsSecTests200Response**](GetDnsSecTests200Response.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_dns_sec_test** +> GetDnsSecTest200Response update_dns_sec_test(test_id, update_dns_sec_test, aid=aid, expand=expand) + +Update DNSSEC test + +Updates a DNSSEC test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_dns_sec_test200_response import GetDnsSecTest200Response +from tests_api.models.update_dns_sec_test import UpdateDnsSecTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSSECApi(api_client) + test_id = '281474976710706' # str | ID of the test + update_dns_sec_test = tests_api.UpdateDnsSecTest() # UpdateDnsSecTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update DNSSEC test + api_response = api_instance.update_dns_sec_test(test_id, update_dns_sec_test, aid=aid, expand=expand) + print("The response of DNSSECApi->update_dns_sec_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSSECApi->update_dns_sec_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **update_dns_sec_test** | [**UpdateDnsSecTest**](UpdateDnsSecTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetDnsSecTest200Response**](GetDnsSecTest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/tests_api/docs/DNSServerApi.md b/tests_api/docs/DNSServerApi.md new file mode 100644 index 00000000..a31e32ab --- /dev/null +++ b/tests_api/docs/DNSServerApi.md @@ -0,0 +1,453 @@ +# tests_api.DNSServerApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_dns_server_test**](DNSServerApi.md#create_dns_server_test) | **POST** /v7/tests/dns-server | Create DNS Server test +[**delete_dns_server_test**](DNSServerApi.md#delete_dns_server_test) | **DELETE** /v7/tests/dns-server/{testId} | Delete DNS Server test +[**get_dns_server_test**](DNSServerApi.md#get_dns_server_test) | **GET** /v7/tests/dns-server/{testId} | Get DNS Server test +[**get_dns_server_tests**](DNSServerApi.md#get_dns_server_tests) | **GET** /v7/tests/dns-server | List DNS Server tests +[**update_dns_server_test**](DNSServerApi.md#update_dns_server_test) | **PUT** /v7/tests/dns-server/{testId} | Update DNS Server test + + +# **create_dns_server_test** +> DnsServerTest create_dns_server_test(update_dns_server_test, aid=aid, expand=expand) + +Create DNS Server test + +Creates a new DNS Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.dns_server_test import DnsServerTest +from tests_api.models.expand import Expand +from tests_api.models.update_dns_server_test import UpdateDnsServerTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSServerApi(api_client) + update_dns_server_test = tests_api.UpdateDnsServerTest() # UpdateDnsServerTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create DNS Server test + api_response = api_instance.create_dns_server_test(update_dns_server_test, aid=aid, expand=expand) + print("The response of DNSServerApi->create_dns_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerApi->create_dns_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_dns_server_test** | [**UpdateDnsServerTest**](UpdateDnsServerTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**DnsServerTest**](DnsServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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) + +# **delete_dns_server_test** +> delete_dns_server_test(test_id, aid=aid) + +Delete DNS Server test + +Deletes the specified DNS Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 DNS Server test + api_instance.delete_dns_server_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling DNSServerApi->delete_dns_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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_dns_server_test** +> GetDNSServerTest200Response get_dns_server_test(test_id, aid=aid, expand=expand) + +Get DNS Server test + +Returns details for a DNS Server test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_dns_server_test200_response import GetDNSServerTest200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get DNS Server test + api_response = api_instance.get_dns_server_test(test_id, aid=aid, expand=expand) + print("The response of DNSServerApi->get_dns_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerApi->get_dns_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetDNSServerTest200Response**](GetDNSServerTest200Response.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_dns_server_tests** +> GetDNSServerTests200Response get_dns_server_tests(aid=aid) + +List DNS Server tests + +Returns a list of all DNS Server tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_dns_server_tests200_response import GetDNSServerTests200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSServerApi(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 DNS Server tests + api_response = api_instance.get_dns_server_tests(aid=aid) + print("The response of DNSServerApi->get_dns_server_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerApi->get_dns_server_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetDNSServerTests200Response**](GetDNSServerTests200Response.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_dns_server_test** +> GetDNSServerTest200Response update_dns_server_test(test_id, update_dns_server_test, aid=aid, expand=expand) + +Update DNS Server test + +Updates a DNS Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_dns_server_test200_response import GetDNSServerTest200Response +from tests_api.models.update_dns_server_test import UpdateDnsServerTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + update_dns_server_test = tests_api.UpdateDnsServerTest() # UpdateDnsServerTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update DNS Server test + api_response = api_instance.update_dns_server_test(test_id, update_dns_server_test, aid=aid, expand=expand) + print("The response of DNSServerApi->update_dns_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerApi->update_dns_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **update_dns_server_test** | [**UpdateDnsServerTest**](UpdateDnsServerTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetDNSServerTest200Response**](GetDNSServerTest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/tests_api/docs/DNSTraceApi.md b/tests_api/docs/DNSTraceApi.md new file mode 100644 index 00000000..65a109d7 --- /dev/null +++ b/tests_api/docs/DNSTraceApi.md @@ -0,0 +1,453 @@ +# tests_api.DNSTraceApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_dns_trace_test**](DNSTraceApi.md#create_dns_trace_test) | **POST** /v7/tests/dns-trace | Create DNS Trace test +[**delete_dns_trace_test**](DNSTraceApi.md#delete_dns_trace_test) | **DELETE** /v7/tests/dns-trace/{testId} | Delete DNS Trace test +[**get_dns_trace_test**](DNSTraceApi.md#get_dns_trace_test) | **GET** /v7/tests/dns-trace/{testId} | Get DNS Trace test +[**get_dns_trace_tests**](DNSTraceApi.md#get_dns_trace_tests) | **GET** /v7/tests/dns-trace | List DNS Trace tests +[**update_dns_trace_test**](DNSTraceApi.md#update_dns_trace_test) | **PUT** /v7/tests/dns-trace/{testId} | Update DNS Trace test + + +# **create_dns_trace_test** +> DnsTraceTest create_dns_trace_test(update_dns_trace_test, aid=aid, expand=expand) + +Create DNS Trace test + +Creates a new DNS Trace test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.dns_trace_test import DnsTraceTest +from tests_api.models.expand import Expand +from tests_api.models.update_dns_trace_test import UpdateDnsTraceTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSTraceApi(api_client) + update_dns_trace_test = tests_api.UpdateDnsTraceTest() # UpdateDnsTraceTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create DNS Trace test + api_response = api_instance.create_dns_trace_test(update_dns_trace_test, aid=aid, expand=expand) + print("The response of DNSTraceApi->create_dns_trace_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSTraceApi->create_dns_trace_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_dns_trace_test** | [**UpdateDnsTraceTest**](UpdateDnsTraceTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**DnsTraceTest**](DnsTraceTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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) + +# **delete_dns_trace_test** +> delete_dns_trace_test(test_id, aid=aid) + +Delete DNS Trace test + +Deletes the specified DNS Trace test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSTraceApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 DNS Trace test + api_instance.delete_dns_trace_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling DNSTraceApi->delete_dns_trace_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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_dns_trace_test** +> GetDnsTraceTest200Response get_dns_trace_test(test_id, aid=aid, expand=expand) + +Get DNS Trace test + +Returns details for a DNS Trace test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_dns_trace_test200_response import GetDnsTraceTest200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSTraceApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get DNS Trace test + api_response = api_instance.get_dns_trace_test(test_id, aid=aid, expand=expand) + print("The response of DNSTraceApi->get_dns_trace_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSTraceApi->get_dns_trace_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetDnsTraceTest200Response**](GetDnsTraceTest200Response.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_dns_trace_tests** +> GetDnsTraceTests200Response get_dns_trace_tests(aid=aid) + +List DNS Trace tests + +Returns a list of all DNS Trace tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_dns_trace_tests200_response import GetDnsTraceTests200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSTraceApi(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 DNS Trace tests + api_response = api_instance.get_dns_trace_tests(aid=aid) + print("The response of DNSTraceApi->get_dns_trace_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSTraceApi->get_dns_trace_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetDnsTraceTests200Response**](GetDnsTraceTests200Response.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_dns_trace_test** +> GetDnsTraceTest200Response update_dns_trace_test(test_id, update_dns_trace_test, aid=aid, expand=expand) + +Update DNS Trace test + +Updates a DNS Trace test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_dns_trace_test200_response import GetDnsTraceTest200Response +from tests_api.models.update_dns_trace_test import UpdateDnsTraceTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.DNSTraceApi(api_client) + test_id = '281474976710706' # str | ID of the test + update_dns_trace_test = tests_api.UpdateDnsTraceTest() # UpdateDnsTraceTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update DNS Trace test + api_response = api_instance.update_dns_trace_test(test_id, update_dns_trace_test, aid=aid, expand=expand) + print("The response of DNSTraceApi->update_dns_trace_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSTraceApi->update_dns_trace_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **update_dns_trace_test** | [**UpdateDnsTraceTest**](UpdateDnsTraceTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetDnsTraceTest200Response**](GetDnsTraceTest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/tests_api/docs/DnsQueryClass.md b/tests_api/docs/DnsQueryClass.md new file mode 100644 index 00000000..b4de0b88 --- /dev/null +++ b/tests_api/docs/DnsQueryClass.md @@ -0,0 +1,11 @@ +# DnsQueryClass + +Domain class used by this test. 'in' stands for Internet, while 'ch' stands for Chaos. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/DnsSecInstantTest.md b/tests_api/docs/DnsSecInstantTest.md new file mode 100644 index 00000000..cb358ac8 --- /dev/null +++ b/tests_api/docs/DnsSecInstantTest.md @@ -0,0 +1,43 @@ +# DnsSecInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from tests_api.models.dns_sec_instant_test import DnsSecInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsSecInstantTest from a JSON string +dns_sec_instant_test_instance = DnsSecInstantTest.from_json(json) +# print the JSON string representation of the object +print DnsSecInstantTest.to_json() + +# convert the object into a dict +dns_sec_instant_test_dict = dns_sec_instant_test_instance.to_dict() +# create an instance of DnsSecInstantTest from a dict +dns_sec_instant_test_form_dict = dns_sec_instant_test.from_dict(dns_sec_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/DnsSecTest.md b/tests_api/docs/DnsSecTest.md new file mode 100644 index 00000000..d1891a54 --- /dev/null +++ b/tests_api/docs/DnsSecTest.md @@ -0,0 +1,47 @@ +# DnsSecTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from tests_api.models.dns_sec_test import DnsSecTest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsSecTest from a JSON string +dns_sec_test_instance = DnsSecTest.from_json(json) +# print the JSON string representation of the object +print DnsSecTest.to_json() + +# convert the object into a dict +dns_sec_test_dict = dns_sec_test_instance.to_dict() +# create an instance of DnsSecTest from a dict +dns_sec_test_form_dict = dns_sec_test.from_dict(dns_sec_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/DnsSecTests.md b/tests_api/docs/DnsSecTests.md new file mode 100644 index 00000000..01b72b34 --- /dev/null +++ b/tests_api/docs/DnsSecTests.md @@ -0,0 +1,28 @@ +# DnsSecTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[DnsSecTest]**](DnsSecTest.md) | | [optional] + +## Example + +```python +from tests_api.models.dns_sec_tests import DnsSecTests + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsSecTests from a JSON string +dns_sec_tests_instance = DnsSecTests.from_json(json) +# print the JSON string representation of the object +print DnsSecTests.to_json() + +# convert the object into a dict +dns_sec_tests_dict = dns_sec_tests_instance.to_dict() +# create an instance of DnsSecTests from a dict +dns_sec_tests_form_dict = dns_sec_tests.from_dict(dns_sec_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/DnsServerInstantTest.md b/tests_api/docs/DnsServerInstantTest.md new file mode 100644 index 00000000..39da4a09 --- /dev/null +++ b/tests_api/docs/DnsServerInstantTest.md @@ -0,0 +1,55 @@ +# DnsServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**dns_servers** | [**List[TestDnsServer]**](TestDnsServer.md) | | +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**recursive_queries** | **bool** | Set true to run query with RD (recursion desired) flag enabled. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from tests_api.models.dns_server_instant_test import DnsServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsServerInstantTest from a JSON string +dns_server_instant_test_instance = DnsServerInstantTest.from_json(json) +# print the JSON string representation of the object +print DnsServerInstantTest.to_json() + +# convert the object into a dict +dns_server_instant_test_dict = dns_server_instant_test_instance.to_dict() +# create an instance of DnsServerInstantTest from a dict +dns_server_instant_test_form_dict = dns_server_instant_test.from_dict(dns_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/DnsServerTest.md b/tests_api/docs/DnsServerTest.md new file mode 100644 index 00000000..2ab41e36 --- /dev/null +++ b/tests_api/docs/DnsServerTest.md @@ -0,0 +1,61 @@ +# DnsServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**dns_servers** | [**List[TestDnsServer]**](TestDnsServer.md) | | +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**recursive_queries** | **bool** | Set true to run query with RD (recursion desired) flag enabled. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] + +## Example + +```python +from tests_api.models.dns_server_test import DnsServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsServerTest from a JSON string +dns_server_test_instance = DnsServerTest.from_json(json) +# print the JSON string representation of the object +print DnsServerTest.to_json() + +# convert the object into a dict +dns_server_test_dict = dns_server_test_instance.to_dict() +# create an instance of DnsServerTest from a dict +dns_server_test_form_dict = dns_server_test.from_dict(dns_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/DnsServerTests.md b/tests_api/docs/DnsServerTests.md new file mode 100644 index 00000000..cc46f383 --- /dev/null +++ b/tests_api/docs/DnsServerTests.md @@ -0,0 +1,28 @@ +# DnsServerTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[DnsServerTest]**](DnsServerTest.md) | | [optional] + +## Example + +```python +from tests_api.models.dns_server_tests import DnsServerTests + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsServerTests from a JSON string +dns_server_tests_instance = DnsServerTests.from_json(json) +# print the JSON string representation of the object +print DnsServerTests.to_json() + +# convert the object into a dict +dns_server_tests_dict = dns_server_tests_instance.to_dict() +# create an instance of DnsServerTests from a dict +dns_server_tests_form_dict = dns_server_tests.from_dict(dns_server_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/DnsTraceInstantTest.md b/tests_api/docs/DnsTraceInstantTest.md new file mode 100644 index 00000000..1e616484 --- /dev/null +++ b/tests_api/docs/DnsTraceInstantTest.md @@ -0,0 +1,44 @@ +# DnsTraceInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from tests_api.models.dns_trace_instant_test import DnsTraceInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsTraceInstantTest from a JSON string +dns_trace_instant_test_instance = DnsTraceInstantTest.from_json(json) +# print the JSON string representation of the object +print DnsTraceInstantTest.to_json() + +# convert the object into a dict +dns_trace_instant_test_dict = dns_trace_instant_test_instance.to_dict() +# create an instance of DnsTraceInstantTest from a dict +dns_trace_instant_test_form_dict = dns_trace_instant_test.from_dict(dns_trace_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/DnsTraceTest.md b/tests_api/docs/DnsTraceTest.md new file mode 100644 index 00000000..9052cb44 --- /dev/null +++ b/tests_api/docs/DnsTraceTest.md @@ -0,0 +1,48 @@ +# DnsTraceTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from tests_api.models.dns_trace_test import DnsTraceTest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsTraceTest from a JSON string +dns_trace_test_instance = DnsTraceTest.from_json(json) +# print the JSON string representation of the object +print DnsTraceTest.to_json() + +# convert the object into a dict +dns_trace_test_dict = dns_trace_test_instance.to_dict() +# create an instance of DnsTraceTest from a dict +dns_trace_test_form_dict = dns_trace_test.from_dict(dns_trace_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/DnsTraceTests.md b/tests_api/docs/DnsTraceTests.md new file mode 100644 index 00000000..6b9b1d5e --- /dev/null +++ b/tests_api/docs/DnsTraceTests.md @@ -0,0 +1,28 @@ +# DnsTraceTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[DnsTraceTest]**](DnsTraceTest.md) | | [optional] + +## Example + +```python +from tests_api.models.dns_trace_tests import DnsTraceTests + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsTraceTests from a JSON string +dns_trace_tests_instance = DnsTraceTests.from_json(json) +# print the JSON string representation of the object +print DnsTraceTests.to_json() + +# convert the object into a dict +dns_trace_tests_dict = dns_trace_tests_instance.to_dict() +# create an instance of DnsTraceTests from a dict +dns_trace_tests_form_dict = dns_trace_tests.from_dict(dns_trace_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/Error.md b/tests_api/docs/Error.md new file mode 100644 index 00000000..7bc50c49 --- /dev/null +++ b/tests_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from tests_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/Expand.md b/tests_api/docs/Expand.md new file mode 100644 index 00000000..5d5b5ca2 --- /dev/null +++ b/tests_api/docs/Expand.md @@ -0,0 +1,10 @@ +# Expand + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/FTPServerApi.md b/tests_api/docs/FTPServerApi.md new file mode 100644 index 00000000..b7dbc2cf --- /dev/null +++ b/tests_api/docs/FTPServerApi.md @@ -0,0 +1,451 @@ +# tests_api.FTPServerApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_ftp_server_test**](FTPServerApi.md#create_ftp_server_test) | **POST** /v7/tests/ftp-server | Create FTP Server test +[**delete_ftp_server_test**](FTPServerApi.md#delete_ftp_server_test) | **DELETE** /v7/tests/ftp-server/{testId} | Delete FTP Server test +[**get_ftp_server_test**](FTPServerApi.md#get_ftp_server_test) | **GET** /v7/tests/ftp-server/{testId} | Get FTP Server test +[**get_ftp_server_tests**](FTPServerApi.md#get_ftp_server_tests) | **GET** /v7/tests/ftp-server | List FTP Server tests +[**update_ftp_server_test**](FTPServerApi.md#update_ftp_server_test) | **PUT** /v7/tests/ftp-server/{testId} | Update FTP Server test + + +# **create_ftp_server_test** +> FtpServerTest create_ftp_server_test(update_ftp_server_test, aid=aid, expand=expand) + +Create FTP Server test + +Creates a new FTP Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.ftp_server_test import FtpServerTest +from tests_api.models.update_ftp_server_test import UpdateFtpServerTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.FTPServerApi(api_client) + update_ftp_server_test = tests_api.UpdateFtpServerTest() # UpdateFtpServerTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create FTP Server test + api_response = api_instance.create_ftp_server_test(update_ftp_server_test, aid=aid, expand=expand) + print("The response of FTPServerApi->create_ftp_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FTPServerApi->create_ftp_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_ftp_server_test** | [**UpdateFtpServerTest**](UpdateFtpServerTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**FtpServerTest**](FtpServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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) + +# **delete_ftp_server_test** +> delete_ftp_server_test(test_id, aid=aid) + +Delete FTP Server test + +Deletes the specified FTP Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.FTPServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 FTP Server test + api_instance.delete_ftp_server_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling FTPServerApi->delete_ftp_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | - | + +[[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_ftp_server_test** +> GetFtpServerTest200Response get_ftp_server_test(test_id, aid=aid, expand=expand) + +Get FTP Server test + +Returns details for a FTP Server test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_ftp_server_test200_response import GetFtpServerTest200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.FTPServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get FTP Server test + api_response = api_instance.get_ftp_server_test(test_id, aid=aid, expand=expand) + print("The response of FTPServerApi->get_ftp_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FTPServerApi->get_ftp_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetFtpServerTest200Response**](GetFtpServerTest200Response.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_ftp_server_tests** +> GetFtpServerTests200Response get_ftp_server_tests(aid=aid) + +List FTP Server tests + +Returns a list of FTP Server tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_ftp_server_tests200_response import GetFtpServerTests200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.FTPServerApi(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 FTP Server tests + api_response = api_instance.get_ftp_server_tests(aid=aid) + print("The response of FTPServerApi->get_ftp_server_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FTPServerApi->get_ftp_server_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetFtpServerTests200Response**](GetFtpServerTests200Response.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_ftp_server_test** +> GetFtpServerTest200Response update_ftp_server_test(test_id, update_ftp_server_test, aid=aid, expand=expand) + +Update FTP Server test + +Updates a FTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_ftp_server_test200_response import GetFtpServerTest200Response +from tests_api.models.update_ftp_server_test import UpdateFtpServerTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.FTPServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + update_ftp_server_test = tests_api.UpdateFtpServerTest() # UpdateFtpServerTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update FTP Server test + api_response = api_instance.update_ftp_server_test(test_id, update_ftp_server_test, aid=aid, expand=expand) + print("The response of FTPServerApi->update_ftp_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FTPServerApi->update_ftp_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **update_ftp_server_test** | [**UpdateFtpServerTest**](UpdateFtpServerTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetFtpServerTest200Response**](GetFtpServerTest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/tests_api/docs/FtpServerInstantTest.md b/tests_api/docs/FtpServerInstantTest.md new file mode 100644 index 00000000..f10687aa --- /dev/null +++ b/tests_api/docs/FtpServerInstantTest.md @@ -0,0 +1,59 @@ +# FtpServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**download_limit** | **int** | Specify maximum number of bytes to download from the target object. | [optional] +**ftp_target_time** | **int** | Target time for operation completion; specified in milliseconds. | [optional] +**ftp_time_limit** | **int** | Set the time limit for the test in seconds. | [optional] [default to 10] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**request_type** | [**FtpServerRequestType**](FtpServerRequestType.md) | | +**url** | **str** | Target for the test. | +**use_active_ftp** | **bool** | Explicitly set the flag to use active FTP. | [optional] [default to False] +**use_explicit_ftps** | **bool** | Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] + +## Example + +```python +from tests_api.models.ftp_server_instant_test import FtpServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of FtpServerInstantTest from a JSON string +ftp_server_instant_test_instance = FtpServerInstantTest.from_json(json) +# print the JSON string representation of the object +print FtpServerInstantTest.to_json() + +# convert the object into a dict +ftp_server_instant_test_dict = ftp_server_instant_test_instance.to_dict() +# create an instance of FtpServerInstantTest from a dict +ftp_server_instant_test_form_dict = ftp_server_instant_test.from_dict(ftp_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/FtpServerRequestType.md b/tests_api/docs/FtpServerRequestType.md new file mode 100644 index 00000000..1180b3a5 --- /dev/null +++ b/tests_api/docs/FtpServerRequestType.md @@ -0,0 +1,11 @@ +# FtpServerRequestType + +Set the type of activity for the test. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/FtpServerTest.md b/tests_api/docs/FtpServerTest.md new file mode 100644 index 00000000..95d82630 --- /dev/null +++ b/tests_api/docs/FtpServerTest.md @@ -0,0 +1,65 @@ +# FtpServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**download_limit** | **int** | Specify maximum number of bytes to download from the target object. | [optional] +**ftp_target_time** | **int** | Target time for operation completion; specified in milliseconds. | [optional] +**ftp_time_limit** | **int** | Set the time limit for the test in seconds. | [optional] [default to 10] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**request_type** | [**FtpServerRequestType**](FtpServerRequestType.md) | | +**url** | **str** | Target for the test. | +**use_active_ftp** | **bool** | Explicitly set the flag to use active FTP. | [optional] [default to False] +**use_explicit_ftps** | **bool** | Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] + +## Example + +```python +from tests_api.models.ftp_server_test import FtpServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of FtpServerTest from a JSON string +ftp_server_test_instance = FtpServerTest.from_json(json) +# print the JSON string representation of the object +print FtpServerTest.to_json() + +# convert the object into a dict +ftp_server_test_dict = ftp_server_test_instance.to_dict() +# create an instance of FtpServerTest from a dict +ftp_server_test_form_dict = ftp_server_test.from_dict(ftp_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/FtpServerTests.md b/tests_api/docs/FtpServerTests.md new file mode 100644 index 00000000..a0c39f8b --- /dev/null +++ b/tests_api/docs/FtpServerTests.md @@ -0,0 +1,28 @@ +# FtpServerTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[FtpServerTest]**](FtpServerTest.md) | | [optional] + +## Example + +```python +from tests_api.models.ftp_server_tests import FtpServerTests + +# TODO update the JSON string below +json = "{}" +# create an instance of FtpServerTests from a JSON string +ftp_server_tests_instance = FtpServerTests.from_json(json) +# print the JSON string representation of the object +print FtpServerTests.to_json() + +# convert the object into a dict +ftp_server_tests_dict = ftp_server_tests_instance.to_dict() +# create an instance of FtpServerTests from a dict +ftp_server_tests_form_dict = ftp_server_tests.from_dict(ftp_server_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetAgentToAgentTest200Response.md b/tests_api/docs/GetAgentToAgentTest200Response.md new file mode 100644 index 00000000..98c93979 --- /dev/null +++ b/tests_api/docs/GetAgentToAgentTest200Response.md @@ -0,0 +1,60 @@ +# GetAgentToAgentTest200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**mss** | **int** | Maximum segment size, in bytes. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**protocol** | [**AgentToAgentTestProtocol**](AgentToAgentTestProtocol.md) | | [optional] +**target_agent_id** | **str** | `agentId` of the target agent for the test. | +**throughput_measurements** | **bool** | Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent. | [optional] [default to False] +**throughput_duration** | **int** | The throughput duration. | [optional] [default to 10000] +**throughput_rate** | **int** | The throughput rate, only applicable for UDP protocol. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] + +## Example + +```python +from tests_api.models.get_agent_to_agent_test200_response import GetAgentToAgentTest200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAgentToAgentTest200Response from a JSON string +get_agent_to_agent_test200_response_instance = GetAgentToAgentTest200Response.from_json(json) +# print the JSON string representation of the object +print GetAgentToAgentTest200Response.to_json() + +# convert the object into a dict +get_agent_to_agent_test200_response_dict = get_agent_to_agent_test200_response_instance.to_dict() +# create an instance of GetAgentToAgentTest200Response from a dict +get_agent_to_agent_test200_response_form_dict = get_agent_to_agent_test200_response.from_dict(get_agent_to_agent_test200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetAgentToAgentTests200Response.md b/tests_api/docs/GetAgentToAgentTests200Response.md new file mode 100644 index 00000000..65c7048c --- /dev/null +++ b/tests_api/docs/GetAgentToAgentTests200Response.md @@ -0,0 +1,29 @@ +# GetAgentToAgentTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[AgentToAgentTest]**](AgentToAgentTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_agent_to_agent_tests200_response import GetAgentToAgentTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAgentToAgentTests200Response from a JSON string +get_agent_to_agent_tests200_response_instance = GetAgentToAgentTests200Response.from_json(json) +# print the JSON string representation of the object +print GetAgentToAgentTests200Response.to_json() + +# convert the object into a dict +get_agent_to_agent_tests200_response_dict = get_agent_to_agent_tests200_response_instance.to_dict() +# create an instance of GetAgentToAgentTests200Response from a dict +get_agent_to_agent_tests200_response_form_dict = get_agent_to_agent_tests200_response.from_dict(get_agent_to_agent_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetAgentToServerTest200Response.md b/tests_api/docs/GetAgentToServerTest200Response.md new file mode 100644 index 00000000..5c7f62ae --- /dev/null +++ b/tests_api/docs/GetAgentToServerTest200Response.md @@ -0,0 +1,62 @@ +# GetAgentToServerTest200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**continuous_mode** | **bool** | To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. | [optional] +**fixed_packet_rate** | **int** | If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1` | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**server** | **str** | Target name or IP address. | +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**ping_payload_size** | **int** | Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests. | [optional] +**network_measurements** | **bool** | View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements. | [optional] [default to False] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] + +## Example + +```python +from tests_api.models.get_agent_to_server_test200_response import GetAgentToServerTest200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAgentToServerTest200Response from a JSON string +get_agent_to_server_test200_response_instance = GetAgentToServerTest200Response.from_json(json) +# print the JSON string representation of the object +print GetAgentToServerTest200Response.to_json() + +# convert the object into a dict +get_agent_to_server_test200_response_dict = get_agent_to_server_test200_response_instance.to_dict() +# create an instance of GetAgentToServerTest200Response from a dict +get_agent_to_server_test200_response_form_dict = get_agent_to_server_test200_response.from_dict(get_agent_to_server_test200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetAgentToServerTests200Response.md b/tests_api/docs/GetAgentToServerTests200Response.md new file mode 100644 index 00000000..4038faf4 --- /dev/null +++ b/tests_api/docs/GetAgentToServerTests200Response.md @@ -0,0 +1,29 @@ +# GetAgentToServerTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[AgentToServerTest]**](AgentToServerTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_agent_to_server_tests200_response import GetAgentToServerTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAgentToServerTests200Response from a JSON string +get_agent_to_server_tests200_response_instance = GetAgentToServerTests200Response.from_json(json) +# print the JSON string representation of the object +print GetAgentToServerTests200Response.to_json() + +# convert the object into a dict +get_agent_to_server_tests200_response_dict = get_agent_to_server_tests200_response_instance.to_dict() +# create an instance of GetAgentToServerTests200Response from a dict +get_agent_to_server_tests200_response_form_dict = get_agent_to_server_tests200_response.from_dict(get_agent_to_server_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetBgpTest200Response.md b/tests_api/docs/GetBgpTest200Response.md new file mode 100644 index 00000000..dfecccf8 --- /dev/null +++ b/tests_api/docs/GetBgpTest200Response.md @@ -0,0 +1,46 @@ +# GetBgpTest200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**include_covered_prefixes** | **bool** | Indicate if queries for subprefixes detected under this prefix should included. | [optional] +**prefix** | **str** | a.b.c.d is a network address, with the prefix length defined as e. Prefixes can be any length from 8 to 24. | +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used. | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | A list of enabled alert rule objects. | [optional] + +## Example + +```python +from tests_api.models.get_bgp_test200_response import GetBgpTest200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetBgpTest200Response from a JSON string +get_bgp_test200_response_instance = GetBgpTest200Response.from_json(json) +# print the JSON string representation of the object +print GetBgpTest200Response.to_json() + +# convert the object into a dict +get_bgp_test200_response_dict = get_bgp_test200_response_instance.to_dict() +# create an instance of GetBgpTest200Response from a dict +get_bgp_test200_response_form_dict = get_bgp_test200_response.from_dict(get_bgp_test200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetBgpTests200Response.md b/tests_api/docs/GetBgpTests200Response.md new file mode 100644 index 00000000..ac45cf2d --- /dev/null +++ b/tests_api/docs/GetBgpTests200Response.md @@ -0,0 +1,29 @@ +# GetBgpTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[BgpTest]**](BgpTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_bgp_tests200_response import GetBgpTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetBgpTests200Response from a JSON string +get_bgp_tests200_response_instance = GetBgpTests200Response.from_json(json) +# print the JSON string representation of the object +print GetBgpTests200Response.to_json() + +# convert the object into a dict +get_bgp_tests200_response_dict = get_bgp_tests200_response_instance.to_dict() +# create an instance of GetBgpTests200Response from a dict +get_bgp_tests200_response_form_dict = get_bgp_tests200_response.from_dict(get_bgp_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetDNSServerTest200Response.md b/tests_api/docs/GetDNSServerTest200Response.md new file mode 100644 index 00000000..77edbbf6 --- /dev/null +++ b/tests_api/docs/GetDNSServerTest200Response.md @@ -0,0 +1,61 @@ +# GetDNSServerTest200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**dns_servers** | [**List[TestDnsServer]**](TestDnsServer.md) | | +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**recursive_queries** | **bool** | Set true to run query with RD (recursion desired) flag enabled. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] + +## Example + +```python +from tests_api.models.get_dns_server_test200_response import GetDNSServerTest200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDNSServerTest200Response from a JSON string +get_dns_server_test200_response_instance = GetDNSServerTest200Response.from_json(json) +# print the JSON string representation of the object +print GetDNSServerTest200Response.to_json() + +# convert the object into a dict +get_dns_server_test200_response_dict = get_dns_server_test200_response_instance.to_dict() +# create an instance of GetDNSServerTest200Response from a dict +get_dns_server_test200_response_form_dict = get_dns_server_test200_response.from_dict(get_dns_server_test200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetDNSServerTests200Response.md b/tests_api/docs/GetDNSServerTests200Response.md new file mode 100644 index 00000000..12983fe6 --- /dev/null +++ b/tests_api/docs/GetDNSServerTests200Response.md @@ -0,0 +1,29 @@ +# GetDNSServerTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[DnsServerTest]**](DnsServerTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_dns_server_tests200_response import GetDNSServerTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDNSServerTests200Response from a JSON string +get_dns_server_tests200_response_instance = GetDNSServerTests200Response.from_json(json) +# print the JSON string representation of the object +print GetDNSServerTests200Response.to_json() + +# convert the object into a dict +get_dns_server_tests200_response_dict = get_dns_server_tests200_response_instance.to_dict() +# create an instance of GetDNSServerTests200Response from a dict +get_dns_server_tests200_response_form_dict = get_dns_server_tests200_response.from_dict(get_dns_server_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetDnsSecTest200Response.md b/tests_api/docs/GetDnsSecTest200Response.md new file mode 100644 index 00000000..fe9418a4 --- /dev/null +++ b/tests_api/docs/GetDnsSecTest200Response.md @@ -0,0 +1,47 @@ +# GetDnsSecTest200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from tests_api.models.get_dns_sec_test200_response import GetDnsSecTest200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDnsSecTest200Response from a JSON string +get_dns_sec_test200_response_instance = GetDnsSecTest200Response.from_json(json) +# print the JSON string representation of the object +print GetDnsSecTest200Response.to_json() + +# convert the object into a dict +get_dns_sec_test200_response_dict = get_dns_sec_test200_response_instance.to_dict() +# create an instance of GetDnsSecTest200Response from a dict +get_dns_sec_test200_response_form_dict = get_dns_sec_test200_response.from_dict(get_dns_sec_test200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetDnsSecTests200Response.md b/tests_api/docs/GetDnsSecTests200Response.md new file mode 100644 index 00000000..e23e5e8e --- /dev/null +++ b/tests_api/docs/GetDnsSecTests200Response.md @@ -0,0 +1,29 @@ +# GetDnsSecTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[DnsSecTest]**](DnsSecTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_dns_sec_tests200_response import GetDnsSecTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDnsSecTests200Response from a JSON string +get_dns_sec_tests200_response_instance = GetDnsSecTests200Response.from_json(json) +# print the JSON string representation of the object +print GetDnsSecTests200Response.to_json() + +# convert the object into a dict +get_dns_sec_tests200_response_dict = get_dns_sec_tests200_response_instance.to_dict() +# create an instance of GetDnsSecTests200Response from a dict +get_dns_sec_tests200_response_form_dict = get_dns_sec_tests200_response.from_dict(get_dns_sec_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetDnsTraceTest200Response.md b/tests_api/docs/GetDnsTraceTest200Response.md new file mode 100644 index 00000000..d8d4e7a7 --- /dev/null +++ b/tests_api/docs/GetDnsTraceTest200Response.md @@ -0,0 +1,48 @@ +# GetDnsTraceTest200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from tests_api.models.get_dns_trace_test200_response import GetDnsTraceTest200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDnsTraceTest200Response from a JSON string +get_dns_trace_test200_response_instance = GetDnsTraceTest200Response.from_json(json) +# print the JSON string representation of the object +print GetDnsTraceTest200Response.to_json() + +# convert the object into a dict +get_dns_trace_test200_response_dict = get_dns_trace_test200_response_instance.to_dict() +# create an instance of GetDnsTraceTest200Response from a dict +get_dns_trace_test200_response_form_dict = get_dns_trace_test200_response.from_dict(get_dns_trace_test200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetDnsTraceTests200Response.md b/tests_api/docs/GetDnsTraceTests200Response.md new file mode 100644 index 00000000..d831749d --- /dev/null +++ b/tests_api/docs/GetDnsTraceTests200Response.md @@ -0,0 +1,29 @@ +# GetDnsTraceTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[DnsTraceTest]**](DnsTraceTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_dns_trace_tests200_response import GetDnsTraceTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDnsTraceTests200Response from a JSON string +get_dns_trace_tests200_response_instance = GetDnsTraceTests200Response.from_json(json) +# print the JSON string representation of the object +print GetDnsTraceTests200Response.to_json() + +# convert the object into a dict +get_dns_trace_tests200_response_dict = get_dns_trace_tests200_response_instance.to_dict() +# create an instance of GetDnsTraceTests200Response from a dict +get_dns_trace_tests200_response_form_dict = get_dns_trace_tests200_response.from_dict(get_dns_trace_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetFtpServerTest200Response.md b/tests_api/docs/GetFtpServerTest200Response.md new file mode 100644 index 00000000..76015e53 --- /dev/null +++ b/tests_api/docs/GetFtpServerTest200Response.md @@ -0,0 +1,65 @@ +# GetFtpServerTest200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**download_limit** | **int** | Specify maximum number of bytes to download from the target object. | [optional] +**ftp_target_time** | **int** | Target time for operation completion; specified in milliseconds. | [optional] +**ftp_time_limit** | **int** | Set the time limit for the test in seconds. | [optional] [default to 10] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**request_type** | [**FtpServerRequestType**](FtpServerRequestType.md) | | +**url** | **str** | Target for the test. | +**use_active_ftp** | **bool** | Explicitly set the flag to use active FTP. | [optional] [default to False] +**use_explicit_ftps** | **bool** | Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] + +## Example + +```python +from tests_api.models.get_ftp_server_test200_response import GetFtpServerTest200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetFtpServerTest200Response from a JSON string +get_ftp_server_test200_response_instance = GetFtpServerTest200Response.from_json(json) +# print the JSON string representation of the object +print GetFtpServerTest200Response.to_json() + +# convert the object into a dict +get_ftp_server_test200_response_dict = get_ftp_server_test200_response_instance.to_dict() +# create an instance of GetFtpServerTest200Response from a dict +get_ftp_server_test200_response_form_dict = get_ftp_server_test200_response.from_dict(get_ftp_server_test200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetFtpServerTests200Response.md b/tests_api/docs/GetFtpServerTests200Response.md new file mode 100644 index 00000000..75c9ef1a --- /dev/null +++ b/tests_api/docs/GetFtpServerTests200Response.md @@ -0,0 +1,29 @@ +# GetFtpServerTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[FtpServerTest]**](FtpServerTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_ftp_server_tests200_response import GetFtpServerTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetFtpServerTests200Response from a JSON string +get_ftp_server_tests200_response_instance = GetFtpServerTests200Response.from_json(json) +# print the JSON string representation of the object +print GetFtpServerTests200Response.to_json() + +# convert the object into a dict +get_ftp_server_tests200_response_dict = get_ftp_server_tests200_response_instance.to_dict() +# create an instance of GetFtpServerTests200Response from a dict +get_ftp_server_tests200_response_form_dict = get_ftp_server_tests200_response.from_dict(get_ftp_server_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetHttpServerTest200Response.md b/tests_api/docs/GetHttpServerTest200Response.md new file mode 100644 index 00000000..062debfb --- /dev/null +++ b/tests_api/docs/GetHttpServerTest200Response.md @@ -0,0 +1,78 @@ +# GetHttpServerTest200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**headers** | **List[str]** | HTTP request headers used. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] + +## Example + +```python +from tests_api.models.get_http_server_test200_response import GetHttpServerTest200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetHttpServerTest200Response from a JSON string +get_http_server_test200_response_instance = GetHttpServerTest200Response.from_json(json) +# print the JSON string representation of the object +print GetHttpServerTest200Response.to_json() + +# convert the object into a dict +get_http_server_test200_response_dict = get_http_server_test200_response_instance.to_dict() +# create an instance of GetHttpServerTest200Response from a dict +get_http_server_test200_response_form_dict = get_http_server_test200_response.from_dict(get_http_server_test200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetHttpServerTests200Response.md b/tests_api/docs/GetHttpServerTests200Response.md new file mode 100644 index 00000000..2d91df27 --- /dev/null +++ b/tests_api/docs/GetHttpServerTests200Response.md @@ -0,0 +1,29 @@ +# GetHttpServerTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[HttpServerTest]**](HttpServerTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_http_server_tests200_response import GetHttpServerTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetHttpServerTests200Response from a JSON string +get_http_server_tests200_response_instance = GetHttpServerTests200Response.from_json(json) +# print the JSON string representation of the object +print GetHttpServerTests200Response.to_json() + +# convert the object into a dict +get_http_server_tests200_response_dict = get_http_server_tests200_response_instance.to_dict() +# create an instance of GetHttpServerTests200Response from a dict +get_http_server_tests200_response_form_dict = get_http_server_tests200_response.from_dict(get_http_server_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetPageLoadTest200Response.md b/tests_api/docs/GetPageLoadTest200Response.md new file mode 100644 index 00000000..acbd6e99 --- /dev/null +++ b/tests_api/docs/GetPageLoadTest200Response.md @@ -0,0 +1,82 @@ +# GetPageLoadTest200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Verify content using a regular expression. This field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**page_load_target_time** | **int** | Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`. | [optional] +**page_load_time_limit** | **int** | Page load time limit. Must be larger than the `httpTimeLimit`. | [optional] [default to 10] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**http_interval** | [**TestHttpInterval**](TestHttpInterval.md) | | +**subinterval** | [**TestSubInterval**](TestSubInterval.md) | | [optional] + +## Example + +```python +from tests_api.models.get_page_load_test200_response import GetPageLoadTest200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetPageLoadTest200Response from a JSON string +get_page_load_test200_response_instance = GetPageLoadTest200Response.from_json(json) +# print the JSON string representation of the object +print GetPageLoadTest200Response.to_json() + +# convert the object into a dict +get_page_load_test200_response_dict = get_page_load_test200_response_instance.to_dict() +# create an instance of GetPageLoadTest200Response from a dict +get_page_load_test200_response_form_dict = get_page_load_test200_response.from_dict(get_page_load_test200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetPageLoadTests200Response.md b/tests_api/docs/GetPageLoadTests200Response.md new file mode 100644 index 00000000..9d118451 --- /dev/null +++ b/tests_api/docs/GetPageLoadTests200Response.md @@ -0,0 +1,29 @@ +# GetPageLoadTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[PageLoadTest]**](PageLoadTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_page_load_tests200_response import GetPageLoadTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetPageLoadTests200Response from a JSON string +get_page_load_tests200_response_instance = GetPageLoadTests200Response.from_json(json) +# print the JSON string representation of the object +print GetPageLoadTests200Response.to_json() + +# convert the object into a dict +get_page_load_tests200_response_dict = get_page_load_tests200_response_instance.to_dict() +# create an instance of GetPageLoadTests200Response from a dict +get_page_load_tests200_response_form_dict = get_page_load_tests200_response.from_dict(get_page_load_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetPathVisInterfaceGroups200Response.md b/tests_api/docs/GetPathVisInterfaceGroups200Response.md new file mode 100644 index 00000000..c1374043 --- /dev/null +++ b/tests_api/docs/GetPathVisInterfaceGroups200Response.md @@ -0,0 +1,29 @@ +# GetPathVisInterfaceGroups200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**path_vis_interface_groups** | [**List[InterfaceGroup]**](InterfaceGroup.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_path_vis_interface_groups200_response import GetPathVisInterfaceGroups200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetPathVisInterfaceGroups200Response from a JSON string +get_path_vis_interface_groups200_response_instance = GetPathVisInterfaceGroups200Response.from_json(json) +# print the JSON string representation of the object +print GetPathVisInterfaceGroups200Response.to_json() + +# convert the object into a dict +get_path_vis_interface_groups200_response_dict = get_path_vis_interface_groups200_response_instance.to_dict() +# create an instance of GetPathVisInterfaceGroups200Response from a dict +get_path_vis_interface_groups200_response_form_dict = get_path_vis_interface_groups200_response.from_dict(get_path_vis_interface_groups200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetSipServerTest200Response.md b/tests_api/docs/GetSipServerTest200Response.md new file mode 100644 index 00000000..bf86cfa3 --- /dev/null +++ b/tests_api/docs/GetSipServerTest200Response.md @@ -0,0 +1,62 @@ +# GetSipServerTest200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_user** | **str** | Username for authentication with SIP server. | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**options_regex** | **str** | Options regex, this field does not require escaping. | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [default to 49153] +**protocol** | [**SipTestProtocol**](SipTestProtocol.md) | | [optional] +**register_enabled** | **bool** | Set to true to perform SIP registration on the test target with the SIP REGISTER command. | [optional] [default to False] +**sip_registrar** | **str** | SIP server to be tested, specified by domain name or IP address. | [optional] +**sip_target_time** | **int** | Target time for test completion in milliseconds. | [optional] +**sip_time_limit** | **int** | Time limit in milliseconds. | [optional] [default to 5] +**target_sip_credentials** | [**TestSipCredentials**](TestSipCredentials.md) | | +**user** | **str** | Username for SIP registration, should be unique within a ThousandEyes account group. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] + +## Example + +```python +from tests_api.models.get_sip_server_test200_response import GetSipServerTest200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetSipServerTest200Response from a JSON string +get_sip_server_test200_response_instance = GetSipServerTest200Response.from_json(json) +# print the JSON string representation of the object +print GetSipServerTest200Response.to_json() + +# convert the object into a dict +get_sip_server_test200_response_dict = get_sip_server_test200_response_instance.to_dict() +# create an instance of GetSipServerTest200Response from a dict +get_sip_server_test200_response_form_dict = get_sip_server_test200_response.from_dict(get_sip_server_test200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetSipServerTests200Response.md b/tests_api/docs/GetSipServerTests200Response.md new file mode 100644 index 00000000..9b27837f --- /dev/null +++ b/tests_api/docs/GetSipServerTests200Response.md @@ -0,0 +1,29 @@ +# GetSipServerTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[SipServerTest]**](SipServerTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_sip_server_tests200_response import GetSipServerTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetSipServerTests200Response from a JSON string +get_sip_server_tests200_response_instance = GetSipServerTests200Response.from_json(json) +# print the JSON string representation of the object +print GetSipServerTests200Response.to_json() + +# convert the object into a dict +get_sip_server_tests200_response_dict = get_sip_server_tests200_response_instance.to_dict() +# create an instance of GetSipServerTests200Response from a dict +get_sip_server_tests200_response_form_dict = get_sip_server_tests200_response.from_dict(get_sip_server_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetTests200Response.md b/tests_api/docs/GetTests200Response.md new file mode 100644 index 00000000..909f0045 --- /dev/null +++ b/tests_api/docs/GetTests200Response.md @@ -0,0 +1,29 @@ +# GetTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[SimpleTest]**](SimpleTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_tests200_response import GetTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTests200Response from a JSON string +get_tests200_response_instance = GetTests200Response.from_json(json) +# print the JSON string representation of the object +print GetTests200Response.to_json() + +# convert the object into a dict +get_tests200_response_dict = get_tests200_response_instance.to_dict() +# create an instance of GetTests200Response from a dict +get_tests200_response_form_dict = get_tests200_response.from_dict(get_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetVoiceTest200Response.md b/tests_api/docs/GetVoiceTest200Response.md new file mode 100644 index 00000000..2b282b15 --- /dev/null +++ b/tests_api/docs/GetVoiceTest200Response.md @@ -0,0 +1,55 @@ +# GetVoiceTest200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**codec** | **str** | Codec label | [optional] [readonly] +**codec_id** | **str** | Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab) | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**duration** | **int** | Duration of the test in seconds. | [optional] [default to 5] +**jitter_buffer** | **int** | De-jitter buffer size in seconds. | [optional] [default to 40] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**port** | **int** | Port number for the chosen protocol. | [optional] +**target_agent_id** | **str** | Agent ID of the target agent for the test. | +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] + +## Example + +```python +from tests_api.models.get_voice_test200_response import GetVoiceTest200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetVoiceTest200Response from a JSON string +get_voice_test200_response_instance = GetVoiceTest200Response.from_json(json) +# print the JSON string representation of the object +print GetVoiceTest200Response.to_json() + +# convert the object into a dict +get_voice_test200_response_dict = get_voice_test200_response_instance.to_dict() +# create an instance of GetVoiceTest200Response from a dict +get_voice_test200_response_form_dict = get_voice_test200_response.from_dict(get_voice_test200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetVoiceTests200Response.md b/tests_api/docs/GetVoiceTests200Response.md new file mode 100644 index 00000000..c52b2174 --- /dev/null +++ b/tests_api/docs/GetVoiceTests200Response.md @@ -0,0 +1,29 @@ +# GetVoiceTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[VoiceTest]**](VoiceTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_voice_tests200_response import GetVoiceTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetVoiceTests200Response from a JSON string +get_voice_tests200_response_instance = GetVoiceTests200Response.from_json(json) +# print the JSON string representation of the object +print GetVoiceTests200Response.to_json() + +# convert the object into a dict +get_voice_tests200_response_dict = get_voice_tests200_response_instance.to_dict() +# create an instance of GetVoiceTests200Response from a dict +get_voice_tests200_response_form_dict = get_voice_tests200_response.from_dict(get_voice_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetWebTransactionsTest200Response.md b/tests_api/docs/GetWebTransactionsTest200Response.md new file mode 100644 index 00000000..58cc07e1 --- /dev/null +++ b/tests_api/docs/GetWebTransactionsTest200Response.md @@ -0,0 +1,84 @@ +# GetWebTransactionsTest200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Verify content using a regular expression. This field does not require escaping. | [optional] +**credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**target_time** | **int** | Target time for completion, defaults to 50% of time limit specified in seconds. | [optional] +**time_limit** | **int** | Time limit for transaction in seconds. | [optional] [default to 30] +**transaction_script** | **str** | JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ). | +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**subinterval** | [**TestSubInterval**](TestSubInterval.md) | | [optional] + +## Example + +```python +from tests_api.models.get_web_transactions_test200_response import GetWebTransactionsTest200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetWebTransactionsTest200Response from a JSON string +get_web_transactions_test200_response_instance = GetWebTransactionsTest200Response.from_json(json) +# print the JSON string representation of the object +print GetWebTransactionsTest200Response.to_json() + +# convert the object into a dict +get_web_transactions_test200_response_dict = get_web_transactions_test200_response_instance.to_dict() +# create an instance of GetWebTransactionsTest200Response from a dict +get_web_transactions_test200_response_form_dict = get_web_transactions_test200_response.from_dict(get_web_transactions_test200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/GetWebTransactionsTests200Response.md b/tests_api/docs/GetWebTransactionsTests200Response.md new file mode 100644 index 00000000..32dc588c --- /dev/null +++ b/tests_api/docs/GetWebTransactionsTests200Response.md @@ -0,0 +1,29 @@ +# GetWebTransactionsTests200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[WebTransactionTest]**](WebTransactionTest.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.get_web_transactions_tests200_response import GetWebTransactionsTests200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetWebTransactionsTests200Response from a JSON string +get_web_transactions_tests200_response_instance = GetWebTransactionsTests200Response.from_json(json) +# print the JSON string representation of the object +print GetWebTransactionsTests200Response.to_json() + +# convert the object into a dict +get_web_transactions_tests200_response_dict = get_web_transactions_tests200_response_instance.to_dict() +# create an instance of GetWebTransactionsTests200Response from a dict +get_web_transactions_tests200_response_form_dict = get_web_transactions_tests200_response.from_dict(get_web_transactions_tests200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/HTTPServerApi.md b/tests_api/docs/HTTPServerApi.md new file mode 100644 index 00000000..08b0ad3b --- /dev/null +++ b/tests_api/docs/HTTPServerApi.md @@ -0,0 +1,453 @@ +# tests_api.HTTPServerApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_http_server_test**](HTTPServerApi.md#create_http_server_test) | **POST** /v7/tests/http-server | Create HTTP Server test +[**delete_http_server_test**](HTTPServerApi.md#delete_http_server_test) | **DELETE** /v7/tests/http-server/{testId} | Delete HTTP Server test +[**get_http_server_test**](HTTPServerApi.md#get_http_server_test) | **GET** /v7/tests/http-server/{testId} | Get HTTP Server test +[**get_http_server_tests**](HTTPServerApi.md#get_http_server_tests) | **GET** /v7/tests/http-server | List HTTP Server tests +[**update_http_server_test**](HTTPServerApi.md#update_http_server_test) | **PUT** /v7/tests/http-server/{testId} | Update HTTP Server test + + +# **create_http_server_test** +> HttpServerTest create_http_server_test(update_http_server_test, aid=aid, expand=expand) + +Create HTTP Server test + +Creates a new HTTP Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.http_server_test import HttpServerTest +from tests_api.models.update_http_server_test import UpdateHttpServerTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.HTTPServerApi(api_client) + update_http_server_test = tests_api.UpdateHttpServerTest() # UpdateHttpServerTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create HTTP Server test + api_response = api_instance.create_http_server_test(update_http_server_test, aid=aid, expand=expand) + print("The response of HTTPServerApi->create_http_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerApi->create_http_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_http_server_test** | [**UpdateHttpServerTest**](UpdateHttpServerTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**HttpServerTest**](HttpServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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) + +# **delete_http_server_test** +> delete_http_server_test(test_id, aid=aid) + +Delete HTTP Server test + +Deletes the specified HTTP Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.HTTPServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 HTTP Server test + api_instance.delete_http_server_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling HTTPServerApi->delete_http_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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_http_server_test** +> GetHttpServerTest200Response get_http_server_test(test_id, aid=aid, expand=expand) + +Get HTTP Server test + +Returns details for a HTTP Server test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_http_server_test200_response import GetHttpServerTest200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.HTTPServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get HTTP Server test + api_response = api_instance.get_http_server_test(test_id, aid=aid, expand=expand) + print("The response of HTTPServerApi->get_http_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerApi->get_http_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetHttpServerTest200Response**](GetHttpServerTest200Response.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_http_server_tests** +> GetHttpServerTests200Response get_http_server_tests(aid=aid) + +List HTTP Server tests + +Returns a list of all HTTP Server tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_http_server_tests200_response import GetHttpServerTests200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.HTTPServerApi(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 HTTP Server tests + api_response = api_instance.get_http_server_tests(aid=aid) + print("The response of HTTPServerApi->get_http_server_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerApi->get_http_server_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetHttpServerTests200Response**](GetHttpServerTests200Response.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_http_server_test** +> GetHttpServerTest200Response update_http_server_test(test_id, update_http_server_test, aid=aid, expand=expand) + +Update HTTP Server test + +Updates a HTTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_http_server_test200_response import GetHttpServerTest200Response +from tests_api.models.update_http_server_test import UpdateHttpServerTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.HTTPServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + update_http_server_test = tests_api.UpdateHttpServerTest() # UpdateHttpServerTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update HTTP Server test + api_response = api_instance.update_http_server_test(test_id, update_http_server_test, aid=aid, expand=expand) + print("The response of HTTPServerApi->update_http_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerApi->update_http_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **update_http_server_test** | [**UpdateHttpServerTest**](UpdateHttpServerTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetHttpServerTest200Response**](GetHttpServerTest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/tests_api/docs/HttpServerInstantTest.md b/tests_api/docs/HttpServerInstantTest.md new file mode 100644 index 00000000..17b6fa1e --- /dev/null +++ b/tests_api/docs/HttpServerInstantTest.md @@ -0,0 +1,72 @@ +# HttpServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**headers** | **List[str]** | HTTP request headers used. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] + +## Example + +```python +from tests_api.models.http_server_instant_test import HttpServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpServerInstantTest from a JSON string +http_server_instant_test_instance = HttpServerInstantTest.from_json(json) +# print the JSON string representation of the object +print HttpServerInstantTest.to_json() + +# convert the object into a dict +http_server_instant_test_dict = http_server_instant_test_instance.to_dict() +# create an instance of HttpServerInstantTest from a dict +http_server_instant_test_form_dict = http_server_instant_test.from_dict(http_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/HttpServerTest.md b/tests_api/docs/HttpServerTest.md new file mode 100644 index 00000000..faa45a24 --- /dev/null +++ b/tests_api/docs/HttpServerTest.md @@ -0,0 +1,78 @@ +# HttpServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**headers** | **List[str]** | HTTP request headers used. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] + +## Example + +```python +from tests_api.models.http_server_test import HttpServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpServerTest from a JSON string +http_server_test_instance = HttpServerTest.from_json(json) +# print the JSON string representation of the object +print HttpServerTest.to_json() + +# convert the object into a dict +http_server_test_dict = http_server_test_instance.to_dict() +# create an instance of HttpServerTest from a dict +http_server_test_form_dict = http_server_test.from_dict(http_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/HttpServerTests.md b/tests_api/docs/HttpServerTests.md new file mode 100644 index 00000000..19eb50f5 --- /dev/null +++ b/tests_api/docs/HttpServerTests.md @@ -0,0 +1,28 @@ +# HttpServerTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[HttpServerTest]**](HttpServerTest.md) | | [optional] + +## Example + +```python +from tests_api.models.http_server_tests import HttpServerTests + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpServerTests from a JSON string +http_server_tests_instance = HttpServerTests.from_json(json) +# print the JSON string representation of the object +print HttpServerTests.to_json() + +# convert the object into a dict +http_server_tests_dict = http_server_tests_instance.to_dict() +# create an instance of HttpServerTests from a dict +http_server_tests_form_dict = http_server_tests.from_dict(http_server_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/InstantTest.md b/tests_api/docs/InstantTest.md new file mode 100644 index 00000000..593c3227 --- /dev/null +++ b/tests_api/docs/InstantTest.md @@ -0,0 +1,40 @@ +# InstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | [**TestType**](TestType.md) | | [optional] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] + +## Example + +```python +from tests_api.models.instant_test import InstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of InstantTest from a JSON string +instant_test_instance = InstantTest.from_json(json) +# print the JSON string representation of the object +print InstantTest.to_json() + +# convert the object into a dict +instant_test_dict = instant_test_instance.to_dict() +# create an instance of InstantTest from a dict +instant_test_form_dict = instant_test.from_dict(instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/InterfaceGroup.md b/tests_api/docs/InterfaceGroup.md new file mode 100644 index 00000000..f8104b73 --- /dev/null +++ b/tests_api/docs/InterfaceGroup.md @@ -0,0 +1,32 @@ +# InterfaceGroup + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | Account Group Id | [optional] [readonly] +**group_id** | **str** | Group ID | [optional] [readonly] +**group_name** | **str** | Name of the path visualization interface group | [optional] +**ip_addresses** | **List[str]** | Array of IP addresses associated with the interface group | [optional] +**rdns_regexes** | **List[str]** | Array of RDNS Regexes associated with the interface group | [optional] [readonly] + +## Example + +```python +from tests_api.models.interface_group import InterfaceGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of InterfaceGroup from a JSON string +interface_group_instance = InterfaceGroup.from_json(json) +# print the JSON string representation of the object +print InterfaceGroup.to_json() + +# convert the object into a dict +interface_group_dict = interface_group_instance.to_dict() +# create an instance of InterfaceGroup from a dict +interface_group_form_dict = interface_group.from_dict(interface_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) + + diff --git a/tests_api/docs/InterfaceGroups.md b/tests_api/docs/InterfaceGroups.md new file mode 100644 index 00000000..c0a95343 --- /dev/null +++ b/tests_api/docs/InterfaceGroups.md @@ -0,0 +1,28 @@ +# InterfaceGroups + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**path_vis_interface_groups** | [**List[InterfaceGroup]**](InterfaceGroup.md) | | [optional] + +## Example + +```python +from tests_api.models.interface_groups import InterfaceGroups + +# TODO update the JSON string below +json = "{}" +# create an instance of InterfaceGroups from a JSON string +interface_groups_instance = InterfaceGroups.from_json(json) +# print the JSON string representation of the object +print InterfaceGroups.to_json() + +# convert the object into a dict +interface_groups_dict = interface_groups_instance.to_dict() +# create an instance of InterfaceGroups from a dict +interface_groups_form_dict = interface_groups.from_dict(interface_groups_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/Link.md b/tests_api/docs/Link.md new file mode 100644 index 00000000..5ea009ee --- /dev/null +++ b/tests_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from tests_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/MapItem.md b/tests_api/docs/MapItem.md new file mode 100644 index 00000000..bb7a2636 --- /dev/null +++ b/tests_api/docs/MapItem.md @@ -0,0 +1,29 @@ +# MapItem + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **str** | | [optional] +**value** | **str** | | [optional] + +## Example + +```python +from tests_api.models.map_item import MapItem + +# TODO update the JSON string below +json = "{}" +# create an instance of MapItem from a JSON string +map_item_instance = MapItem.from_json(json) +# print the JSON string representation of the object +print MapItem.to_json() + +# convert the object into a dict +map_item_dict = map_item_instance.to_dict() +# create an instance of MapItem from a dict +map_item_form_dict = map_item.from_dict(map_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/Monitor.md b/tests_api/docs/Monitor.md new file mode 100644 index 00000000..1f4745b0 --- /dev/null +++ b/tests_api/docs/Monitor.md @@ -0,0 +1,33 @@ +# Monitor + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country_id** | **str** | Country ID | [optional] [readonly] +**monitor_id** | **str** | BGP monitor ID | [optional] [readonly] +**ip_address** | **str** | IP address of the BGP monitor | [optional] +**network** | **str** | Name of the autonomous system in which the monitor is found | [optional] +**monitor_type** | [**MonitorType**](MonitorType.md) | | [optional] +**monitor_name** | **str** | Display name of the BGP monitor | [optional] + +## Example + +```python +from tests_api.models.monitor import Monitor + +# TODO update the JSON string below +json = "{}" +# create an instance of Monitor from a JSON string +monitor_instance = Monitor.from_json(json) +# print the JSON string representation of the object +print Monitor.to_json() + +# convert the object into a dict +monitor_dict = monitor_instance.to_dict() +# create an instance of Monitor from a dict +monitor_form_dict = monitor.from_dict(monitor_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/MonitorType.md b/tests_api/docs/MonitorType.md new file mode 100644 index 00000000..30c9de8b --- /dev/null +++ b/tests_api/docs/MonitorType.md @@ -0,0 +1,11 @@ +# MonitorType + +Type of monitor + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/MonitorsRequest.md b/tests_api/docs/MonitorsRequest.md new file mode 100644 index 00000000..6e510b8e --- /dev/null +++ b/tests_api/docs/MonitorsRequest.md @@ -0,0 +1,28 @@ +# MonitorsRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] + +## Example + +```python +from tests_api.models.monitors_request import MonitorsRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of MonitorsRequest from a JSON string +monitors_request_instance = MonitorsRequest.from_json(json) +# print the JSON string representation of the object +print MonitorsRequest.to_json() + +# convert the object into a dict +monitors_request_dict = monitors_request_instance.to_dict() +# create an instance of MonitorsRequest from a dict +monitors_request_form_dict = monitors_request.from_dict(monitors_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) + + diff --git a/tests_api/docs/PageLoadApi.md b/tests_api/docs/PageLoadApi.md new file mode 100644 index 00000000..501483f3 --- /dev/null +++ b/tests_api/docs/PageLoadApi.md @@ -0,0 +1,453 @@ +# tests_api.PageLoadApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_page_load_test**](PageLoadApi.md#create_page_load_test) | **POST** /v7/tests/page-load | Create Page Load test +[**delete_page_load_test**](PageLoadApi.md#delete_page_load_test) | **DELETE** /v7/tests/page-load/{testId} | Delete Page Load test +[**get_page_load_test**](PageLoadApi.md#get_page_load_test) | **GET** /v7/tests/page-load/{testId} | Get Page Load test +[**get_page_load_tests**](PageLoadApi.md#get_page_load_tests) | **GET** /v7/tests/page-load | List Page Load tests +[**update_page_load_test**](PageLoadApi.md#update_page_load_test) | **PUT** /v7/tests/page-load/{testId} | Update Page Load test + + +# **create_page_load_test** +> PageLoadTest create_page_load_test(update_page_load_test, aid=aid, expand=expand) + +Create Page Load test + +Creates a new Page Load test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.page_load_test import PageLoadTest +from tests_api.models.update_page_load_test import UpdatePageLoadTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.PageLoadApi(api_client) + update_page_load_test = tests_api.UpdatePageLoadTest() # UpdatePageLoadTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create Page Load test + api_response = api_instance.create_page_load_test(update_page_load_test, aid=aid, expand=expand) + print("The response of PageLoadApi->create_page_load_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PageLoadApi->create_page_load_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_page_load_test** | [**UpdatePageLoadTest**](UpdatePageLoadTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**PageLoadTest**](PageLoadTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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) + +# **delete_page_load_test** +> delete_page_load_test(test_id, aid=aid) + +Delete Page Load test + +Deletes the specified Page Load test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.PageLoadApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 Page Load test + api_instance.delete_page_load_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling PageLoadApi->delete_page_load_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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_page_load_test** +> GetPageLoadTest200Response get_page_load_test(test_id, aid=aid, expand=expand) + +Get Page Load test + +Returns details for a Page Load test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_page_load_test200_response import GetPageLoadTest200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.PageLoadApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get Page Load test + api_response = api_instance.get_page_load_test(test_id, aid=aid, expand=expand) + print("The response of PageLoadApi->get_page_load_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PageLoadApi->get_page_load_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetPageLoadTest200Response**](GetPageLoadTest200Response.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_page_load_tests** +> GetPageLoadTests200Response get_page_load_tests(aid=aid) + +List Page Load tests + +Returns a list of all Page Load tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_page_load_tests200_response import GetPageLoadTests200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.PageLoadApi(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 Page Load tests + api_response = api_instance.get_page_load_tests(aid=aid) + print("The response of PageLoadApi->get_page_load_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PageLoadApi->get_page_load_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetPageLoadTests200Response**](GetPageLoadTests200Response.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_page_load_test** +> GetPageLoadTest200Response update_page_load_test(test_id, update_page_load_test, aid=aid, expand=expand) + +Update Page Load test + +Updates a Page Load test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_page_load_test200_response import GetPageLoadTest200Response +from tests_api.models.update_page_load_test import UpdatePageLoadTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.PageLoadApi(api_client) + test_id = '281474976710706' # str | ID of the test + update_page_load_test = tests_api.UpdatePageLoadTest() # UpdatePageLoadTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update Page Load test + api_response = api_instance.update_page_load_test(test_id, update_page_load_test, aid=aid, expand=expand) + print("The response of PageLoadApi->update_page_load_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PageLoadApi->update_page_load_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **update_page_load_test** | [**UpdatePageLoadTest**](UpdatePageLoadTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetPageLoadTest200Response**](GetPageLoadTest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/tests_api/docs/PageLoadInstantTest.md b/tests_api/docs/PageLoadInstantTest.md new file mode 100644 index 00000000..1cc7bdc3 --- /dev/null +++ b/tests_api/docs/PageLoadInstantTest.md @@ -0,0 +1,74 @@ +# PageLoadInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Verify content using a regular expression. This field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**page_load_target_time** | **int** | Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`. | [optional] +**page_load_time_limit** | **int** | Page load time limit. Must be larger than the `httpTimeLimit`. | [optional] [default to 10] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] + +## Example + +```python +from tests_api.models.page_load_instant_test import PageLoadInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of PageLoadInstantTest from a JSON string +page_load_instant_test_instance = PageLoadInstantTest.from_json(json) +# print the JSON string representation of the object +print PageLoadInstantTest.to_json() + +# convert the object into a dict +page_load_instant_test_dict = page_load_instant_test_instance.to_dict() +# create an instance of PageLoadInstantTest from a dict +page_load_instant_test_form_dict = page_load_instant_test.from_dict(page_load_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/PageLoadTest.md b/tests_api/docs/PageLoadTest.md new file mode 100644 index 00000000..9b44b3bf --- /dev/null +++ b/tests_api/docs/PageLoadTest.md @@ -0,0 +1,82 @@ +# PageLoadTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Verify content using a regular expression. This field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**page_load_target_time** | **int** | Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`. | [optional] +**page_load_time_limit** | **int** | Page load time limit. Must be larger than the `httpTimeLimit`. | [optional] [default to 10] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**http_interval** | [**TestHttpInterval**](TestHttpInterval.md) | | +**subinterval** | [**TestSubInterval**](TestSubInterval.md) | | [optional] + +## Example + +```python +from tests_api.models.page_load_test import PageLoadTest + +# TODO update the JSON string below +json = "{}" +# create an instance of PageLoadTest from a JSON string +page_load_test_instance = PageLoadTest.from_json(json) +# print the JSON string representation of the object +print PageLoadTest.to_json() + +# convert the object into a dict +page_load_test_dict = page_load_test_instance.to_dict() +# create an instance of PageLoadTest from a dict +page_load_test_form_dict = page_load_test.from_dict(page_load_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/PageLoadTests.md b/tests_api/docs/PageLoadTests.md new file mode 100644 index 00000000..7c9319d1 --- /dev/null +++ b/tests_api/docs/PageLoadTests.md @@ -0,0 +1,28 @@ +# PageLoadTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[PageLoadTest]**](PageLoadTest.md) | | [optional] + +## Example + +```python +from tests_api.models.page_load_tests import PageLoadTests + +# TODO update the JSON string below +json = "{}" +# create an instance of PageLoadTests from a JSON string +page_load_tests_instance = PageLoadTests.from_json(json) +# print the JSON string representation of the object +print PageLoadTests.to_json() + +# convert the object into a dict +page_load_tests_dict = page_load_tests_instance.to_dict() +# create an instance of PageLoadTests from a dict +page_load_tests_form_dict = page_load_tests.from_dict(page_load_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/PathVisualizationInterfaceGroupsApi.md b/tests_api/docs/PathVisualizationInterfaceGroupsApi.md new file mode 100644 index 00000000..58bf7c13 --- /dev/null +++ b/tests_api/docs/PathVisualizationInterfaceGroupsApi.md @@ -0,0 +1,356 @@ +# tests_api.PathVisualizationInterfaceGroupsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_path_vis_interface_groups**](PathVisualizationInterfaceGroupsApi.md#create_path_vis_interface_groups) | **POST** /v7/network/path-vis/interface-groups | Create interface group for path visualization +[**delete_path_vis_interface_group**](PathVisualizationInterfaceGroupsApi.md#delete_path_vis_interface_group) | **DELETE** /v7/network/path-vis/interface-groups/{interfaceGroupId} | Delete interface group +[**get_path_vis_interface_groups**](PathVisualizationInterfaceGroupsApi.md#get_path_vis_interface_groups) | **GET** /v7/network/path-vis/interface-groups | List interface groups for path visualization +[**update_path_vis_interface_group**](PathVisualizationInterfaceGroupsApi.md#update_path_vis_interface_group) | **PUT** /v7/network/path-vis/interface-groups/{interfaceGroupId} | Update interface group + + +# **create_path_vis_interface_groups** +> InterfaceGroup create_path_vis_interface_groups(interface_group, aid=aid) + +Create interface group for path visualization + +Creates a new path visualization interface group. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.interface_group import InterfaceGroup +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.PathVisualizationInterfaceGroupsApi(api_client) + interface_group = tests_api.InterfaceGroup() # InterfaceGroup | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create interface group for path visualization + api_response = api_instance.create_path_vis_interface_groups(interface_group, aid=aid) + print("The response of PathVisualizationInterfaceGroupsApi->create_path_vis_interface_groups:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PathVisualizationInterfaceGroupsApi->create_path_vis_interface_groups: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **interface_group** | [**InterfaceGroup**](InterfaceGroup.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**InterfaceGroup**](InterfaceGroup.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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) + +# **delete_path_vis_interface_group** +> delete_path_vis_interface_group(interface_group_id, aid=aid) + +Delete interface group + +Deletes a path visualization interface group. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.PathVisualizationInterfaceGroupsApi(api_client) + interface_group_id = '281474976710706' # str | ID of the network path vis interface group + 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 interface group + api_instance.delete_path_vis_interface_group(interface_group_id, aid=aid) + except Exception as e: + print("Exception when calling PathVisualizationInterfaceGroupsApi->delete_path_vis_interface_group: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **interface_group_id** | **str**| ID of the network path vis interface group | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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_path_vis_interface_groups** +> GetPathVisInterfaceGroups200Response get_path_vis_interface_groups(aid=aid) + +List interface groups for path visualization + +Returns a list of all path visualization interface groups. For more information about interface groups, see https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#grouping. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_path_vis_interface_groups200_response import GetPathVisInterfaceGroups200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.PathVisualizationInterfaceGroupsApi(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 interface groups for path visualization + api_response = api_instance.get_path_vis_interface_groups(aid=aid) + print("The response of PathVisualizationInterfaceGroupsApi->get_path_vis_interface_groups:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PathVisualizationInterfaceGroupsApi->get_path_vis_interface_groups: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetPathVisInterfaceGroups200Response**](GetPathVisInterfaceGroups200Response.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_path_vis_interface_group** +> UpdatePathVisInterfaceGroup200Response update_path_vis_interface_group(interface_group_id, interface_group, aid=aid) + +Update interface group + +Updates a path visualization interface group.. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.interface_group import InterfaceGroup +from tests_api.models.update_path_vis_interface_group200_response import UpdatePathVisInterfaceGroup200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.PathVisualizationInterfaceGroupsApi(api_client) + interface_group_id = '281474976710706' # str | ID of the network path vis interface group + interface_group = tests_api.InterfaceGroup() # InterfaceGroup | + 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: + # Update interface group + api_response = api_instance.update_path_vis_interface_group(interface_group_id, interface_group, aid=aid) + print("The response of PathVisualizationInterfaceGroupsApi->update_path_vis_interface_group:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PathVisualizationInterfaceGroupsApi->update_path_vis_interface_group: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **interface_group_id** | **str**| ID of the network path vis interface group | + **interface_group** | [**InterfaceGroup**](InterfaceGroup.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**UpdatePathVisInterfaceGroup200Response**](UpdatePathVisInterfaceGroup200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/tests_api/docs/SIPServerApi.md b/tests_api/docs/SIPServerApi.md new file mode 100644 index 00000000..fb75c845 --- /dev/null +++ b/tests_api/docs/SIPServerApi.md @@ -0,0 +1,451 @@ +# tests_api.SIPServerApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_sip_server_test**](SIPServerApi.md#create_sip_server_test) | **POST** /v7/tests/sip-server | Create SIP Server test +[**delete_sip_server_test**](SIPServerApi.md#delete_sip_server_test) | **DELETE** /v7/tests/sip-server/{testId} | Delete SIP Server test +[**get_sip_server_test**](SIPServerApi.md#get_sip_server_test) | **GET** /v7/tests/sip-server/{testId} | Get SIP Server test +[**get_sip_server_tests**](SIPServerApi.md#get_sip_server_tests) | **GET** /v7/tests/sip-server | List SIP Server tests +[**update_sip_server_test**](SIPServerApi.md#update_sip_server_test) | **PUT** /v7/tests/sip-server/{testId} | Update SIP Server test + + +# **create_sip_server_test** +> SipServerTest create_sip_server_test(update_sip_server_test, aid=aid, expand=expand) + +Create SIP Server test + +Creates a new SIP Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.sip_server_test import SipServerTest +from tests_api.models.update_sip_server_test import UpdateSipServerTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.SIPServerApi(api_client) + update_sip_server_test = tests_api.UpdateSipServerTest() # UpdateSipServerTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create SIP Server test + api_response = api_instance.create_sip_server_test(update_sip_server_test, aid=aid, expand=expand) + print("The response of SIPServerApi->create_sip_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SIPServerApi->create_sip_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_sip_server_test** | [**UpdateSipServerTest**](UpdateSipServerTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**SipServerTest**](SipServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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) + +# **delete_sip_server_test** +> delete_sip_server_test(test_id, aid=aid) + +Delete SIP Server test + +Deletes the specified SIP Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.SIPServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 SIP Server test + api_instance.delete_sip_server_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling SIPServerApi->delete_sip_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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 | - | + +[[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_sip_server_test** +> GetSipServerTest200Response get_sip_server_test(test_id, aid=aid, expand=expand) + +Get SIP Server test + +Returns details for a SIP Server test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_sip_server_test200_response import GetSipServerTest200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.SIPServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get SIP Server test + api_response = api_instance.get_sip_server_test(test_id, aid=aid, expand=expand) + print("The response of SIPServerApi->get_sip_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SIPServerApi->get_sip_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetSipServerTest200Response**](GetSipServerTest200Response.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_sip_server_tests** +> GetSipServerTests200Response get_sip_server_tests(aid=aid) + +List SIP Server tests + +Returns a list of SIP Server tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_sip_server_tests200_response import GetSipServerTests200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.SIPServerApi(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 SIP Server tests + api_response = api_instance.get_sip_server_tests(aid=aid) + print("The response of SIPServerApi->get_sip_server_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SIPServerApi->get_sip_server_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetSipServerTests200Response**](GetSipServerTests200Response.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_sip_server_test** +> GetSipServerTest200Response update_sip_server_test(test_id, update_sip_server_test, aid=aid, expand=expand) + +Update SIP Server test + +Updates a SIP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_sip_server_test200_response import GetSipServerTest200Response +from tests_api.models.update_sip_server_test import UpdateSipServerTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.SIPServerApi(api_client) + test_id = '281474976710706' # str | ID of the test + update_sip_server_test = tests_api.UpdateSipServerTest() # UpdateSipServerTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update SIP Server test + api_response = api_instance.update_sip_server_test(test_id, update_sip_server_test, aid=aid, expand=expand) + print("The response of SIPServerApi->update_sip_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SIPServerApi->update_sip_server_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **update_sip_server_test** | [**UpdateSipServerTest**](UpdateSipServerTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetSipServerTest200Response**](GetSipServerTest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/tests_api/docs/SelfLinks.md b/tests_api/docs/SelfLinks.md new file mode 100644 index 00000000..1d2c760d --- /dev/null +++ b/tests_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/SelfLinksLinks.md b/tests_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..acf19c78 --- /dev/null +++ b/tests_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from tests_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/SimpleTest.md b/tests_api/docs/SimpleTest.md new file mode 100644 index 00000000..5a901945 --- /dev/null +++ b/tests_api/docs/SimpleTest.md @@ -0,0 +1,42 @@ +# SimpleTest + +Each test includes additional fields depending on its `type`. Refer `/tests/{type}` endpoint to know the set of fields returned by a given `type`. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | [**TestType**](TestType.md) | | [optional] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.simple_test import SimpleTest + +# TODO update the JSON string below +json = "{}" +# create an instance of SimpleTest from a JSON string +simple_test_instance = SimpleTest.from_json(json) +# print the JSON string representation of the object +print SimpleTest.to_json() + +# convert the object into a dict +simple_test_dict = simple_test_instance.to_dict() +# create an instance of SimpleTest from a dict +simple_test_form_dict = simple_test.from_dict(simple_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/SipServerInstantTest.md b/tests_api/docs/SipServerInstantTest.md new file mode 100644 index 00000000..fff8ac05 --- /dev/null +++ b/tests_api/docs/SipServerInstantTest.md @@ -0,0 +1,57 @@ +# SipServerInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_user** | **str** | Username for authentication with SIP server. | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**options_regex** | **str** | Options regex, this field does not require escaping. | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [default to 49153] +**protocol** | [**SipTestProtocol**](SipTestProtocol.md) | | [optional] +**register_enabled** | **bool** | Set to true to perform SIP registration on the test target with the SIP REGISTER command. | [optional] [default to False] +**sip_registrar** | **str** | SIP server to be tested, specified by domain name or IP address. | [optional] +**sip_target_time** | **int** | Target time for test completion in milliseconds. | [optional] +**sip_time_limit** | **int** | Time limit in milliseconds. | [optional] [default to 5] +**target_sip_credentials** | [**TestSipCredentials**](TestSipCredentials.md) | | +**user** | **str** | Username for SIP registration, should be unique within a ThousandEyes account group. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] + +## Example + +```python +from tests_api.models.sip_server_instant_test import SipServerInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of SipServerInstantTest from a JSON string +sip_server_instant_test_instance = SipServerInstantTest.from_json(json) +# print the JSON string representation of the object +print SipServerInstantTest.to_json() + +# convert the object into a dict +sip_server_instant_test_dict = sip_server_instant_test_instance.to_dict() +# create an instance of SipServerInstantTest from a dict +sip_server_instant_test_form_dict = sip_server_instant_test.from_dict(sip_server_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/SipServerTest.md b/tests_api/docs/SipServerTest.md new file mode 100644 index 00000000..86f2731b --- /dev/null +++ b/tests_api/docs/SipServerTest.md @@ -0,0 +1,62 @@ +# SipServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_user** | **str** | Username for authentication with SIP server. | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**options_regex** | **str** | Options regex, this field does not require escaping. | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [default to 49153] +**protocol** | [**SipTestProtocol**](SipTestProtocol.md) | | [optional] +**register_enabled** | **bool** | Set to true to perform SIP registration on the test target with the SIP REGISTER command. | [optional] [default to False] +**sip_registrar** | **str** | SIP server to be tested, specified by domain name or IP address. | [optional] +**sip_target_time** | **int** | Target time for test completion in milliseconds. | [optional] +**sip_time_limit** | **int** | Time limit in milliseconds. | [optional] [default to 5] +**target_sip_credentials** | [**TestSipCredentials**](TestSipCredentials.md) | | +**user** | **str** | Username for SIP registration, should be unique within a ThousandEyes account group. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] + +## Example + +```python +from tests_api.models.sip_server_test import SipServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of SipServerTest from a JSON string +sip_server_test_instance = SipServerTest.from_json(json) +# print the JSON string representation of the object +print SipServerTest.to_json() + +# convert the object into a dict +sip_server_test_dict = sip_server_test_instance.to_dict() +# create an instance of SipServerTest from a dict +sip_server_test_form_dict = sip_server_test.from_dict(sip_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/SipServerTests.md b/tests_api/docs/SipServerTests.md new file mode 100644 index 00000000..3cfec7e4 --- /dev/null +++ b/tests_api/docs/SipServerTests.md @@ -0,0 +1,28 @@ +# SipServerTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[SipServerTest]**](SipServerTest.md) | | [optional] + +## Example + +```python +from tests_api.models.sip_server_tests import SipServerTests + +# TODO update the JSON string below +json = "{}" +# create an instance of SipServerTests from a JSON string +sip_server_tests_instance = SipServerTests.from_json(json) +# print the JSON string representation of the object +print SipServerTests.to_json() + +# convert the object into a dict +sip_server_tests_dict = sip_server_tests_instance.to_dict() +# create an instance of SipServerTests from a dict +sip_server_tests_form_dict = sip_server_tests.from_dict(sip_server_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/SipTestProtocol.md b/tests_api/docs/SipTestProtocol.md new file mode 100644 index 00000000..624902b4 --- /dev/null +++ b/tests_api/docs/SipTestProtocol.md @@ -0,0 +1,11 @@ +# SipTestProtocol + +Transport layer for SIP communication. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestAuthType.md b/tests_api/docs/TestAuthType.md new file mode 100644 index 00000000..cea7b651 --- /dev/null +++ b/tests_api/docs/TestAuthType.md @@ -0,0 +1,11 @@ +# TestAuthType + +HTTP authentication type. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestCustomHeaders.md b/tests_api/docs/TestCustomHeaders.md new file mode 100644 index 00000000..820319e4 --- /dev/null +++ b/tests_api/docs/TestCustomHeaders.md @@ -0,0 +1,30 @@ +# TestCustomHeaders + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**root** | [**TestCustomHeadersRoot**](TestCustomHeadersRoot.md) | | [optional] +**domains** | [**Dict[str, MapItem]**](MapItem.md) | Use these HTTP headers for the specified domains. | [optional] +**all** | [**TestCustomHeadersAll**](TestCustomHeadersAll.md) | | [optional] + +## Example + +```python +from tests_api.models.test_custom_headers import TestCustomHeaders + +# TODO update the JSON string below +json = "{}" +# create an instance of TestCustomHeaders from a JSON string +test_custom_headers_instance = TestCustomHeaders.from_json(json) +# print the JSON string representation of the object +print TestCustomHeaders.to_json() + +# convert the object into a dict +test_custom_headers_dict = test_custom_headers_instance.to_dict() +# create an instance of TestCustomHeaders from a dict +test_custom_headers_form_dict = test_custom_headers.from_dict(test_custom_headers_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestCustomHeadersAll.md b/tests_api/docs/TestCustomHeadersAll.md new file mode 100644 index 00000000..e89caa14 --- /dev/null +++ b/tests_api/docs/TestCustomHeadersAll.md @@ -0,0 +1,29 @@ +# TestCustomHeadersAll + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **str** | | [optional] +**value** | **str** | | [optional] + +## Example + +```python +from tests_api.models.test_custom_headers_all import TestCustomHeadersAll + +# TODO update the JSON string below +json = "{}" +# create an instance of TestCustomHeadersAll from a JSON string +test_custom_headers_all_instance = TestCustomHeadersAll.from_json(json) +# print the JSON string representation of the object +print TestCustomHeadersAll.to_json() + +# convert the object into a dict +test_custom_headers_all_dict = test_custom_headers_all_instance.to_dict() +# create an instance of TestCustomHeadersAll from a dict +test_custom_headers_all_form_dict = test_custom_headers_all.from_dict(test_custom_headers_all_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestCustomHeadersRoot.md b/tests_api/docs/TestCustomHeadersRoot.md new file mode 100644 index 00000000..3a32e483 --- /dev/null +++ b/tests_api/docs/TestCustomHeadersRoot.md @@ -0,0 +1,29 @@ +# TestCustomHeadersRoot + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **str** | | [optional] +**value** | **str** | | [optional] + +## Example + +```python +from tests_api.models.test_custom_headers_root import TestCustomHeadersRoot + +# TODO update the JSON string below +json = "{}" +# create an instance of TestCustomHeadersRoot from a JSON string +test_custom_headers_root_instance = TestCustomHeadersRoot.from_json(json) +# print the JSON string representation of the object +print TestCustomHeadersRoot.to_json() + +# convert the object into a dict +test_custom_headers_root_dict = test_custom_headers_root_instance.to_dict() +# create an instance of TestCustomHeadersRoot from a dict +test_custom_headers_root_form_dict = test_custom_headers_root.from_dict(test_custom_headers_root_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestDirection.md b/tests_api/docs/TestDirection.md new file mode 100644 index 00000000..59dab3fb --- /dev/null +++ b/tests_api/docs/TestDirection.md @@ -0,0 +1,11 @@ +# TestDirection + +Direction of the test, which affects how results are shown. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestDnsServer.md b/tests_api/docs/TestDnsServer.md new file mode 100644 index 00000000..c809b201 --- /dev/null +++ b/tests_api/docs/TestDnsServer.md @@ -0,0 +1,29 @@ +# TestDnsServer + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**server_id** | **str** | Unique identifier of the DNS server. | [optional] +**server_name** | **str** | Fully qualified domain name (FQDN) of DNS server. | [optional] + +## Example + +```python +from tests_api.models.test_dns_server import TestDnsServer + +# TODO update the JSON string below +json = "{}" +# create an instance of TestDnsServer from a JSON string +test_dns_server_instance = TestDnsServer.from_json(json) +# print the JSON string representation of the object +print TestDnsServer.to_json() + +# convert the object into a dict +test_dns_server_dict = test_dns_server_instance.to_dict() +# create an instance of TestDnsServer from a dict +test_dns_server_form_dict = test_dns_server.from_dict(test_dns_server_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestDnsTransportProtocol.md b/tests_api/docs/TestDnsTransportProtocol.md new file mode 100644 index 00000000..1bcfdbf3 --- /dev/null +++ b/tests_api/docs/TestDnsTransportProtocol.md @@ -0,0 +1,11 @@ +# TestDnsTransportProtocol + +Transport protocol used for DNS requests. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestDscpId.md b/tests_api/docs/TestDscpId.md new file mode 100644 index 00000000..aa714a34 --- /dev/null +++ b/tests_api/docs/TestDscpId.md @@ -0,0 +1,11 @@ +# TestDscpId + +DSCP ID [to see list for acceptable values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests) + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestHttpInterval.md b/tests_api/docs/TestHttpInterval.md new file mode 100644 index 00000000..a6b1fde9 --- /dev/null +++ b/tests_api/docs/TestHttpInterval.md @@ -0,0 +1,11 @@ +# TestHttpInterval + +HTTP test run interval. The interval between HTTP test runs in seconds cannot exceed the specified interval value and defaults to the same value as the interval if not set. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestInterval.md b/tests_api/docs/TestInterval.md new file mode 100644 index 00000000..e0e57d69 --- /dev/null +++ b/tests_api/docs/TestInterval.md @@ -0,0 +1,11 @@ +# TestInterval + +Interval between test runs in seconds. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestIpv6Policy.md b/tests_api/docs/TestIpv6Policy.md new file mode 100644 index 00000000..81e61009 --- /dev/null +++ b/tests_api/docs/TestIpv6Policy.md @@ -0,0 +1,11 @@ +# TestIpv6Policy + +IP version policy. Overrides the IPv6 policy configured at the agent level. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestLabelsInner.md b/tests_api/docs/TestLabelsInner.md new file mode 100644 index 00000000..1c0133ae --- /dev/null +++ b/tests_api/docs/TestLabelsInner.md @@ -0,0 +1,30 @@ +# TestLabelsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label_id** | **str** | Label ID. | [optional] +**name** | **str** | Name of the label. | [optional] +**is_built_in** | **bool** | Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User). | [optional] + +## Example + +```python +from tests_api.models.test_labels_inner import TestLabelsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of TestLabelsInner from a JSON string +test_labels_inner_instance = TestLabelsInner.from_json(json) +# print the JSON string representation of the object +print TestLabelsInner.to_json() + +# convert the object into a dict +test_labels_inner_dict = test_labels_inner_instance.to_dict() +# create an instance of TestLabelsInner from a dict +test_labels_inner_form_dict = test_labels_inner.from_dict(test_labels_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestPageLoadingStrategy.md b/tests_api/docs/TestPageLoadingStrategy.md new file mode 100644 index 00000000..d4f92f00 --- /dev/null +++ b/tests_api/docs/TestPageLoadingStrategy.md @@ -0,0 +1,11 @@ +# TestPageLoadingStrategy + +* `normal`: The test waits until the entire page is fully loaded, including the downloading and parsing of HTML content as well as all associated resources, before advancing to the next action in the transaction test script. * `eager`: The test waits for the DOMContentLoaded event, indicating that HTML content is downloaded and parsed, and the document reaches the \"interactive\" readiness state, before proceeding to the next action in the test script. * `none`: The test only waits for the download of HTML content. Once the HTML is downloaded, the test continues to the next action in the transaction test script without waiting for additional resources. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestPathTraceMode.md b/tests_api/docs/TestPathTraceMode.md new file mode 100644 index 00000000..f93da70d --- /dev/null +++ b/tests_api/docs/TestPathTraceMode.md @@ -0,0 +1,11 @@ +# TestPathTraceMode + +Select `inSession` to perform the path trace within a TCP session. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestProbeMode.md b/tests_api/docs/TestProbeMode.md new file mode 100644 index 00000000..2e0ad614 --- /dev/null +++ b/tests_api/docs/TestProbeMode.md @@ -0,0 +1,11 @@ +# TestProbeMode + +Probe mode used by network test, only valid when the protocol is set to TCP. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestProtocol.md b/tests_api/docs/TestProtocol.md new file mode 100644 index 00000000..32cac130 --- /dev/null +++ b/tests_api/docs/TestProtocol.md @@ -0,0 +1,11 @@ +# TestProtocol + +Protocol used by dependent network tests (end-to-end, path trace, PMTUD). + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestRequest.md b/tests_api/docs/TestRequest.md new file mode 100644 index 00000000..487d767a --- /dev/null +++ b/tests_api/docs/TestRequest.md @@ -0,0 +1,31 @@ +# TestRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**agents** | [**List[TestRequestAllOfAgents]**](TestRequestAllOfAgents.md) | Contains list of object with required `agentId` and optional `sourceIpAddress` | [optional] + +## Example + +```python +from tests_api.models.test_request import TestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of TestRequest from a JSON string +test_request_instance = TestRequest.from_json(json) +# print the JSON string representation of the object +print TestRequest.to_json() + +# convert the object into a dict +test_request_dict = test_request_instance.to_dict() +# create an instance of TestRequest from a dict +test_request_form_dict = test_request.from_dict(test_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) + + diff --git a/tests_api/docs/TestRequestAllOfAgents.md b/tests_api/docs/TestRequestAllOfAgents.md new file mode 100644 index 00000000..70f0ba68 --- /dev/null +++ b/tests_api/docs/TestRequestAllOfAgents.md @@ -0,0 +1,29 @@ +# TestRequestAllOfAgents + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Agent Id (get `agentId` from `/agents` endpoint) | [optional] +**source_ip_address** | **str** | IP address from `ipAddresses` of Agent Details for interface selection (get `ipAddresses` from `/agents` endpoint) | [optional] + +## Example + +```python +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents + +# TODO update the JSON string below +json = "{}" +# create an instance of TestRequestAllOfAgents from a JSON string +test_request_all_of_agents_instance = TestRequestAllOfAgents.from_json(json) +# print the JSON string representation of the object +print TestRequestAllOfAgents.to_json() + +# convert the object into a dict +test_request_all_of_agents_dict = test_request_all_of_agents_instance.to_dict() +# create an instance of TestRequestAllOfAgents from a dict +test_request_all_of_agents_form_dict = test_request_all_of_agents.from_dict(test_request_all_of_agents_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestSharedAccountsInner.md b/tests_api/docs/TestSharedAccountsInner.md new file mode 100644 index 00000000..90458aca --- /dev/null +++ b/tests_api/docs/TestSharedAccountsInner.md @@ -0,0 +1,29 @@ +# TestSharedAccountsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | Account group ID. | [optional] +**name** | **str** | Account group name. | [optional] + +## Example + +```python +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of TestSharedAccountsInner from a JSON string +test_shared_accounts_inner_instance = TestSharedAccountsInner.from_json(json) +# print the JSON string representation of the object +print TestSharedAccountsInner.to_json() + +# convert the object into a dict +test_shared_accounts_inner_dict = test_shared_accounts_inner_instance.to_dict() +# create an instance of TestSharedAccountsInner from a dict +test_shared_accounts_inner_form_dict = test_shared_accounts_inner.from_dict(test_shared_accounts_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestSipCredentials.md b/tests_api/docs/TestSipCredentials.md new file mode 100644 index 00000000..1d1a6e18 --- /dev/null +++ b/tests_api/docs/TestSipCredentials.md @@ -0,0 +1,33 @@ +# TestSipCredentials + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_user** | **str** | Username for authentication with SIP server. | [optional] +**password** | **str** | Password for authentication with SIP server. | [optional] +**port** | **int** | Port number for the chosen protocol. | +**protocol** | [**SipTestProtocol**](SipTestProtocol.md) | | [optional] +**sip_registrar** | **str** | SIP server to be tested, specified by domain name or IP address. | [optional] +**user** | **str** | Username for SIP registration, should be unique within a ThousandEyes account group. | [optional] + +## Example + +```python +from tests_api.models.test_sip_credentials import TestSipCredentials + +# TODO update the JSON string below +json = "{}" +# create an instance of TestSipCredentials from a JSON string +test_sip_credentials_instance = TestSipCredentials.from_json(json) +# print the JSON string representation of the object +print TestSipCredentials.to_json() + +# convert the object into a dict +test_sip_credentials_dict = test_sip_credentials_instance.to_dict() +# create an instance of TestSipCredentials from a dict +test_sip_credentials_form_dict = test_sip_credentials.from_dict(test_sip_credentials_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestSslVersionId.md b/tests_api/docs/TestSslVersionId.md new file mode 100644 index 00000000..fb9ac0f8 --- /dev/null +++ b/tests_api/docs/TestSslVersionId.md @@ -0,0 +1,11 @@ +# TestSslVersionId + +SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestSubInterval.md b/tests_api/docs/TestSubInterval.md new file mode 100644 index 00000000..b693f998 --- /dev/null +++ b/tests_api/docs/TestSubInterval.md @@ -0,0 +1,11 @@ +# TestSubInterval + +Subinterval for round-robin testing (in seconds). Must be less than or equal to interval and must evenly divide interval. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/TestType.md b/tests_api/docs/TestType.md new file mode 100644 index 00000000..ae5d924e --- /dev/null +++ b/tests_api/docs/TestType.md @@ -0,0 +1,11 @@ +# TestType + +This is a read only value, as test type is implicit in the test creation url. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/Tests.md b/tests_api/docs/Tests.md new file mode 100644 index 00000000..851d2434 --- /dev/null +++ b/tests_api/docs/Tests.md @@ -0,0 +1,28 @@ +# Tests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[SimpleTest]**](SimpleTest.md) | | [optional] + +## Example + +```python +from tests_api.models.tests import Tests + +# TODO update the JSON string below +json = "{}" +# create an instance of Tests from a JSON string +tests_instance = Tests.from_json(json) +# print the JSON string representation of the object +print Tests.to_json() + +# convert the object into a dict +tests_dict = tests_instance.to_dict() +# create an instance of Tests from a dict +tests_form_dict = tests.from_dict(tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UnauthorizedError.md b/tests_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..55006614 --- /dev/null +++ b/tests_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from tests_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UnexpandedInstantTest.md b/tests_api/docs/UnexpandedInstantTest.md new file mode 100644 index 00000000..19d29fa8 --- /dev/null +++ b/tests_api/docs/UnexpandedInstantTest.md @@ -0,0 +1,38 @@ +# UnexpandedInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | [**TestType**](TestType.md) | | [optional] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.unexpanded_instant_test import UnexpandedInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTest from a JSON string +unexpanded_instant_test_instance = UnexpandedInstantTest.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTest.to_json() + +# convert the object into a dict +unexpanded_instant_test_dict = unexpanded_instant_test_instance.to_dict() +# create an instance of UnexpandedInstantTest from a dict +unexpanded_instant_test_form_dict = unexpanded_instant_test.from_dict(unexpanded_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UnexpandedInstantTestLinks.md b/tests_api/docs/UnexpandedInstantTestLinks.md new file mode 100644 index 00000000..246c9a7f --- /dev/null +++ b/tests_api/docs/UnexpandedInstantTestLinks.md @@ -0,0 +1,30 @@ +# UnexpandedInstantTestLinks + +A list of links that can be accessed to get more information + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**UnexpandedInstantTestLinksSelf**](UnexpandedInstantTestLinksSelf.md) | | [optional] +**test_results** | [**UnexpandedInstantTestLinksTestResults**](UnexpandedInstantTestLinksTestResults.md) | | [optional] + +## Example + +```python +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinks from a JSON string +unexpanded_instant_test_links_instance = UnexpandedInstantTestLinks.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinks.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_dict = unexpanded_instant_test_links_instance.to_dict() +# create an instance of UnexpandedInstantTestLinks from a dict +unexpanded_instant_test_links_form_dict = unexpanded_instant_test_links.from_dict(unexpanded_instant_test_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UnexpandedInstantTestLinksSelf.md b/tests_api/docs/UnexpandedInstantTestLinksSelf.md new file mode 100644 index 00000000..7c93aa87 --- /dev/null +++ b/tests_api/docs/UnexpandedInstantTestLinksSelf.md @@ -0,0 +1,35 @@ +# UnexpandedInstantTestLinksSelf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from tests_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinksSelf from a JSON string +unexpanded_instant_test_links_self_instance = UnexpandedInstantTestLinksSelf.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinksSelf.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_self_dict = unexpanded_instant_test_links_self_instance.to_dict() +# create an instance of UnexpandedInstantTestLinksSelf from a dict +unexpanded_instant_test_links_self_form_dict = unexpanded_instant_test_links_self.from_dict(unexpanded_instant_test_links_self_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UnexpandedInstantTestLinksTestResults.md b/tests_api/docs/UnexpandedInstantTestLinksTestResults.md new file mode 100644 index 00000000..8e581cee --- /dev/null +++ b/tests_api/docs/UnexpandedInstantTestLinksTestResults.md @@ -0,0 +1,35 @@ +# UnexpandedInstantTestLinksTestResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from tests_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedInstantTestLinksTestResults from a JSON string +unexpanded_instant_test_links_test_results_instance = UnexpandedInstantTestLinksTestResults.from_json(json) +# print the JSON string representation of the object +print UnexpandedInstantTestLinksTestResults.to_json() + +# convert the object into a dict +unexpanded_instant_test_links_test_results_dict = unexpanded_instant_test_links_test_results_instance.to_dict() +# create an instance of UnexpandedInstantTestLinksTestResults from a dict +unexpanded_instant_test_links_test_results_form_dict = unexpanded_instant_test_links_test_results.from_dict(unexpanded_instant_test_links_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UnexpandedTest.md b/tests_api/docs/UnexpandedTest.md new file mode 100644 index 00000000..599c93da --- /dev/null +++ b/tests_api/docs/UnexpandedTest.md @@ -0,0 +1,30 @@ +# UnexpandedTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] + +## Example + +```python +from tests_api.models.unexpanded_test import UnexpandedTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UnexpandedTest from a JSON string +unexpanded_test_instance = UnexpandedTest.from_json(json) +# print the JSON string representation of the object +print UnexpandedTest.to_json() + +# convert the object into a dict +unexpanded_test_dict = unexpanded_test_instance.to_dict() +# create an instance of UnexpandedTest from a dict +unexpanded_test_form_dict = unexpanded_test.from_dict(unexpanded_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UpdateAgentToAgentTest.md b/tests_api/docs/UpdateAgentToAgentTest.md new file mode 100644 index 00000000..ca263596 --- /dev/null +++ b/tests_api/docs/UpdateAgentToAgentTest.md @@ -0,0 +1,60 @@ +# UpdateAgentToAgentTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**agents** | [**List[TestRequestAllOfAgents]**](TestRequestAllOfAgents.md) | Contains list of object with required `agentId` and optional `sourceIpAddress` | +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**mss** | **int** | Maximum segment size, in bytes. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**protocol** | [**AgentToAgentTestProtocol**](AgentToAgentTestProtocol.md) | | [optional] +**target_agent_id** | **str** | `agentId` of the target agent for the test. | +**throughput_measurements** | **bool** | Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent. | [optional] [default to False] +**throughput_duration** | **int** | The throughput duration. | [optional] [default to 10000] +**throughput_rate** | **int** | The throughput rate, only applicable for UDP protocol. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] + +## Example + +```python +from tests_api.models.update_agent_to_agent_test import UpdateAgentToAgentTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateAgentToAgentTest from a JSON string +update_agent_to_agent_test_instance = UpdateAgentToAgentTest.from_json(json) +# print the JSON string representation of the object +print UpdateAgentToAgentTest.to_json() + +# convert the object into a dict +update_agent_to_agent_test_dict = update_agent_to_agent_test_instance.to_dict() +# create an instance of UpdateAgentToAgentTest from a dict +update_agent_to_agent_test_form_dict = update_agent_to_agent_test.from_dict(update_agent_to_agent_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UpdateAgentToServerTest.md b/tests_api/docs/UpdateAgentToServerTest.md new file mode 100644 index 00000000..a2ff2bdc --- /dev/null +++ b/tests_api/docs/UpdateAgentToServerTest.md @@ -0,0 +1,62 @@ +# UpdateAgentToServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**agents** | [**List[TestRequestAllOfAgents]**](TestRequestAllOfAgents.md) | Contains list of object with required `agentId` and optional `sourceIpAddress` | +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**continuous_mode** | **bool** | To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. | [optional] +**fixed_packet_rate** | **int** | If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1` | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**server** | **str** | Target name or IP address. | +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**ping_payload_size** | **int** | Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests. | [optional] +**network_measurements** | **bool** | View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements. | [optional] [default to False] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] + +## Example + +```python +from tests_api.models.update_agent_to_server_test import UpdateAgentToServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateAgentToServerTest from a JSON string +update_agent_to_server_test_instance = UpdateAgentToServerTest.from_json(json) +# print the JSON string representation of the object +print UpdateAgentToServerTest.to_json() + +# convert the object into a dict +update_agent_to_server_test_dict = update_agent_to_server_test_instance.to_dict() +# create an instance of UpdateAgentToServerTest from a dict +update_agent_to_server_test_form_dict = update_agent_to_server_test.from_dict(update_agent_to_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UpdateBgpTest.md b/tests_api/docs/UpdateBgpTest.md new file mode 100644 index 00000000..d93b26fa --- /dev/null +++ b/tests_api/docs/UpdateBgpTest.md @@ -0,0 +1,46 @@ +# UpdateBgpTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] +**include_covered_prefixes** | **bool** | Indicate if queries for subprefixes detected under this prefix should included. | [optional] +**prefix** | **str** | a.b.c.d is a network address, with the prefix length defined as e. Prefixes can be any length from 8 to 24. | +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used. | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] + +## Example + +```python +from tests_api.models.update_bgp_test import UpdateBgpTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateBgpTest from a JSON string +update_bgp_test_instance = UpdateBgpTest.from_json(json) +# print the JSON string representation of the object +print UpdateBgpTest.to_json() + +# convert the object into a dict +update_bgp_test_dict = update_bgp_test_instance.to_dict() +# create an instance of UpdateBgpTest from a dict +update_bgp_test_form_dict = update_bgp_test.from_dict(update_bgp_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UpdateDnsSecTest.md b/tests_api/docs/UpdateDnsSecTest.md new file mode 100644 index 00000000..403e64ac --- /dev/null +++ b/tests_api/docs/UpdateDnsSecTest.md @@ -0,0 +1,47 @@ +# UpdateDnsSecTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**agents** | [**List[TestRequestAllOfAgents]**](TestRequestAllOfAgents.md) | Contains list of object with required `agentId` and optional `sourceIpAddress` | +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from tests_api.models.update_dns_sec_test import UpdateDnsSecTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateDnsSecTest from a JSON string +update_dns_sec_test_instance = UpdateDnsSecTest.from_json(json) +# print the JSON string representation of the object +print UpdateDnsSecTest.to_json() + +# convert the object into a dict +update_dns_sec_test_dict = update_dns_sec_test_instance.to_dict() +# create an instance of UpdateDnsSecTest from a dict +update_dns_sec_test_form_dict = update_dns_sec_test.from_dict(update_dns_sec_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UpdateDnsServerTest.md b/tests_api/docs/UpdateDnsServerTest.md new file mode 100644 index 00000000..f7a737e4 --- /dev/null +++ b/tests_api/docs/UpdateDnsServerTest.md @@ -0,0 +1,61 @@ +# UpdateDnsServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**agents** | [**List[TestRequestAllOfAgents]**](TestRequestAllOfAgents.md) | Contains list of object with required `agentId` and optional `sourceIpAddress` | +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**dns_servers** | [**List[TestDnsServer]**](TestDnsServer.md) | | +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**recursive_queries** | **bool** | Set true to run query with RD (recursion desired) flag enabled. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] + +## Example + +```python +from tests_api.models.update_dns_server_test import UpdateDnsServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateDnsServerTest from a JSON string +update_dns_server_test_instance = UpdateDnsServerTest.from_json(json) +# print the JSON string representation of the object +print UpdateDnsServerTest.to_json() + +# convert the object into a dict +update_dns_server_test_dict = update_dns_server_test_instance.to_dict() +# create an instance of UpdateDnsServerTest from a dict +update_dns_server_test_form_dict = update_dns_server_test.from_dict(update_dns_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UpdateDnsTraceTest.md b/tests_api/docs/UpdateDnsTraceTest.md new file mode 100644 index 00000000..a4e34ee2 --- /dev/null +++ b/tests_api/docs/UpdateDnsTraceTest.md @@ -0,0 +1,48 @@ +# UpdateDnsTraceTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**agents** | [**List[TestRequestAllOfAgents]**](TestRequestAllOfAgents.md) | Contains list of object with required `agentId` and optional `sourceIpAddress` | +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] + +## Example + +```python +from tests_api.models.update_dns_trace_test import UpdateDnsTraceTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateDnsTraceTest from a JSON string +update_dns_trace_test_instance = UpdateDnsTraceTest.from_json(json) +# print the JSON string representation of the object +print UpdateDnsTraceTest.to_json() + +# convert the object into a dict +update_dns_trace_test_dict = update_dns_trace_test_instance.to_dict() +# create an instance of UpdateDnsTraceTest from a dict +update_dns_trace_test_form_dict = update_dns_trace_test.from_dict(update_dns_trace_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UpdateFtpServerTest.md b/tests_api/docs/UpdateFtpServerTest.md new file mode 100644 index 00000000..065626f9 --- /dev/null +++ b/tests_api/docs/UpdateFtpServerTest.md @@ -0,0 +1,65 @@ +# UpdateFtpServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**agents** | [**List[TestRequestAllOfAgents]**](TestRequestAllOfAgents.md) | Contains list of object with required `agentId` and optional `sourceIpAddress` | +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**download_limit** | **int** | Specify maximum number of bytes to download from the target object. | [optional] +**ftp_target_time** | **int** | Target time for operation completion; specified in milliseconds. | [optional] +**ftp_time_limit** | **int** | Set the time limit for the test in seconds. | [optional] [default to 10] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**request_type** | [**FtpServerRequestType**](FtpServerRequestType.md) | | +**url** | **str** | Target for the test. | +**use_active_ftp** | **bool** | Explicitly set the flag to use active FTP. | [optional] [default to False] +**use_explicit_ftps** | **bool** | Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] + +## Example + +```python +from tests_api.models.update_ftp_server_test import UpdateFtpServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateFtpServerTest from a JSON string +update_ftp_server_test_instance = UpdateFtpServerTest.from_json(json) +# print the JSON string representation of the object +print UpdateFtpServerTest.to_json() + +# convert the object into a dict +update_ftp_server_test_dict = update_ftp_server_test_instance.to_dict() +# create an instance of UpdateFtpServerTest from a dict +update_ftp_server_test_form_dict = update_ftp_server_test.from_dict(update_ftp_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UpdateHttpServerTest.md b/tests_api/docs/UpdateHttpServerTest.md new file mode 100644 index 00000000..fb7a9fef --- /dev/null +++ b/tests_api/docs/UpdateHttpServerTest.md @@ -0,0 +1,78 @@ +# UpdateHttpServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**agents** | [**List[TestRequestAllOfAgents]**](TestRequestAllOfAgents.md) | Contains list of object with required `agentId` and optional `sourceIpAddress` | +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**headers** | **List[str]** | HTTP request headers used. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] + +## Example + +```python +from tests_api.models.update_http_server_test import UpdateHttpServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateHttpServerTest from a JSON string +update_http_server_test_instance = UpdateHttpServerTest.from_json(json) +# print the JSON string representation of the object +print UpdateHttpServerTest.to_json() + +# convert the object into a dict +update_http_server_test_dict = update_http_server_test_instance.to_dict() +# create an instance of UpdateHttpServerTest from a dict +update_http_server_test_form_dict = update_http_server_test.from_dict(update_http_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UpdatePageLoadTest.md b/tests_api/docs/UpdatePageLoadTest.md new file mode 100644 index 00000000..0c07557e --- /dev/null +++ b/tests_api/docs/UpdatePageLoadTest.md @@ -0,0 +1,82 @@ +# UpdatePageLoadTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**agents** | [**List[TestRequestAllOfAgents]**](TestRequestAllOfAgents.md) | Contains list of object with required `agentId` and optional `sourceIpAddress` | +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Verify content using a regular expression. This field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**page_load_target_time** | **int** | Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`. | [optional] +**page_load_time_limit** | **int** | Page load time limit. Must be larger than the `httpTimeLimit`. | [optional] [default to 10] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] +**http_interval** | [**TestHttpInterval**](TestHttpInterval.md) | | +**subinterval** | [**TestSubInterval**](TestSubInterval.md) | | [optional] + +## Example + +```python +from tests_api.models.update_page_load_test import UpdatePageLoadTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdatePageLoadTest from a JSON string +update_page_load_test_instance = UpdatePageLoadTest.from_json(json) +# print the JSON string representation of the object +print UpdatePageLoadTest.to_json() + +# convert the object into a dict +update_page_load_test_dict = update_page_load_test_instance.to_dict() +# create an instance of UpdatePageLoadTest from a dict +update_page_load_test_form_dict = update_page_load_test.from_dict(update_page_load_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UpdatePathVisInterfaceGroup200Response.md b/tests_api/docs/UpdatePathVisInterfaceGroup200Response.md new file mode 100644 index 00000000..974eec53 --- /dev/null +++ b/tests_api/docs/UpdatePathVisInterfaceGroup200Response.md @@ -0,0 +1,33 @@ +# UpdatePathVisInterfaceGroup200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | Account Group Id | [optional] [readonly] +**group_id** | **str** | Group ID | [optional] [readonly] +**group_name** | **str** | Name of the path visualization interface group | [optional] +**ip_addresses** | **List[str]** | Array of IP addresses associated with the interface group | [optional] +**rdns_regexes** | **List[str]** | Array of RDNS Regexes associated with the interface group | [optional] [readonly] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from tests_api.models.update_path_vis_interface_group200_response import UpdatePathVisInterfaceGroup200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdatePathVisInterfaceGroup200Response from a JSON string +update_path_vis_interface_group200_response_instance = UpdatePathVisInterfaceGroup200Response.from_json(json) +# print the JSON string representation of the object +print UpdatePathVisInterfaceGroup200Response.to_json() + +# convert the object into a dict +update_path_vis_interface_group200_response_dict = update_path_vis_interface_group200_response_instance.to_dict() +# create an instance of UpdatePathVisInterfaceGroup200Response from a dict +update_path_vis_interface_group200_response_form_dict = update_path_vis_interface_group200_response.from_dict(update_path_vis_interface_group200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UpdateSipServerTest.md b/tests_api/docs/UpdateSipServerTest.md new file mode 100644 index 00000000..2e6f1dd0 --- /dev/null +++ b/tests_api/docs/UpdateSipServerTest.md @@ -0,0 +1,62 @@ +# UpdateSipServerTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**agents** | [**List[TestRequestAllOfAgents]**](TestRequestAllOfAgents.md) | Contains list of object with required `agentId` and optional `sourceIpAddress` | +**auth_user** | **str** | Username for authentication with SIP server. | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**options_regex** | **str** | Options regex, this field does not require escaping. | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [default to 49153] +**protocol** | [**SipTestProtocol**](SipTestProtocol.md) | | [optional] +**register_enabled** | **bool** | Set to true to perform SIP registration on the test target with the SIP REGISTER command. | [optional] [default to False] +**sip_registrar** | **str** | SIP server to be tested, specified by domain name or IP address. | [optional] +**sip_target_time** | **int** | Target time for test completion in milliseconds. | [optional] +**sip_time_limit** | **int** | Time limit in milliseconds. | [optional] [default to 5] +**target_sip_credentials** | [**TestSipCredentials**](TestSipCredentials.md) | | +**user** | **str** | Username for SIP registration, should be unique within a ThousandEyes account group. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] + +## Example + +```python +from tests_api.models.update_sip_server_test import UpdateSipServerTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateSipServerTest from a JSON string +update_sip_server_test_instance = UpdateSipServerTest.from_json(json) +# print the JSON string representation of the object +print UpdateSipServerTest.to_json() + +# convert the object into a dict +update_sip_server_test_dict = update_sip_server_test_instance.to_dict() +# create an instance of UpdateSipServerTest from a dict +update_sip_server_test_form_dict = update_sip_server_test.from_dict(update_sip_server_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UpdateVoiceTest.md b/tests_api/docs/UpdateVoiceTest.md new file mode 100644 index 00000000..ae04c1f7 --- /dev/null +++ b/tests_api/docs/UpdateVoiceTest.md @@ -0,0 +1,55 @@ +# UpdateVoiceTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**agents** | [**List[TestRequestAllOfAgents]**](TestRequestAllOfAgents.md) | Contains list of object with required `agentId` and optional `sourceIpAddress` | +**codec** | **str** | Codec label | [optional] [readonly] +**codec_id** | **str** | Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab) | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**duration** | **int** | Duration of the test in seconds. | [optional] [default to 5] +**jitter_buffer** | **int** | De-jitter buffer size in seconds. | [optional] [default to 40] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**port** | **int** | Port number for the chosen protocol. | [optional] +**target_agent_id** | **str** | Agent ID of the target agent for the test. | +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] + +## Example + +```python +from tests_api.models.update_voice_test import UpdateVoiceTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateVoiceTest from a JSON string +update_voice_test_instance = UpdateVoiceTest.from_json(json) +# print the JSON string representation of the object +print UpdateVoiceTest.to_json() + +# convert the object into a dict +update_voice_test_dict = update_voice_test_instance.to_dict() +# create an instance of UpdateVoiceTest from a dict +update_voice_test_form_dict = update_voice_test.from_dict(update_voice_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/UpdateWebTransactionTest.md b/tests_api/docs/UpdateWebTransactionTest.md new file mode 100644 index 00000000..f91c3cf8 --- /dev/null +++ b/tests_api/docs/UpdateWebTransactionTest.md @@ -0,0 +1,84 @@ +# UpdateWebTransactionTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**agents** | [**List[TestRequestAllOfAgents]**](TestRequestAllOfAgents.md) | Contains list of object with required `agentId` and optional `sourceIpAddress` | +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Verify content using a regular expression. This field does not require escaping. | [optional] +**credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**target_time** | **int** | Target time for completion, defaults to 50% of time limit specified in seconds. | [optional] +**time_limit** | **int** | Time limit for transaction in seconds. | [optional] [default to 30] +**transaction_script** | **str** | JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ). | +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] +**subinterval** | [**TestSubInterval**](TestSubInterval.md) | | [optional] + +## Example + +```python +from tests_api.models.update_web_transaction_test import UpdateWebTransactionTest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateWebTransactionTest from a JSON string +update_web_transaction_test_instance = UpdateWebTransactionTest.from_json(json) +# print the JSON string representation of the object +print UpdateWebTransactionTest.to_json() + +# convert the object into a dict +update_web_transaction_test_dict = update_web_transaction_test_instance.to_dict() +# create an instance of UpdateWebTransactionTest from a dict +update_web_transaction_test_form_dict = update_web_transaction_test.from_dict(update_web_transaction_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/VoiceApi.md b/tests_api/docs/VoiceApi.md new file mode 100644 index 00000000..9c519bf3 --- /dev/null +++ b/tests_api/docs/VoiceApi.md @@ -0,0 +1,453 @@ +# tests_api.VoiceApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_voice_test**](VoiceApi.md#create_voice_test) | **POST** /v7/tests/voice | Create Voice test +[**delete_voice_test**](VoiceApi.md#delete_voice_test) | **DELETE** /v7/tests/voice/{testId} | Delete Voice test +[**get_voice_test**](VoiceApi.md#get_voice_test) | **GET** /v7/tests/voice/{testId} | Get Voice test +[**get_voice_tests**](VoiceApi.md#get_voice_tests) | **GET** /v7/tests/voice | List Voice tests +[**update_voice_test**](VoiceApi.md#update_voice_test) | **PUT** /v7/tests/voice/{testId} | Update Voice test + + +# **create_voice_test** +> VoiceTest create_voice_test(update_voice_test, aid=aid, expand=expand) + +Create Voice test + +Creates a new Voice test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.update_voice_test import UpdateVoiceTest +from tests_api.models.voice_test import VoiceTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.VoiceApi(api_client) + update_voice_test = tests_api.UpdateVoiceTest() # UpdateVoiceTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create Voice test + api_response = api_instance.create_voice_test(update_voice_test, aid=aid, expand=expand) + print("The response of VoiceApi->create_voice_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceApi->create_voice_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_voice_test** | [**UpdateVoiceTest**](UpdateVoiceTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**VoiceTest**](VoiceTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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) + +# **delete_voice_test** +> delete_voice_test(test_id, aid=aid) + +Delete Voice test + +Deletes the specified Voice test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.VoiceApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 Voice test + api_instance.delete_voice_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling VoiceApi->delete_voice_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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_voice_test** +> GetVoiceTest200Response get_voice_test(test_id, aid=aid, expand=expand) + +Get Voice test + +Returns details for a Voice test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_voice_test200_response import GetVoiceTest200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.VoiceApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get Voice test + api_response = api_instance.get_voice_test(test_id, aid=aid, expand=expand) + print("The response of VoiceApi->get_voice_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceApi->get_voice_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetVoiceTest200Response**](GetVoiceTest200Response.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_voice_tests** +> GetVoiceTests200Response get_voice_tests(aid=aid) + +List Voice tests + +Returns a list of Voice tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_voice_tests200_response import GetVoiceTests200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.VoiceApi(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 Voice tests + api_response = api_instance.get_voice_tests(aid=aid) + print("The response of VoiceApi->get_voice_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceApi->get_voice_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetVoiceTests200Response**](GetVoiceTests200Response.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_voice_test** +> GetVoiceTest200Response update_voice_test(test_id, update_voice_test, aid=aid, expand=expand) + +Update Voice test + +Updates a Voice test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_voice_test200_response import GetVoiceTest200Response +from tests_api.models.update_voice_test import UpdateVoiceTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.VoiceApi(api_client) + test_id = '281474976710706' # str | ID of the test + update_voice_test = tests_api.UpdateVoiceTest() # UpdateVoiceTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update Voice test + api_response = api_instance.update_voice_test(test_id, update_voice_test, aid=aid, expand=expand) + print("The response of VoiceApi->update_voice_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceApi->update_voice_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **update_voice_test** | [**UpdateVoiceTest**](UpdateVoiceTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetVoiceTest200Response**](GetVoiceTest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/tests_api/docs/VoiceInstantTest.md b/tests_api/docs/VoiceInstantTest.md new file mode 100644 index 00000000..15eadc7f --- /dev/null +++ b/tests_api/docs/VoiceInstantTest.md @@ -0,0 +1,50 @@ +# VoiceInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**codec** | **str** | Codec label | [optional] [readonly] +**codec_id** | **str** | Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab) | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**duration** | **int** | Duration of the test in seconds. | [optional] [default to 5] +**jitter_buffer** | **int** | De-jitter buffer size in seconds. | [optional] [default to 40] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**port** | **int** | Port number for the chosen protocol. | [optional] +**target_agent_id** | **str** | Agent ID of the target agent for the test. | + +## Example + +```python +from tests_api.models.voice_instant_test import VoiceInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of VoiceInstantTest from a JSON string +voice_instant_test_instance = VoiceInstantTest.from_json(json) +# print the JSON string representation of the object +print VoiceInstantTest.to_json() + +# convert the object into a dict +voice_instant_test_dict = voice_instant_test_instance.to_dict() +# create an instance of VoiceInstantTest from a dict +voice_instant_test_form_dict = voice_instant_test.from_dict(voice_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/VoiceTest.md b/tests_api/docs/VoiceTest.md new file mode 100644 index 00000000..411c6665 --- /dev/null +++ b/tests_api/docs/VoiceTest.md @@ -0,0 +1,55 @@ +# VoiceTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**codec** | **str** | Codec label | [optional] [readonly] +**codec_id** | **str** | Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab) | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**duration** | **int** | Duration of the test in seconds. | [optional] [default to 5] +**jitter_buffer** | **int** | De-jitter buffer size in seconds. | [optional] [default to 40] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**port** | **int** | Port number for the chosen protocol. | [optional] +**target_agent_id** | **str** | Agent ID of the target agent for the test. | +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] + +## Example + +```python +from tests_api.models.voice_test import VoiceTest + +# TODO update the JSON string below +json = "{}" +# create an instance of VoiceTest from a JSON string +voice_test_instance = VoiceTest.from_json(json) +# print the JSON string representation of the object +print VoiceTest.to_json() + +# convert the object into a dict +voice_test_dict = voice_test_instance.to_dict() +# create an instance of VoiceTest from a dict +voice_test_form_dict = voice_test.from_dict(voice_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/VoiceTests.md b/tests_api/docs/VoiceTests.md new file mode 100644 index 00000000..4f31d56f --- /dev/null +++ b/tests_api/docs/VoiceTests.md @@ -0,0 +1,28 @@ +# VoiceTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[VoiceTest]**](VoiceTest.md) | | [optional] + +## Example + +```python +from tests_api.models.voice_tests import VoiceTests + +# TODO update the JSON string below +json = "{}" +# create an instance of VoiceTests from a JSON string +voice_tests_instance = VoiceTests.from_json(json) +# print the JSON string representation of the object +print VoiceTests.to_json() + +# convert the object into a dict +voice_tests_dict = voice_tests_instance.to_dict() +# create an instance of VoiceTests from a dict +voice_tests_form_dict = voice_tests.from_dict(voice_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/WebTransactionApi.md b/tests_api/docs/WebTransactionApi.md new file mode 100644 index 00000000..799faa3c --- /dev/null +++ b/tests_api/docs/WebTransactionApi.md @@ -0,0 +1,453 @@ +# tests_api.WebTransactionApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_web_transactions_test**](WebTransactionApi.md#create_web_transactions_test) | **POST** /v7/tests/web-transactions | Create Web Transactions test +[**delete_web_transactions_test**](WebTransactionApi.md#delete_web_transactions_test) | **DELETE** /v7/tests/web-transactions/{testId} | Delete Web Transactions test +[**get_web_transactions_test**](WebTransactionApi.md#get_web_transactions_test) | **GET** /v7/tests/web-transactions/{testId} | Get Web Transactions test +[**get_web_transactions_tests**](WebTransactionApi.md#get_web_transactions_tests) | **GET** /v7/tests/web-transactions | List Web Transactions tests +[**update_web_transactions_test**](WebTransactionApi.md#update_web_transactions_test) | **PUT** /v7/tests/web-transactions/{testId} | Update Web Transactions test + + +# **create_web_transactions_test** +> WebTransactionTest create_web_transactions_test(update_web_transaction_test, aid=aid, expand=expand) + +Create Web Transactions test + +Creates a new Web Transactions test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.update_web_transaction_test import UpdateWebTransactionTest +from tests_api.models.web_transaction_test import WebTransactionTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.WebTransactionApi(api_client) + update_web_transaction_test = tests_api.UpdateWebTransactionTest() # UpdateWebTransactionTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create Web Transactions test + api_response = api_instance.create_web_transactions_test(update_web_transaction_test, aid=aid, expand=expand) + print("The response of WebTransactionApi->create_web_transactions_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionApi->create_web_transactions_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_web_transaction_test** | [**UpdateWebTransactionTest**](UpdateWebTransactionTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**WebTransactionTest**](WebTransactionTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**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) + +# **delete_web_transactions_test** +> delete_web_transactions_test(test_id, aid=aid) + +Delete Web Transactions test + +Deletes the specified Web Transactions test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.WebTransactionApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 Web Transactions test + api_instance.delete_web_transactions_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling WebTransactionApi->delete_web_transactions_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +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_web_transactions_test** +> GetWebTransactionsTest200Response get_web_transactions_test(test_id, aid=aid, expand=expand) + +Get Web Transactions test + +Returns details for a Web Transactions test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_web_transactions_test200_response import GetWebTransactionsTest200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.WebTransactionApi(api_client) + test_id = '281474976710706' # str | ID of the test + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get Web Transactions test + api_response = api_instance.get_web_transactions_test(test_id, aid=aid, expand=expand) + print("The response of WebTransactionApi->get_web_transactions_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionApi->get_web_transactions_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetWebTransactionsTest200Response**](GetWebTransactionsTest200Response.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_web_transactions_tests** +> GetWebTransactionsTests200Response get_web_transactions_tests(aid=aid) + +List Web Transactions tests + +Returns a list of all Web Transactions tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.get_web_transactions_tests200_response import GetWebTransactionsTests200Response +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.WebTransactionApi(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 Web Transactions tests + api_response = api_instance.get_web_transactions_tests(aid=aid) + print("The response of WebTransactionApi->get_web_transactions_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionApi->get_web_transactions_tests: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetWebTransactionsTests200Response**](GetWebTransactionsTests200Response.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_web_transactions_test** +> GetWebTransactionsTest200Response update_web_transactions_test(test_id, update_web_transaction_test, aid=aid, expand=expand) + +Update Web Transactions test + +Updates a Web Transactions test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import tests_api +from tests_api.models.expand import Expand +from tests_api.models.get_web_transactions_test200_response import GetWebTransactionsTest200Response +from tests_api.models.update_web_transaction_test import UpdateWebTransactionTest +from tests_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 = tests_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 = tests_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with tests_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tests_api.WebTransactionApi(api_client) + test_id = '281474976710706' # str | ID of the test + update_web_transaction_test = tests_api.UpdateWebTransactionTest() # UpdateWebTransactionTest | + 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 = [tests_api.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update Web Transactions test + api_response = api_instance.update_web_transactions_test(test_id, update_web_transaction_test, aid=aid, expand=expand) + print("The response of WebTransactionApi->update_web_transactions_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionApi->update_web_transactions_test: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the test | + **update_web_transaction_test** | [**UpdateWebTransactionTest**](UpdateWebTransactionTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**GetWebTransactionsTest200Response**](GetWebTransactionsTest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/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) + diff --git a/tests_api/docs/WebTransactionInstantTest.md b/tests_api/docs/WebTransactionInstantTest.md new file mode 100644 index 00000000..4cecb70b --- /dev/null +++ b/tests_api/docs/WebTransactionInstantTest.md @@ -0,0 +1,77 @@ +# WebTransactionInstantTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Verify content using a regular expression. This field does not require escaping. | [optional] +**credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**target_time** | **int** | Target time for completion, defaults to 50% of time limit specified in seconds. | [optional] +**time_limit** | **int** | Time limit for transaction in seconds. | [optional] [default to 30] +**transaction_script** | **str** | JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ). | +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] + +## Example + +```python +from tests_api.models.web_transaction_instant_test import WebTransactionInstantTest + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionInstantTest from a JSON string +web_transaction_instant_test_instance = WebTransactionInstantTest.from_json(json) +# print the JSON string representation of the object +print WebTransactionInstantTest.to_json() + +# convert the object into a dict +web_transaction_instant_test_dict = web_transaction_instant_test_instance.to_dict() +# create an instance of WebTransactionInstantTest from a dict +web_transaction_instant_test_form_dict = web_transaction_instant_test.from_dict(web_transaction_instant_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/WebTransactionTest.md b/tests_api/docs/WebTransactionTest.md new file mode 100644 index 00000000..3c4a8077 --- /dev/null +++ b/tests_api/docs/WebTransactionTest.md @@ -0,0 +1,84 @@ +# WebTransactionTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**UnexpandedInstantTestLinks**](UnexpandedInstantTestLinks.md) | | [optional] +**labels** | [**List[TestLabelsInner]**](TestLabelsInner.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[TestSharedAccountsInner]**](TestSharedAccountsInner.md) | | [optional] [readonly] +**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Verify content using a regular expression. This field does not require escaping. | [optional] +**credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false. | [optional] [default to True] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**target_time** | **int** | Target time for completion, defaults to 50% of time limit specified in seconds. | [optional] +**time_limit** | **int** | Time limit for transaction in seconds. | [optional] [default to 30] +**transaction_script** | **str** | JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ). | +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**subinterval** | [**TestSubInterval**](TestSubInterval.md) | | [optional] + +## Example + +```python +from tests_api.models.web_transaction_test import WebTransactionTest + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionTest from a JSON string +web_transaction_test_instance = WebTransactionTest.from_json(json) +# print the JSON string representation of the object +print WebTransactionTest.to_json() + +# convert the object into a dict +web_transaction_test_dict = web_transaction_test_instance.to_dict() +# create an instance of WebTransactionTest from a dict +web_transaction_test_form_dict = web_transaction_test.from_dict(web_transaction_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/docs/WebTransactionTests.md b/tests_api/docs/WebTransactionTests.md new file mode 100644 index 00000000..35925529 --- /dev/null +++ b/tests_api/docs/WebTransactionTests.md @@ -0,0 +1,28 @@ +# WebTransactionTests + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tests** | [**List[WebTransactionTest]**](WebTransactionTest.md) | | [optional] + +## Example + +```python +from tests_api.models.web_transaction_tests import WebTransactionTests + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionTests from a JSON string +web_transaction_tests_instance = WebTransactionTests.from_json(json) +# print the JSON string representation of the object +print WebTransactionTests.to_json() + +# convert the object into a dict +web_transaction_tests_dict = web_transaction_tests_instance.to_dict() +# create an instance of WebTransactionTests from a dict +web_transaction_tests_form_dict = web_transaction_tests.from_dict(web_transaction_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tests_api/git_push.sh b/tests_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/tests_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/tests_api/pyproject.toml b/tests_api/pyproject.toml new file mode 100644 index 00000000..b16d7f47 --- /dev/null +++ b/tests_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "tests_api" +version = "1.0.0" +description = "Tests API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Tests API"] +include = ["tests_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/tests_api/requirements.txt b/tests_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/tests_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/tests_api/setup.cfg b/tests_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/tests_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/tests_api/setup.py b/tests_api/setup.py new file mode 100644 index 00000000..6a2a08be --- /dev/null +++ b/tests_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "tests-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Tests API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Tests API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + """, # noqa: E501 + package_data={"tests_api": ["py.typed"]}, +) diff --git a/tests_api/test-requirements.txt b/tests_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/tests_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/tests_api/test/__init__.py b/tests_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests_api/test/test_agent.py b/tests_api/test/test_agent.py new file mode 100644 index 00000000..8a0017e7 --- /dev/null +++ b/tests_api/test/test_agent.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.agent import Agent + +class TestAgent(unittest.TestCase): + """Agent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Agent: + """Test Agent + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Agent` + """ + model = Agent() + if include_optional: + return Agent( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + agent_type = 'enterprise-cluster', + location = 'San Francisco Bay Area', + country_id = 'US', + enabled = True, + verify_ssl_certificates = True + ) + else: + return Agent( + ) + """ + + def testAgent(self): + """Test Agent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_agent_base.py b/tests_api/test/test_agent_base.py new file mode 100644 index 00000000..6ca989c8 --- /dev/null +++ b/tests_api/test/test_agent_base.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.agent_base import AgentBase + +class TestAgentBase(unittest.TestCase): + """AgentBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentBase: + """Test AgentBase + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentBase` + """ + model = AgentBase() + if include_optional: + return AgentBase( + ip_addresses = ["99.139.65.220","99.139.65.221"], + public_ip_addresses = ["192.168.1.78","192.168.1.79"], + network = 'AT&T Services, Inc. (AS 7018)' + ) + else: + return AgentBase( + ) + """ + + def testAgentBase(self): + """Test AgentBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_agent_to_agent_api.py b/tests_api/test/test_agent_to_agent_api.py new file mode 100644 index 00000000..5ad4514c --- /dev/null +++ b/tests_api/test/test_agent_to_agent_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.agent_to_agent_api import AgentToAgentApi + + +class TestAgentToAgentApi(unittest.TestCase): + """AgentToAgentApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentToAgentApi() + + def tearDown(self) -> None: + pass + + def test_create_agent_to_agent_test(self) -> None: + """Test case for create_agent_to_agent_test + + Create Agent to Agent test + """ + pass + + def test_delete_agent_to_agent_test(self) -> None: + """Test case for delete_agent_to_agent_test + + Delete Agent to Agent test + """ + pass + + def test_get_agent_to_agent_test(self) -> None: + """Test case for get_agent_to_agent_test + + Get Agent to Agent test + """ + pass + + def test_get_agent_to_agent_tests(self) -> None: + """Test case for get_agent_to_agent_tests + + List Agent to Agent tests + """ + pass + + def test_update_agent_to_agent_test(self) -> None: + """Test case for update_agent_to_agent_test + + Update Agent to Agent test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_agent_to_agent_instant_test.py b/tests_api/test/test_agent_to_agent_instant_test.py new file mode 100644 index 00000000..333c24d9 --- /dev/null +++ b/tests_api/test/test_agent_to_agent_instant_test.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.agent_to_agent_instant_test import AgentToAgentInstantTest + +class TestAgentToAgentInstantTest(unittest.TestCase): + """AgentToAgentInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentToAgentInstantTest: + """Test AgentToAgentInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentToAgentInstantTest` + """ + model = AgentToAgentInstantTest() + if include_optional: + return AgentToAgentInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-agent', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + direction = 'to-target', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + mss = 20, + num_path_traces = 3, + path_trace_mode = 'classic', + port = 1, + protocol = 'tcp', + target_agent_id = '2954', + throughput_measurements = True, + throughput_duration = 5000, + throughput_rate = 8, + fixed_packet_rate = 50 + ) + else: + return AgentToAgentInstantTest( + agents = [ + tests_api.models.agent.Agent() + ], + target_agent_id = '2954', + ) + """ + + def testAgentToAgentInstantTest(self): + """Test AgentToAgentInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_agent_to_agent_test.py b/tests_api/test/test_agent_to_agent_test.py new file mode 100644 index 00000000..2dc4781c --- /dev/null +++ b/tests_api/test/test_agent_to_agent_test.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.agent_to_agent_test import AgentToAgentTest + +class TestAgentToAgentTest(unittest.TestCase): + """AgentToAgentTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentToAgentTest: + """Test AgentToAgentTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentToAgentTest` + """ + model = AgentToAgentTest() + if include_optional: + return AgentToAgentTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-agent', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + direction = 'to-target', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + mss = 20, + num_path_traces = 3, + path_trace_mode = 'classic', + port = 1, + protocol = 'tcp', + target_agent_id = '2954', + throughput_measurements = True, + throughput_duration = 5000, + throughput_rate = 8, + fixed_packet_rate = 50, + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ] + ) + else: + return AgentToAgentTest( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + target_agent_id = '2954', + ) + """ + + def testAgentToAgentTest(self): + """Test AgentToAgentTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_agent_to_agent_test_protocol.py b/tests_api/test/test_agent_to_agent_test_protocol.py new file mode 100644 index 00000000..f0f59da8 --- /dev/null +++ b/tests_api/test/test_agent_to_agent_test_protocol.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol + +class TestAgentToAgentTestProtocol(unittest.TestCase): + """AgentToAgentTestProtocol unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAgentToAgentTestProtocol(self): + """Test AgentToAgentTestProtocol""" + # inst = AgentToAgentTestProtocol() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_agent_to_agent_tests.py b/tests_api/test/test_agent_to_agent_tests.py new file mode 100644 index 00000000..9b1f2a92 --- /dev/null +++ b/tests_api/test/test_agent_to_agent_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.agent_to_agent_tests import AgentToAgentTests + +class TestAgentToAgentTests(unittest.TestCase): + """AgentToAgentTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentToAgentTests: + """Test AgentToAgentTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentToAgentTests` + """ + model = AgentToAgentTests() + if include_optional: + return AgentToAgentTests( + tests = [ + null + ] + ) + else: + return AgentToAgentTests( + ) + """ + + def testAgentToAgentTests(self): + """Test AgentToAgentTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_agent_to_server_api.py b/tests_api/test/test_agent_to_server_api.py new file mode 100644 index 00000000..91dbbf93 --- /dev/null +++ b/tests_api/test/test_agent_to_server_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.agent_to_server_api import AgentToServerApi + + +class TestAgentToServerApi(unittest.TestCase): + """AgentToServerApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentToServerApi() + + def tearDown(self) -> None: + pass + + def test_create_agent_to_server_test(self) -> None: + """Test case for create_agent_to_server_test + + Create Agent to Server test + """ + pass + + def test_delete_agent_to_server_test(self) -> None: + """Test case for delete_agent_to_server_test + + Delete Agent to Server test + """ + pass + + def test_get_agent_to_server_test(self) -> None: + """Test case for get_agent_to_server_test + + Get Agent to Server test + """ + pass + + def test_get_agent_to_server_tests(self) -> None: + """Test case for get_agent_to_server_tests + + List Agent to Server tests + """ + pass + + def test_update_agent_to_server_test(self) -> None: + """Test case for update_agent_to_server_test + + Update Agent to Server test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_agent_to_server_instant_test.py b/tests_api/test/test_agent_to_server_instant_test.py new file mode 100644 index 00000000..7bc1b36e --- /dev/null +++ b/tests_api/test/test_agent_to_server_instant_test.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.agent_to_server_instant_test import AgentToServerInstantTest + +class TestAgentToServerInstantTest(unittest.TestCase): + """AgentToServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentToServerInstantTest: + """Test AgentToServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentToServerInstantTest` + """ + model = AgentToServerInstantTest() + if include_optional: + return AgentToServerInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + bandwidth_measurements = True, + continuous_mode = False, + fixed_packet_rate = 25, + mtu_measurements = False, + num_path_traces = 3, + path_trace_mode = 'classic', + port = 1, + probe_mode = 'auto', + protocol = 'tcp', + server = 'www.thousandeyes.com', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + ipv6_policy = 'use-agent-policy', + ping_payload_size = 0, + network_measurements = True + ) + else: + return AgentToServerInstantTest( + agents = [ + tests_api.models.agent.Agent() + ], + server = 'www.thousandeyes.com', + ) + """ + + def testAgentToServerInstantTest(self): + """Test AgentToServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_agent_to_server_test.py b/tests_api/test/test_agent_to_server_test.py new file mode 100644 index 00000000..966abe57 --- /dev/null +++ b/tests_api/test/test_agent_to_server_test.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.agent_to_server_test import AgentToServerTest + +class TestAgentToServerTest(unittest.TestCase): + """AgentToServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentToServerTest: + """Test AgentToServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentToServerTest` + """ + model = AgentToServerTest() + if include_optional: + return AgentToServerTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + bandwidth_measurements = True, + continuous_mode = False, + fixed_packet_rate = 25, + mtu_measurements = False, + num_path_traces = 3, + path_trace_mode = 'classic', + port = 1, + probe_mode = 'auto', + protocol = 'tcp', + server = 'www.thousandeyes.com', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + ipv6_policy = 'use-agent-policy', + ping_payload_size = 0, + network_measurements = True, + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ] + ) + else: + return AgentToServerTest( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + server = 'www.thousandeyes.com', + ) + """ + + def testAgentToServerTest(self): + """Test AgentToServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_agent_to_server_tests.py b/tests_api/test/test_agent_to_server_tests.py new file mode 100644 index 00000000..de4d2d43 --- /dev/null +++ b/tests_api/test/test_agent_to_server_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.agent_to_server_tests import AgentToServerTests + +class TestAgentToServerTests(unittest.TestCase): + """AgentToServerTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentToServerTests: + """Test AgentToServerTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentToServerTests` + """ + model = AgentToServerTests() + if include_optional: + return AgentToServerTests( + tests = [ + null + ] + ) + else: + return AgentToServerTests( + ) + """ + + def testAgentToServerTests(self): + """Test AgentToServerTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_alert_rounds_violation_mode.py b/tests_api/test/test_alert_rounds_violation_mode.py new file mode 100644 index 00000000..0505b486 --- /dev/null +++ b/tests_api/test/test_alert_rounds_violation_mode.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.alert_rounds_violation_mode import AlertRoundsViolationMode + +class TestAlertRoundsViolationMode(unittest.TestCase): + """AlertRoundsViolationMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAlertRoundsViolationMode(self): + """Test AlertRoundsViolationMode""" + # inst = AlertRoundsViolationMode() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_alert_rule.py b/tests_api/test/test_alert_rule.py new file mode 100644 index 00000000..edbc3269 --- /dev/null +++ b/tests_api/test/test_alert_rule.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.alert_rule import AlertRule + +class TestAlertRule(unittest.TestCase): + """AlertRule unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AlertRule: + """Test AlertRule + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AlertRule` + """ + model = AlertRule() + if include_optional: + return AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2 + ) + else: + return AlertRule( + ) + """ + + def testAlertRule(self): + """Test AlertRule""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_alert_type.py b/tests_api/test/test_alert_type.py new file mode 100644 index 00000000..de53acf2 --- /dev/null +++ b/tests_api/test/test_alert_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.alert_type import AlertType + +class TestAlertType(unittest.TestCase): + """AlertType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAlertType(self): + """Test AlertType""" + # inst = AlertType() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_all_test_types_api.py b/tests_api/test/test_all_test_types_api.py new file mode 100644 index 00000000..64a54125 --- /dev/null +++ b/tests_api/test/test_all_test_types_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.all_test_types_api import AllTestTypesApi + + +class TestAllTestTypesApi(unittest.TestCase): + """AllTestTypesApi unit test stubs""" + + def setUp(self) -> None: + self.api = AllTestTypesApi() + + def tearDown(self) -> None: + pass + + def test_get_tests(self) -> None: + """Test case for get_tests + + List configured tests + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_base_request.py b/tests_api/test/test_base_request.py new file mode 100644 index 00000000..e6e8946d --- /dev/null +++ b/tests_api/test/test_base_request.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.base_request import BaseRequest + +class TestBaseRequest(unittest.TestCase): + """BaseRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseRequest: + """Test BaseRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BaseRequest` + """ + model = BaseRequest() + if include_optional: + return BaseRequest( + labels = ["9842","1283"], + shared_with_accounts = ["2087","100"], + alert_rules = ["344753","212697"] + ) + else: + return BaseRequest( + ) + """ + + def testBaseRequest(self): + """Test BaseRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_base_test.py b/tests_api/test/test_base_test.py new file mode 100644 index 00000000..d227f41a --- /dev/null +++ b/tests_api/test/test_base_test.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.base_test import BaseTest + +class TestBaseTest(unittest.TestCase): + """BaseTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseTest: + """Test BaseTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BaseTest` + """ + model = BaseTest() + if include_optional: + return BaseTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ] + ) + else: + return BaseTest( + ) + """ + + def testBaseTest(self): + """Test BaseTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_bgp_api.py b/tests_api/test/test_bgp_api.py new file mode 100644 index 00000000..abd9bea6 --- /dev/null +++ b/tests_api/test/test_bgp_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.bgp_api import BGPApi + + +class TestBGPApi(unittest.TestCase): + """BGPApi unit test stubs""" + + def setUp(self) -> None: + self.api = BGPApi() + + def tearDown(self) -> None: + pass + + def test_create_bgp_test(self) -> None: + """Test case for create_bgp_test + + Create BGP test + """ + pass + + def test_delete_bgp_test(self) -> None: + """Test case for delete_bgp_test + + Delete BGP test + """ + pass + + def test_get_bgp_test(self) -> None: + """Test case for get_bgp_test + + Get BGP test + """ + pass + + def test_get_bgp_tests(self) -> None: + """Test case for get_bgp_tests + + List BGP tests + """ + pass + + def test_update_bgp_test(self) -> None: + """Test case for update_bgp_test + + Update BGP test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_bgp_test.py b/tests_api/test/test_bgp_test.py new file mode 100644 index 00000000..f6d970b8 --- /dev/null +++ b/tests_api/test/test_bgp_test.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.bgp_test import BgpTest + +class TestBgpTest(unittest.TestCase): + """BgpTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpTest: + """Test BgpTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BgpTest` + """ + model = BgpTest() + if include_optional: + return BgpTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'bgp', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ], + include_covered_prefixes = True, + prefix = '', + use_public_bgp = False, + alerts_enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ] + ) + else: + return BgpTest( + prefix = '', + ) + """ + + def testBgpTest(self): + """Test BgpTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_bgp_tests.py b/tests_api/test/test_bgp_tests.py new file mode 100644 index 00000000..ee18e7f8 --- /dev/null +++ b/tests_api/test/test_bgp_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.bgp_tests import BgpTests + +class TestBgpTests(unittest.TestCase): + """BgpTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpTests: + """Test BgpTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BgpTests` + """ + model = BgpTests() + if include_optional: + return BgpTests( + tests = [ + null + ] + ) + else: + return BgpTests( + ) + """ + + def testBgpTests(self): + """Test BgpTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_cloud_enterprise_agent_type.py b/tests_api/test/test_cloud_enterprise_agent_type.py new file mode 100644 index 00000000..db040d0a --- /dev/null +++ b/tests_api/test/test_cloud_enterprise_agent_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType + +class TestCloudEnterpriseAgentType(unittest.TestCase): + """CloudEnterpriseAgentType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCloudEnterpriseAgentType(self): + """Test CloudEnterpriseAgentType""" + # inst = CloudEnterpriseAgentType() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_dns_query_class.py b/tests_api/test/test_dns_query_class.py new file mode 100644 index 00000000..fc077893 --- /dev/null +++ b/tests_api/test/test_dns_query_class.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.dns_query_class import DnsQueryClass + +class TestDnsQueryClass(unittest.TestCase): + """DnsQueryClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDnsQueryClass(self): + """Test DnsQueryClass""" + # inst = DnsQueryClass() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_dns_sec_instant_test.py b/tests_api/test/test_dns_sec_instant_test.py new file mode 100644 index 00000000..1f517d2f --- /dev/null +++ b/tests_api/test/test_dns_sec_instant_test.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.dns_sec_instant_test import DnsSecInstantTest + +class TestDnsSecInstantTest(unittest.TestCase): + """DnsSecInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsSecInstantTest: + """Test DnsSecInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsSecInstantTest` + """ + model = DnsSecInstantTest() + if include_optional: + return DnsSecInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dnssec', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + domain = 'www.thousandeyes.com', + dns_query_class = 'in' + ) + else: + return DnsSecInstantTest( + agents = [ + tests_api.models.agent.Agent() + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testDnsSecInstantTest(self): + """Test DnsSecInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_dns_sec_test.py b/tests_api/test/test_dns_sec_test.py new file mode 100644 index 00000000..a6c9e4d0 --- /dev/null +++ b/tests_api/test/test_dns_sec_test.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.dns_sec_test import DnsSecTest + +class TestDnsSecTest(unittest.TestCase): + """DnsSecTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsSecTest: + """Test DnsSecTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsSecTest` + """ + model = DnsSecTest() + if include_optional: + return DnsSecTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dnssec', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + domain = 'www.thousandeyes.com', + dns_query_class = 'in' + ) + else: + return DnsSecTest( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testDnsSecTest(self): + """Test DnsSecTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_dns_sec_tests.py b/tests_api/test/test_dns_sec_tests.py new file mode 100644 index 00000000..fe535a5a --- /dev/null +++ b/tests_api/test/test_dns_sec_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.dns_sec_tests import DnsSecTests + +class TestDnsSecTests(unittest.TestCase): + """DnsSecTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsSecTests: + """Test DnsSecTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsSecTests` + """ + model = DnsSecTests() + if include_optional: + return DnsSecTests( + tests = [ + null + ] + ) + else: + return DnsSecTests( + ) + """ + + def testDnsSecTests(self): + """Test DnsSecTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_dns_server_api.py b/tests_api/test/test_dns_server_api.py new file mode 100644 index 00000000..be5aa481 --- /dev/null +++ b/tests_api/test/test_dns_server_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.dns_server_api import DNSServerApi + + +class TestDNSServerApi(unittest.TestCase): + """DNSServerApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSServerApi() + + def tearDown(self) -> None: + pass + + def test_create_dns_server_test(self) -> None: + """Test case for create_dns_server_test + + Create DNS Server test + """ + pass + + def test_delete_dns_server_test(self) -> None: + """Test case for delete_dns_server_test + + Delete DNS Server test + """ + pass + + def test_get_dns_server_test(self) -> None: + """Test case for get_dns_server_test + + Get DNS Server test + """ + pass + + def test_get_dns_server_tests(self) -> None: + """Test case for get_dns_server_tests + + List DNS Server tests + """ + pass + + def test_update_dns_server_test(self) -> None: + """Test case for update_dns_server_test + + Update DNS Server test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_dns_server_instant_test.py b/tests_api/test/test_dns_server_instant_test.py new file mode 100644 index 00000000..a9dee31f --- /dev/null +++ b/tests_api/test/test_dns_server_instant_test.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.dns_server_instant_test import DnsServerInstantTest + +class TestDnsServerInstantTest(unittest.TestCase): + """DnsServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsServerInstantTest: + """Test DnsServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsServerInstantTest` + """ + model = DnsServerInstantTest() + if include_optional: + return DnsServerInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dns-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + bandwidth_measurements = True, + dns_servers = [ + tests_api.models.test_dns_server.TestDnsServer( + server_id = '1447', + server_name = 'dns-example.net', ) + ], + dns_transport_protocol = 'udp', + domain = 'www.thousandeyes.com', + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + recursive_queries = True, + ipv6_policy = 'use-agent-policy', + fixed_packet_rate = 50, + dns_query_class = 'in' + ) + else: + return DnsServerInstantTest( + agents = [ + tests_api.models.agent.Agent() + ], + dns_servers = [ + tests_api.models.test_dns_server.TestDnsServer( + server_id = '1447', + server_name = 'dns-example.net', ) + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testDnsServerInstantTest(self): + """Test DnsServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_dns_server_test.py b/tests_api/test/test_dns_server_test.py new file mode 100644 index 00000000..6a63790a --- /dev/null +++ b/tests_api/test/test_dns_server_test.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.dns_server_test import DnsServerTest + +class TestDnsServerTest(unittest.TestCase): + """DnsServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsServerTest: + """Test DnsServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsServerTest` + """ + model = DnsServerTest() + if include_optional: + return DnsServerTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dns-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + bandwidth_measurements = True, + dns_servers = [ + tests_api.models.test_dns_server.TestDnsServer( + server_id = '1447', + server_name = 'dns-example.net', ) + ], + dns_transport_protocol = 'udp', + domain = 'www.thousandeyes.com', + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + recursive_queries = True, + ipv6_policy = 'use-agent-policy', + fixed_packet_rate = 50, + dns_query_class = 'in', + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ] + ) + else: + return DnsServerTest( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + dns_servers = [ + tests_api.models.test_dns_server.TestDnsServer( + server_id = '1447', + server_name = 'dns-example.net', ) + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testDnsServerTest(self): + """Test DnsServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_dns_server_tests.py b/tests_api/test/test_dns_server_tests.py new file mode 100644 index 00000000..12c2d5ca --- /dev/null +++ b/tests_api/test/test_dns_server_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.dns_server_tests import DnsServerTests + +class TestDnsServerTests(unittest.TestCase): + """DnsServerTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsServerTests: + """Test DnsServerTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsServerTests` + """ + model = DnsServerTests() + if include_optional: + return DnsServerTests( + tests = [ + null + ] + ) + else: + return DnsServerTests( + ) + """ + + def testDnsServerTests(self): + """Test DnsServerTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_dns_trace_api.py b/tests_api/test/test_dns_trace_api.py new file mode 100644 index 00000000..6e6eed59 --- /dev/null +++ b/tests_api/test/test_dns_trace_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.dns_trace_api import DNSTraceApi + + +class TestDNSTraceApi(unittest.TestCase): + """DNSTraceApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSTraceApi() + + def tearDown(self) -> None: + pass + + def test_create_dns_trace_test(self) -> None: + """Test case for create_dns_trace_test + + Create DNS Trace test + """ + pass + + def test_delete_dns_trace_test(self) -> None: + """Test case for delete_dns_trace_test + + Delete DNS Trace test + """ + pass + + def test_get_dns_trace_test(self) -> None: + """Test case for get_dns_trace_test + + Get DNS Trace test + """ + pass + + def test_get_dns_trace_tests(self) -> None: + """Test case for get_dns_trace_tests + + List DNS Trace tests + """ + pass + + def test_update_dns_trace_test(self) -> None: + """Test case for update_dns_trace_test + + Update DNS Trace test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_dns_trace_instant_test.py b/tests_api/test/test_dns_trace_instant_test.py new file mode 100644 index 00000000..321b78d5 --- /dev/null +++ b/tests_api/test/test_dns_trace_instant_test.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.dns_trace_instant_test import DnsTraceInstantTest + +class TestDnsTraceInstantTest(unittest.TestCase): + """DnsTraceInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsTraceInstantTest: + """Test DnsTraceInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsTraceInstantTest` + """ + model = DnsTraceInstantTest() + if include_optional: + return DnsTraceInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dns-trace', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + dns_transport_protocol = 'udp', + domain = 'www.thousandeyes.com', + dns_query_class = 'in' + ) + else: + return DnsTraceInstantTest( + agents = [ + tests_api.models.agent.Agent() + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testDnsTraceInstantTest(self): + """Test DnsTraceInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_dns_trace_test.py b/tests_api/test/test_dns_trace_test.py new file mode 100644 index 00000000..ba3f206f --- /dev/null +++ b/tests_api/test/test_dns_trace_test.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.dns_trace_test import DnsTraceTest + +class TestDnsTraceTest(unittest.TestCase): + """DnsTraceTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsTraceTest: + """Test DnsTraceTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsTraceTest` + """ + model = DnsTraceTest() + if include_optional: + return DnsTraceTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dns-trace', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + dns_transport_protocol = 'udp', + domain = 'www.thousandeyes.com', + dns_query_class = 'in' + ) + else: + return DnsTraceTest( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testDnsTraceTest(self): + """Test DnsTraceTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_dns_trace_tests.py b/tests_api/test/test_dns_trace_tests.py new file mode 100644 index 00000000..f00c0615 --- /dev/null +++ b/tests_api/test/test_dns_trace_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.dns_trace_tests import DnsTraceTests + +class TestDnsTraceTests(unittest.TestCase): + """DnsTraceTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DnsTraceTests: + """Test DnsTraceTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DnsTraceTests` + """ + model = DnsTraceTests() + if include_optional: + return DnsTraceTests( + tests = [ + null + ] + ) + else: + return DnsTraceTests( + ) + """ + + def testDnsTraceTests(self): + """Test DnsTraceTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_dnssec_api.py b/tests_api/test/test_dnssec_api.py new file mode 100644 index 00000000..5fa0bf54 --- /dev/null +++ b/tests_api/test/test_dnssec_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.dnssec_api import DNSSECApi + + +class TestDNSSECApi(unittest.TestCase): + """DNSSECApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSSECApi() + + def tearDown(self) -> None: + pass + + def test_create_dns_sec_test(self) -> None: + """Test case for create_dns_sec_test + + Create DNSSEC test + """ + pass + + def test_delete_dns_sec_test(self) -> None: + """Test case for delete_dns_sec_test + + Delete DNSSEC test + """ + pass + + def test_get_dns_sec_test(self) -> None: + """Test case for get_dns_sec_test + + Get DNSSEC test + """ + pass + + def test_get_dns_sec_tests(self) -> None: + """Test case for get_dns_sec_tests + + List DNS Sec tests + """ + pass + + def test_update_dns_sec_test(self) -> None: + """Test case for update_dns_sec_test + + Update DNSSEC test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_error.py b/tests_api/test/test_error.py new file mode 100644 index 00000000..57f7a90c --- /dev/null +++ b/tests_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_expand.py b/tests_api/test/test_expand.py new file mode 100644 index 00000000..ced8ff55 --- /dev/null +++ b/tests_api/test/test_expand.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.expand import Expand + +class TestExpand(unittest.TestCase): + """Expand unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testExpand(self): + """Test Expand""" + # inst = Expand() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_ftp_server_api.py b/tests_api/test/test_ftp_server_api.py new file mode 100644 index 00000000..1827f6b2 --- /dev/null +++ b/tests_api/test/test_ftp_server_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.ftp_server_api import FTPServerApi + + +class TestFTPServerApi(unittest.TestCase): + """FTPServerApi unit test stubs""" + + def setUp(self) -> None: + self.api = FTPServerApi() + + def tearDown(self) -> None: + pass + + def test_create_ftp_server_test(self) -> None: + """Test case for create_ftp_server_test + + Create FTP Server test + """ + pass + + def test_delete_ftp_server_test(self) -> None: + """Test case for delete_ftp_server_test + + Delete FTP Server test + """ + pass + + def test_get_ftp_server_test(self) -> None: + """Test case for get_ftp_server_test + + Get FTP Server test + """ + pass + + def test_get_ftp_server_tests(self) -> None: + """Test case for get_ftp_server_tests + + List FTP Server tests + """ + pass + + def test_update_ftp_server_test(self) -> None: + """Test case for update_ftp_server_test + + Update FTP Server test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_ftp_server_instant_test.py b/tests_api/test/test_ftp_server_instant_test.py new file mode 100644 index 00000000..f28de9be --- /dev/null +++ b/tests_api/test/test_ftp_server_instant_test.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.ftp_server_instant_test import FtpServerInstantTest + +class TestFtpServerInstantTest(unittest.TestCase): + """FtpServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FtpServerInstantTest: + """Test FtpServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FtpServerInstantTest` + """ + model = FtpServerInstantTest() + if include_optional: + return FtpServerInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'ftp-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + bandwidth_measurements = True, + download_limit = 1048576, + ftp_target_time = 1000, + ftp_time_limit = 10, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + request_type = 'download', + url = 'www.thousandeyes.com', + use_active_ftp = True, + use_explicit_ftps = False, + username = 'username', + fixed_packet_rate = 50, + ipv6_policy = 'use-agent-policy' + ) + else: + return FtpServerInstantTest( + agents = [ + tests_api.models.agent.Agent() + ], + password = 'password', + request_type = 'download', + url = 'www.thousandeyes.com', + username = 'username', + ) + """ + + def testFtpServerInstantTest(self): + """Test FtpServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_ftp_server_request_type.py b/tests_api/test/test_ftp_server_request_type.py new file mode 100644 index 00000000..cb577212 --- /dev/null +++ b/tests_api/test/test_ftp_server_request_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.ftp_server_request_type import FtpServerRequestType + +class TestFtpServerRequestType(unittest.TestCase): + """FtpServerRequestType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFtpServerRequestType(self): + """Test FtpServerRequestType""" + # inst = FtpServerRequestType() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_ftp_server_test.py b/tests_api/test/test_ftp_server_test.py new file mode 100644 index 00000000..cb384f54 --- /dev/null +++ b/tests_api/test/test_ftp_server_test.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.ftp_server_test import FtpServerTest + +class TestFtpServerTest(unittest.TestCase): + """FtpServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FtpServerTest: + """Test FtpServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FtpServerTest` + """ + model = FtpServerTest() + if include_optional: + return FtpServerTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'ftp-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + bandwidth_measurements = True, + download_limit = 1048576, + ftp_target_time = 1000, + ftp_time_limit = 10, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + request_type = 'download', + url = 'www.thousandeyes.com', + use_active_ftp = True, + use_explicit_ftps = False, + username = 'username', + fixed_packet_rate = 50, + ipv6_policy = 'use-agent-policy', + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ] + ) + else: + return FtpServerTest( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + password = 'password', + request_type = 'download', + url = 'www.thousandeyes.com', + username = 'username', + ) + """ + + def testFtpServerTest(self): + """Test FtpServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_ftp_server_tests.py b/tests_api/test/test_ftp_server_tests.py new file mode 100644 index 00000000..0cdd2def --- /dev/null +++ b/tests_api/test/test_ftp_server_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.ftp_server_tests import FtpServerTests + +class TestFtpServerTests(unittest.TestCase): + """FtpServerTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FtpServerTests: + """Test FtpServerTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FtpServerTests` + """ + model = FtpServerTests() + if include_optional: + return FtpServerTests( + tests = [ + null + ] + ) + else: + return FtpServerTests( + ) + """ + + def testFtpServerTests(self): + """Test FtpServerTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_agent_to_agent_test200_response.py b/tests_api/test/test_get_agent_to_agent_test200_response.py new file mode 100644 index 00000000..d0539c32 --- /dev/null +++ b/tests_api/test/test_get_agent_to_agent_test200_response.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_agent_to_agent_test200_response import GetAgentToAgentTest200Response + +class TestGetAgentToAgentTest200Response(unittest.TestCase): + """GetAgentToAgentTest200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAgentToAgentTest200Response: + """Test GetAgentToAgentTest200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAgentToAgentTest200Response` + """ + model = GetAgentToAgentTest200Response() + if include_optional: + return GetAgentToAgentTest200Response( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-agent', + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + direction = 'to-target', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + mss = 20, + num_path_traces = 3, + path_trace_mode = 'classic', + port = 1, + protocol = 'tcp', + target_agent_id = '2954', + throughput_measurements = True, + throughput_duration = 5000, + throughput_rate = 8, + fixed_packet_rate = 50, + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ] + ) + else: + return GetAgentToAgentTest200Response( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + target_agent_id = '2954', + ) + """ + + def testGetAgentToAgentTest200Response(self): + """Test GetAgentToAgentTest200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_agent_to_agent_tests200_response.py b/tests_api/test/test_get_agent_to_agent_tests200_response.py new file mode 100644 index 00000000..2bc6e2a3 --- /dev/null +++ b/tests_api/test/test_get_agent_to_agent_tests200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_agent_to_agent_tests200_response import GetAgentToAgentTests200Response + +class TestGetAgentToAgentTests200Response(unittest.TestCase): + """GetAgentToAgentTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAgentToAgentTests200Response: + """Test GetAgentToAgentTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAgentToAgentTests200Response` + """ + model = GetAgentToAgentTests200Response() + if include_optional: + return GetAgentToAgentTests200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetAgentToAgentTests200Response( + ) + """ + + def testGetAgentToAgentTests200Response(self): + """Test GetAgentToAgentTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_agent_to_server_test200_response.py b/tests_api/test/test_get_agent_to_server_test200_response.py new file mode 100644 index 00000000..4b553085 --- /dev/null +++ b/tests_api/test/test_get_agent_to_server_test200_response.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_agent_to_server_test200_response import GetAgentToServerTest200Response + +class TestGetAgentToServerTest200Response(unittest.TestCase): + """GetAgentToServerTest200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAgentToServerTest200Response: + """Test GetAgentToServerTest200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAgentToServerTest200Response` + """ + model = GetAgentToServerTest200Response() + if include_optional: + return GetAgentToServerTest200Response( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + bandwidth_measurements = True, + continuous_mode = False, + fixed_packet_rate = 25, + mtu_measurements = False, + num_path_traces = 3, + path_trace_mode = 'classic', + port = 1, + probe_mode = 'auto', + protocol = 'tcp', + server = 'www.thousandeyes.com', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + ipv6_policy = 'use-agent-policy', + ping_payload_size = 0, + network_measurements = True, + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ] + ) + else: + return GetAgentToServerTest200Response( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + server = 'www.thousandeyes.com', + ) + """ + + def testGetAgentToServerTest200Response(self): + """Test GetAgentToServerTest200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_agent_to_server_tests200_response.py b/tests_api/test/test_get_agent_to_server_tests200_response.py new file mode 100644 index 00000000..ed9a29aa --- /dev/null +++ b/tests_api/test/test_get_agent_to_server_tests200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_agent_to_server_tests200_response import GetAgentToServerTests200Response + +class TestGetAgentToServerTests200Response(unittest.TestCase): + """GetAgentToServerTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAgentToServerTests200Response: + """Test GetAgentToServerTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAgentToServerTests200Response` + """ + model = GetAgentToServerTests200Response() + if include_optional: + return GetAgentToServerTests200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetAgentToServerTests200Response( + ) + """ + + def testGetAgentToServerTests200Response(self): + """Test GetAgentToServerTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_bgp_test200_response.py b/tests_api/test/test_get_bgp_test200_response.py new file mode 100644 index 00000000..597b6d50 --- /dev/null +++ b/tests_api/test/test_get_bgp_test200_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_bgp_test200_response import GetBgpTest200Response + +class TestGetBgpTest200Response(unittest.TestCase): + """GetBgpTest200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetBgpTest200Response: + """Test GetBgpTest200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetBgpTest200Response` + """ + model = GetBgpTest200Response() + if include_optional: + return GetBgpTest200Response( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'bgp', + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ], + include_covered_prefixes = True, + prefix = '', + use_public_bgp = False, + alerts_enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ] + ) + else: + return GetBgpTest200Response( + prefix = '', + ) + """ + + def testGetBgpTest200Response(self): + """Test GetBgpTest200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_bgp_tests200_response.py b/tests_api/test/test_get_bgp_tests200_response.py new file mode 100644 index 00000000..b4072974 --- /dev/null +++ b/tests_api/test/test_get_bgp_tests200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_bgp_tests200_response import GetBgpTests200Response + +class TestGetBgpTests200Response(unittest.TestCase): + """GetBgpTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetBgpTests200Response: + """Test GetBgpTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetBgpTests200Response` + """ + model = GetBgpTests200Response() + if include_optional: + return GetBgpTests200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetBgpTests200Response( + ) + """ + + def testGetBgpTests200Response(self): + """Test GetBgpTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_dns_sec_test200_response.py b/tests_api/test/test_get_dns_sec_test200_response.py new file mode 100644 index 00000000..f19df488 --- /dev/null +++ b/tests_api/test/test_get_dns_sec_test200_response.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_dns_sec_test200_response import GetDnsSecTest200Response + +class TestGetDnsSecTest200Response(unittest.TestCase): + """GetDnsSecTest200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDnsSecTest200Response: + """Test GetDnsSecTest200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetDnsSecTest200Response` + """ + model = GetDnsSecTest200Response() + if include_optional: + return GetDnsSecTest200Response( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dnssec', + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + domain = 'www.thousandeyes.com', + dns_query_class = 'in' + ) + else: + return GetDnsSecTest200Response( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testGetDnsSecTest200Response(self): + """Test GetDnsSecTest200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_dns_sec_tests200_response.py b/tests_api/test/test_get_dns_sec_tests200_response.py new file mode 100644 index 00000000..db28daff --- /dev/null +++ b/tests_api/test/test_get_dns_sec_tests200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_dns_sec_tests200_response import GetDnsSecTests200Response + +class TestGetDnsSecTests200Response(unittest.TestCase): + """GetDnsSecTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDnsSecTests200Response: + """Test GetDnsSecTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetDnsSecTests200Response` + """ + model = GetDnsSecTests200Response() + if include_optional: + return GetDnsSecTests200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetDnsSecTests200Response( + ) + """ + + def testGetDnsSecTests200Response(self): + """Test GetDnsSecTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_dns_server_test200_response.py b/tests_api/test/test_get_dns_server_test200_response.py new file mode 100644 index 00000000..9239f9c9 --- /dev/null +++ b/tests_api/test/test_get_dns_server_test200_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_dns_server_test200_response import GetDNSServerTest200Response + +class TestGetDNSServerTest200Response(unittest.TestCase): + """GetDNSServerTest200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDNSServerTest200Response: + """Test GetDNSServerTest200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetDNSServerTest200Response` + """ + model = GetDNSServerTest200Response() + if include_optional: + return GetDNSServerTest200Response( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dns-server', + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + bandwidth_measurements = True, + dns_servers = [ + tests_api.models.test_dns_server.TestDnsServer( + server_id = '1447', + server_name = 'dns-example.net', ) + ], + dns_transport_protocol = 'udp', + domain = 'www.thousandeyes.com', + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + recursive_queries = True, + ipv6_policy = 'use-agent-policy', + fixed_packet_rate = 50, + dns_query_class = 'in', + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ] + ) + else: + return GetDNSServerTest200Response( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + dns_servers = [ + tests_api.models.test_dns_server.TestDnsServer( + server_id = '1447', + server_name = 'dns-example.net', ) + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testGetDNSServerTest200Response(self): + """Test GetDNSServerTest200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_dns_server_tests200_response.py b/tests_api/test/test_get_dns_server_tests200_response.py new file mode 100644 index 00000000..834491fa --- /dev/null +++ b/tests_api/test/test_get_dns_server_tests200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_dns_server_tests200_response import GetDNSServerTests200Response + +class TestGetDNSServerTests200Response(unittest.TestCase): + """GetDNSServerTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDNSServerTests200Response: + """Test GetDNSServerTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetDNSServerTests200Response` + """ + model = GetDNSServerTests200Response() + if include_optional: + return GetDNSServerTests200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetDNSServerTests200Response( + ) + """ + + def testGetDNSServerTests200Response(self): + """Test GetDNSServerTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_dns_trace_test200_response.py b/tests_api/test/test_get_dns_trace_test200_response.py new file mode 100644 index 00000000..0f3aeba9 --- /dev/null +++ b/tests_api/test/test_get_dns_trace_test200_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_dns_trace_test200_response import GetDnsTraceTest200Response + +class TestGetDnsTraceTest200Response(unittest.TestCase): + """GetDnsTraceTest200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDnsTraceTest200Response: + """Test GetDnsTraceTest200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetDnsTraceTest200Response` + """ + model = GetDnsTraceTest200Response() + if include_optional: + return GetDnsTraceTest200Response( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dns-trace', + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + dns_transport_protocol = 'udp', + domain = 'www.thousandeyes.com', + dns_query_class = 'in' + ) + else: + return GetDnsTraceTest200Response( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testGetDnsTraceTest200Response(self): + """Test GetDnsTraceTest200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_dns_trace_tests200_response.py b/tests_api/test/test_get_dns_trace_tests200_response.py new file mode 100644 index 00000000..7335aea4 --- /dev/null +++ b/tests_api/test/test_get_dns_trace_tests200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_dns_trace_tests200_response import GetDnsTraceTests200Response + +class TestGetDnsTraceTests200Response(unittest.TestCase): + """GetDnsTraceTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetDnsTraceTests200Response: + """Test GetDnsTraceTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetDnsTraceTests200Response` + """ + model = GetDnsTraceTests200Response() + if include_optional: + return GetDnsTraceTests200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetDnsTraceTests200Response( + ) + """ + + def testGetDnsTraceTests200Response(self): + """Test GetDnsTraceTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_ftp_server_test200_response.py b/tests_api/test/test_get_ftp_server_test200_response.py new file mode 100644 index 00000000..0be7d130 --- /dev/null +++ b/tests_api/test/test_get_ftp_server_test200_response.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_ftp_server_test200_response import GetFtpServerTest200Response + +class TestGetFtpServerTest200Response(unittest.TestCase): + """GetFtpServerTest200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetFtpServerTest200Response: + """Test GetFtpServerTest200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetFtpServerTest200Response` + """ + model = GetFtpServerTest200Response() + if include_optional: + return GetFtpServerTest200Response( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'ftp-server', + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + bandwidth_measurements = True, + download_limit = 1048576, + ftp_target_time = 1000, + ftp_time_limit = 10, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + request_type = 'download', + url = 'www.thousandeyes.com', + use_active_ftp = True, + use_explicit_ftps = False, + username = 'username', + fixed_packet_rate = 50, + ipv6_policy = 'use-agent-policy', + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ] + ) + else: + return GetFtpServerTest200Response( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + password = 'password', + request_type = 'download', + url = 'www.thousandeyes.com', + username = 'username', + ) + """ + + def testGetFtpServerTest200Response(self): + """Test GetFtpServerTest200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_ftp_server_tests200_response.py b/tests_api/test/test_get_ftp_server_tests200_response.py new file mode 100644 index 00000000..40e0ba58 --- /dev/null +++ b/tests_api/test/test_get_ftp_server_tests200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_ftp_server_tests200_response import GetFtpServerTests200Response + +class TestGetFtpServerTests200Response(unittest.TestCase): + """GetFtpServerTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetFtpServerTests200Response: + """Test GetFtpServerTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetFtpServerTests200Response` + """ + model = GetFtpServerTests200Response() + if include_optional: + return GetFtpServerTests200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetFtpServerTests200Response( + ) + """ + + def testGetFtpServerTests200Response(self): + """Test GetFtpServerTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_http_server_test200_response.py b/tests_api/test/test_get_http_server_test200_response.py new file mode 100644 index 00000000..61a66515 --- /dev/null +++ b/tests_api/test/test_get_http_server_test200_response.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_http_server_test200_response import GetHttpServerTest200Response + +class TestGetHttpServerTest200Response(unittest.TestCase): + """GetHttpServerTest200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetHttpServerTest200Response: + """Test GetHttpServerTest200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetHttpServerTest200Response` + """ + model = GetHttpServerTest200Response() + if include_optional: + return GetHttpServerTest200Response( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'http-server', + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + headers = ["header1: value1","header2: value2"], + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + desired_status_code = '200', + download_limit = 2048, + dns_override = '8.8.8.8', + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + post_body = '{ "example" : "value"}', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + ipv6_policy = 'use-agent-policy', + follow_redirects = True, + fixed_packet_rate = 50, + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ] + ) + else: + return GetHttpServerTest200Response( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + url = 'www.thousandeyes.com', + ) + """ + + def testGetHttpServerTest200Response(self): + """Test GetHttpServerTest200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_http_server_tests200_response.py b/tests_api/test/test_get_http_server_tests200_response.py new file mode 100644 index 00000000..8db18501 --- /dev/null +++ b/tests_api/test/test_get_http_server_tests200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_http_server_tests200_response import GetHttpServerTests200Response + +class TestGetHttpServerTests200Response(unittest.TestCase): + """GetHttpServerTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetHttpServerTests200Response: + """Test GetHttpServerTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetHttpServerTests200Response` + """ + model = GetHttpServerTests200Response() + if include_optional: + return GetHttpServerTests200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetHttpServerTests200Response( + ) + """ + + def testGetHttpServerTests200Response(self): + """Test GetHttpServerTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_page_load_test200_response.py b/tests_api/test/test_get_page_load_test200_response.py new file mode 100644 index 00000000..6891c550 --- /dev/null +++ b/tests_api/test/test_get_page_load_test200_response.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_page_load_test200_response import GetPageLoadTest200Response + +class TestGetPageLoadTest200Response(unittest.TestCase): + """GetPageLoadTest200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetPageLoadTest200Response: + """Test GetPageLoadTest200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetPageLoadTest200Response` + """ + model = GetPageLoadTest200Response() + if include_optional: + return GetPageLoadTest200Response( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'page-load', + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + follow_redirects = True, + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + page_load_target_time = 10, + page_load_time_limit = 5, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + block_domains = 'domain.com/', + disable_screenshot = True, + allow_mic_and_camera = True, + allow_geolocation = True, + browser_language = 'en-US', + page_loading_strategy = 'normal', + fixed_packet_rate = 50, + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ], + http_interval = 120, + subinterval = 60 + ) + else: + return GetPageLoadTest200Response( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + url = 'www.thousandeyes.com', + http_interval = 120, + ) + """ + + def testGetPageLoadTest200Response(self): + """Test GetPageLoadTest200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_page_load_tests200_response.py b/tests_api/test/test_get_page_load_tests200_response.py new file mode 100644 index 00000000..299162e0 --- /dev/null +++ b/tests_api/test/test_get_page_load_tests200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_page_load_tests200_response import GetPageLoadTests200Response + +class TestGetPageLoadTests200Response(unittest.TestCase): + """GetPageLoadTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetPageLoadTests200Response: + """Test GetPageLoadTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetPageLoadTests200Response` + """ + model = GetPageLoadTests200Response() + if include_optional: + return GetPageLoadTests200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetPageLoadTests200Response( + ) + """ + + def testGetPageLoadTests200Response(self): + """Test GetPageLoadTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_path_vis_interface_groups200_response.py b/tests_api/test/test_get_path_vis_interface_groups200_response.py new file mode 100644 index 00000000..beb4aafb --- /dev/null +++ b/tests_api/test/test_get_path_vis_interface_groups200_response.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_path_vis_interface_groups200_response import GetPathVisInterfaceGroups200Response + +class TestGetPathVisInterfaceGroups200Response(unittest.TestCase): + """GetPathVisInterfaceGroups200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetPathVisInterfaceGroups200Response: + """Test GetPathVisInterfaceGroups200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetPathVisInterfaceGroups200Response` + """ + model = GetPathVisInterfaceGroups200Response() + if include_optional: + return GetPathVisInterfaceGroups200Response( + path_vis_interface_groups = [ + tests_api.models.interface_group.InterfaceGroup( + aid = '1123', + group_id = '281474976710706', + group_name = 'PathVis Interface Group', + ip_addresses = ["1.1.1.1","8.8.8.8"], + rdns_regexes = ["aggr403b-1.iad3.rackspace.net","aggr403c-1.iad3.rackspace.net"], ) + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetPathVisInterfaceGroups200Response( + ) + """ + + def testGetPathVisInterfaceGroups200Response(self): + """Test GetPathVisInterfaceGroups200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_sip_server_test200_response.py b/tests_api/test/test_get_sip_server_test200_response.py new file mode 100644 index 00000000..f0b306f0 --- /dev/null +++ b/tests_api/test/test_get_sip_server_test200_response.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_sip_server_test200_response import GetSipServerTest200Response + +class TestGetSipServerTest200Response(unittest.TestCase): + """GetSipServerTest200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetSipServerTest200Response: + """Test GetSipServerTest200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetSipServerTest200Response` + """ + model = GetSipServerTest200Response() + if include_optional: + return GetSipServerTest200Response( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'sip-server', + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + auth_user = 'username', + mtu_measurements = False, + network_measurements = True, + options_regex = '["a-z"]', + password = 'password', + path_trace_mode = 'classic', + port = 1, + protocol = 'tcp', + register_enabled = True, + sip_registrar = 'voice.thousandeyes.com', + sip_target_time = 100, + sip_time_limit = 5, + target_sip_credentials = tests_api.models.test_sip_credentials.TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username', ), + user = 'username', + fixed_packet_rate = 50, + ipv6_policy = 'use-agent-policy', + bgp_measurements = True + ) + else: + return GetSipServerTest200Response( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + port = 1, + target_sip_credentials = tests_api.models.test_sip_credentials.TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username', ), + ) + """ + + def testGetSipServerTest200Response(self): + """Test GetSipServerTest200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_sip_server_tests200_response.py b/tests_api/test/test_get_sip_server_tests200_response.py new file mode 100644 index 00000000..3eae74de --- /dev/null +++ b/tests_api/test/test_get_sip_server_tests200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_sip_server_tests200_response import GetSipServerTests200Response + +class TestGetSipServerTests200Response(unittest.TestCase): + """GetSipServerTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetSipServerTests200Response: + """Test GetSipServerTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetSipServerTests200Response` + """ + model = GetSipServerTests200Response() + if include_optional: + return GetSipServerTests200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetSipServerTests200Response( + ) + """ + + def testGetSipServerTests200Response(self): + """Test GetSipServerTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_tests200_response.py b/tests_api/test/test_get_tests200_response.py new file mode 100644 index 00000000..ff33f748 --- /dev/null +++ b/tests_api/test/test_get_tests200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_tests200_response import GetTests200Response + +class TestGetTests200Response(unittest.TestCase): + """GetTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTests200Response: + """Test GetTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTests200Response` + """ + model = GetTests200Response() + if include_optional: + return GetTests200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetTests200Response( + ) + """ + + def testGetTests200Response(self): + """Test GetTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_voice_test200_response.py b/tests_api/test/test_get_voice_test200_response.py new file mode 100644 index 00000000..c6860f5d --- /dev/null +++ b/tests_api/test/test_get_voice_test200_response.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_voice_test200_response import GetVoiceTest200Response + +class TestGetVoiceTest200Response(unittest.TestCase): + """GetVoiceTest200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetVoiceTest200Response: + """Test GetVoiceTest200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetVoiceTest200Response` + """ + model = GetVoiceTest200Response() + if include_optional: + return GetVoiceTest200Response( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'voice', + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + codec = 'G.711 @ 64 Kbps', + codec_id = '0', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + duration = 5, + jitter_buffer = 0, + num_path_traces = 3, + port = 1024, + target_agent_id = '281474976710706', + bgp_measurements = True + ) + else: + return GetVoiceTest200Response( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + target_agent_id = '281474976710706', + ) + """ + + def testGetVoiceTest200Response(self): + """Test GetVoiceTest200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_voice_tests200_response.py b/tests_api/test/test_get_voice_tests200_response.py new file mode 100644 index 00000000..41cae135 --- /dev/null +++ b/tests_api/test/test_get_voice_tests200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_voice_tests200_response import GetVoiceTests200Response + +class TestGetVoiceTests200Response(unittest.TestCase): + """GetVoiceTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetVoiceTests200Response: + """Test GetVoiceTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetVoiceTests200Response` + """ + model = GetVoiceTests200Response() + if include_optional: + return GetVoiceTests200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetVoiceTests200Response( + ) + """ + + def testGetVoiceTests200Response(self): + """Test GetVoiceTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_web_transactions_test200_response.py b/tests_api/test/test_get_web_transactions_test200_response.py new file mode 100644 index 00000000..06fb1d6b --- /dev/null +++ b/tests_api/test/test_get_web_transactions_test200_response.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_web_transactions_test200_response import GetWebTransactionsTest200Response + +class TestGetWebTransactionsTest200Response(unittest.TestCase): + """GetWebTransactionsTest200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetWebTransactionsTest200Response: + """Test GetWebTransactionsTest200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetWebTransactionsTest200Response` + """ + model = GetWebTransactionsTest200Response() + if include_optional: + return GetWebTransactionsTest200Response( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'web-transactions', + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + credentials = [3247, 1051], + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + desired_status_code = '200', + follow_redirects = True, + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + target_time = 1, + time_limit = 5, + transaction_script = 'if (true) { return true; }', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + block_domains = 'domain.com/', + disable_screenshot = True, + allow_mic_and_camera = True, + allow_geolocation = True, + browser_language = 'en-US', + page_loading_strategy = 'normal', + fixed_packet_rate = 50, + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ], + subinterval = 60 + ) + else: + return GetWebTransactionsTest200Response( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + transaction_script = 'if (true) { return true; }', + url = 'www.thousandeyes.com', + ) + """ + + def testGetWebTransactionsTest200Response(self): + """Test GetWebTransactionsTest200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_get_web_transactions_tests200_response.py b/tests_api/test/test_get_web_transactions_tests200_response.py new file mode 100644 index 00000000..48de5570 --- /dev/null +++ b/tests_api/test/test_get_web_transactions_tests200_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.get_web_transactions_tests200_response import GetWebTransactionsTests200Response + +class TestGetWebTransactionsTests200Response(unittest.TestCase): + """GetWebTransactionsTests200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetWebTransactionsTests200Response: + """Test GetWebTransactionsTests200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetWebTransactionsTests200Response` + """ + model = GetWebTransactionsTests200Response() + if include_optional: + return GetWebTransactionsTests200Response( + tests = [ + null + ], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetWebTransactionsTests200Response( + ) + """ + + def testGetWebTransactionsTests200Response(self): + """Test GetWebTransactionsTests200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_http_server_api.py b/tests_api/test/test_http_server_api.py new file mode 100644 index 00000000..406d5025 --- /dev/null +++ b/tests_api/test/test_http_server_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.http_server_api import HTTPServerApi + + +class TestHTTPServerApi(unittest.TestCase): + """HTTPServerApi unit test stubs""" + + def setUp(self) -> None: + self.api = HTTPServerApi() + + def tearDown(self) -> None: + pass + + def test_create_http_server_test(self) -> None: + """Test case for create_http_server_test + + Create HTTP Server test + """ + pass + + def test_delete_http_server_test(self) -> None: + """Test case for delete_http_server_test + + Delete HTTP Server test + """ + pass + + def test_get_http_server_test(self) -> None: + """Test case for get_http_server_test + + Get HTTP Server test + """ + pass + + def test_get_http_server_tests(self) -> None: + """Test case for get_http_server_tests + + List HTTP Server tests + """ + pass + + def test_update_http_server_test(self) -> None: + """Test case for update_http_server_test + + Update HTTP Server test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_http_server_instant_test.py b/tests_api/test/test_http_server_instant_test.py new file mode 100644 index 00000000..6821954a --- /dev/null +++ b/tests_api/test/test_http_server_instant_test.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.http_server_instant_test import HttpServerInstantTest + +class TestHttpServerInstantTest(unittest.TestCase): + """HttpServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HttpServerInstantTest: + """Test HttpServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HttpServerInstantTest` + """ + model = HttpServerInstantTest() + if include_optional: + return HttpServerInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'http-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + headers = ["header1: value1","header2: value2"], + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + desired_status_code = '200', + download_limit = 2048, + dns_override = '8.8.8.8', + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + post_body = '{ "example" : "value"}', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + ipv6_policy = 'use-agent-policy', + follow_redirects = True, + fixed_packet_rate = 50 + ) + else: + return HttpServerInstantTest( + agents = [ + tests_api.models.agent.Agent() + ], + url = 'www.thousandeyes.com', + ) + """ + + def testHttpServerInstantTest(self): + """Test HttpServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_http_server_test.py b/tests_api/test/test_http_server_test.py new file mode 100644 index 00000000..653b565f --- /dev/null +++ b/tests_api/test/test_http_server_test.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.http_server_test import HttpServerTest + +class TestHttpServerTest(unittest.TestCase): + """HttpServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HttpServerTest: + """Test HttpServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HttpServerTest` + """ + model = HttpServerTest() + if include_optional: + return HttpServerTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'http-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + headers = ["header1: value1","header2: value2"], + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + desired_status_code = '200', + download_limit = 2048, + dns_override = '8.8.8.8', + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + post_body = '{ "example" : "value"}', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + ipv6_policy = 'use-agent-policy', + follow_redirects = True, + fixed_packet_rate = 50, + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ] + ) + else: + return HttpServerTest( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + url = 'www.thousandeyes.com', + ) + """ + + def testHttpServerTest(self): + """Test HttpServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_http_server_tests.py b/tests_api/test/test_http_server_tests.py new file mode 100644 index 00000000..3fb3e5b9 --- /dev/null +++ b/tests_api/test/test_http_server_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.http_server_tests import HttpServerTests + +class TestHttpServerTests(unittest.TestCase): + """HttpServerTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HttpServerTests: + """Test HttpServerTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HttpServerTests` + """ + model = HttpServerTests() + if include_optional: + return HttpServerTests( + tests = [ + null + ] + ) + else: + return HttpServerTests( + ) + """ + + def testHttpServerTests(self): + """Test HttpServerTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_instant_test.py b/tests_api/test/test_instant_test.py new file mode 100644 index 00000000..6a293618 --- /dev/null +++ b/tests_api/test/test_instant_test.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.instant_test import InstantTest + +class TestInstantTest(unittest.TestCase): + """InstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InstantTest: + """Test InstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InstantTest` + """ + model = InstantTest() + if include_optional: + return InstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ] + ) + else: + return InstantTest( + ) + """ + + def testInstantTest(self): + """Test InstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_interface_group.py b/tests_api/test/test_interface_group.py new file mode 100644 index 00000000..f9d4f4d8 --- /dev/null +++ b/tests_api/test/test_interface_group.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.interface_group import InterfaceGroup + +class TestInterfaceGroup(unittest.TestCase): + """InterfaceGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterfaceGroup: + """Test InterfaceGroup + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InterfaceGroup` + """ + model = InterfaceGroup() + if include_optional: + return InterfaceGroup( + aid = '1123', + group_id = '281474976710706', + group_name = 'PathVis Interface Group', + ip_addresses = ["1.1.1.1","8.8.8.8"], + rdns_regexes = ["aggr403b-1.iad3.rackspace.net","aggr403c-1.iad3.rackspace.net"] + ) + else: + return InterfaceGroup( + ) + """ + + def testInterfaceGroup(self): + """Test InterfaceGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_interface_groups.py b/tests_api/test/test_interface_groups.py new file mode 100644 index 00000000..9a25d111 --- /dev/null +++ b/tests_api/test/test_interface_groups.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.interface_groups import InterfaceGroups + +class TestInterfaceGroups(unittest.TestCase): + """InterfaceGroups unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterfaceGroups: + """Test InterfaceGroups + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InterfaceGroups` + """ + model = InterfaceGroups() + if include_optional: + return InterfaceGroups( + path_vis_interface_groups = [ + tests_api.models.interface_group.InterfaceGroup( + aid = '1123', + group_id = '281474976710706', + group_name = 'PathVis Interface Group', + ip_addresses = ["1.1.1.1","8.8.8.8"], + rdns_regexes = ["aggr403b-1.iad3.rackspace.net","aggr403c-1.iad3.rackspace.net"], ) + ] + ) + else: + return InterfaceGroups( + ) + """ + + def testInterfaceGroups(self): + """Test InterfaceGroups""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_link.py b/tests_api/test/test_link.py new file mode 100644 index 00000000..0733e1c2 --- /dev/null +++ b/tests_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_map_item.py b/tests_api/test/test_map_item.py new file mode 100644 index 00000000..c65a5c3c --- /dev/null +++ b/tests_api/test/test_map_item.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.map_item import MapItem + +class TestMapItem(unittest.TestCase): + """MapItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MapItem: + """Test MapItem + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MapItem` + """ + model = MapItem() + if include_optional: + return MapItem( + key = '', + value = '' + ) + else: + return MapItem( + ) + """ + + def testMapItem(self): + """Test MapItem""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_monitor.py b/tests_api/test/test_monitor.py new file mode 100644 index 00000000..ca48a64e --- /dev/null +++ b/tests_api/test/test_monitor.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.monitor import Monitor + +class TestMonitor(unittest.TestCase): + """Monitor unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Monitor: + """Test Monitor + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Monitor` + """ + model = Monitor() + if include_optional: + return Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA' + ) + else: + return Monitor( + ) + """ + + def testMonitor(self): + """Test Monitor""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_monitor_type.py b/tests_api/test/test_monitor_type.py new file mode 100644 index 00000000..c9053d5c --- /dev/null +++ b/tests_api/test/test_monitor_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.monitor_type import MonitorType + +class TestMonitorType(unittest.TestCase): + """MonitorType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMonitorType(self): + """Test MonitorType""" + # inst = MonitorType() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_monitors_request.py b/tests_api/test/test_monitors_request.py new file mode 100644 index 00000000..bb14a32c --- /dev/null +++ b/tests_api/test/test_monitors_request.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.monitors_request import MonitorsRequest + +class TestMonitorsRequest(unittest.TestCase): + """MonitorsRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MonitorsRequest: + """Test MonitorsRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MonitorsRequest` + """ + model = MonitorsRequest() + if include_optional: + return MonitorsRequest( + monitors = ["17410","5"] + ) + else: + return MonitorsRequest( + ) + """ + + def testMonitorsRequest(self): + """Test MonitorsRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_page_load_api.py b/tests_api/test/test_page_load_api.py new file mode 100644 index 00000000..6212e09b --- /dev/null +++ b/tests_api/test/test_page_load_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.page_load_api import PageLoadApi + + +class TestPageLoadApi(unittest.TestCase): + """PageLoadApi unit test stubs""" + + def setUp(self) -> None: + self.api = PageLoadApi() + + def tearDown(self) -> None: + pass + + def test_create_page_load_test(self) -> None: + """Test case for create_page_load_test + + Create Page Load test + """ + pass + + def test_delete_page_load_test(self) -> None: + """Test case for delete_page_load_test + + Delete Page Load test + """ + pass + + def test_get_page_load_test(self) -> None: + """Test case for get_page_load_test + + Get Page Load test + """ + pass + + def test_get_page_load_tests(self) -> None: + """Test case for get_page_load_tests + + List Page Load tests + """ + pass + + def test_update_page_load_test(self) -> None: + """Test case for update_page_load_test + + Update Page Load test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_page_load_instant_test.py b/tests_api/test/test_page_load_instant_test.py new file mode 100644 index 00000000..a585588d --- /dev/null +++ b/tests_api/test/test_page_load_instant_test.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.page_load_instant_test import PageLoadInstantTest + +class TestPageLoadInstantTest(unittest.TestCase): + """PageLoadInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PageLoadInstantTest: + """Test PageLoadInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageLoadInstantTest` + """ + model = PageLoadInstantTest() + if include_optional: + return PageLoadInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'page-load', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + follow_redirects = True, + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + page_load_target_time = 10, + page_load_time_limit = 5, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + block_domains = 'domain.com/', + disable_screenshot = True, + allow_mic_and_camera = True, + allow_geolocation = True, + browser_language = 'en-US', + page_loading_strategy = 'normal', + fixed_packet_rate = 50 + ) + else: + return PageLoadInstantTest( + agents = [ + tests_api.models.agent.Agent() + ], + url = 'www.thousandeyes.com', + ) + """ + + def testPageLoadInstantTest(self): + """Test PageLoadInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_page_load_test.py b/tests_api/test/test_page_load_test.py new file mode 100644 index 00000000..dc13140e --- /dev/null +++ b/tests_api/test/test_page_load_test.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.page_load_test import PageLoadTest + +class TestPageLoadTest(unittest.TestCase): + """PageLoadTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PageLoadTest: + """Test PageLoadTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageLoadTest` + """ + model = PageLoadTest() + if include_optional: + return PageLoadTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'page-load', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + follow_redirects = True, + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + page_load_target_time = 10, + page_load_time_limit = 5, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + block_domains = 'domain.com/', + disable_screenshot = True, + allow_mic_and_camera = True, + allow_geolocation = True, + browser_language = 'en-US', + page_loading_strategy = 'normal', + fixed_packet_rate = 50, + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ], + http_interval = 120, + subinterval = 60 + ) + else: + return PageLoadTest( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + url = 'www.thousandeyes.com', + http_interval = 120, + ) + """ + + def testPageLoadTest(self): + """Test PageLoadTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_page_load_tests.py b/tests_api/test/test_page_load_tests.py new file mode 100644 index 00000000..cc338b4d --- /dev/null +++ b/tests_api/test/test_page_load_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.page_load_tests import PageLoadTests + +class TestPageLoadTests(unittest.TestCase): + """PageLoadTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PageLoadTests: + """Test PageLoadTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageLoadTests` + """ + model = PageLoadTests() + if include_optional: + return PageLoadTests( + tests = [ + null + ] + ) + else: + return PageLoadTests( + ) + """ + + def testPageLoadTests(self): + """Test PageLoadTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_path_visualization_interface_groups_api.py b/tests_api/test/test_path_visualization_interface_groups_api.py new file mode 100644 index 00000000..056ee67d --- /dev/null +++ b/tests_api/test/test_path_visualization_interface_groups_api.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.path_visualization_interface_groups_api import PathVisualizationInterfaceGroupsApi + + +class TestPathVisualizationInterfaceGroupsApi(unittest.TestCase): + """PathVisualizationInterfaceGroupsApi unit test stubs""" + + def setUp(self) -> None: + self.api = PathVisualizationInterfaceGroupsApi() + + def tearDown(self) -> None: + pass + + def test_create_path_vis_interface_groups(self) -> None: + """Test case for create_path_vis_interface_groups + + Create interface group for path visualization + """ + pass + + def test_delete_path_vis_interface_group(self) -> None: + """Test case for delete_path_vis_interface_group + + Delete interface group + """ + pass + + def test_get_path_vis_interface_groups(self) -> None: + """Test case for get_path_vis_interface_groups + + List interface groups for path visualization + """ + pass + + def test_update_path_vis_interface_group(self) -> None: + """Test case for update_path_vis_interface_group + + Update interface group + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_self_links.py b/tests_api/test/test_self_links.py new file mode 100644 index 00000000..dd33ee22 --- /dev/null +++ b/tests_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_self_links_links.py b/tests_api/test/test_self_links_links.py new file mode 100644 index 00000000..8ff85fcb --- /dev/null +++ b/tests_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_simple_test.py b/tests_api/test/test_simple_test.py new file mode 100644 index 00000000..f73949a5 --- /dev/null +++ b/tests_api/test/test_simple_test.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.simple_test import SimpleTest + +class TestSimpleTest(unittest.TestCase): + """SimpleTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SimpleTest: + """Test SimpleTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SimpleTest` + """ + model = SimpleTest() + if include_optional: + return SimpleTest( + interval = 120, + alerts_enabled = True, + enabled = True, + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ) + ) + else: + return SimpleTest( + ) + """ + + def testSimpleTest(self): + """Test SimpleTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_sip_server_api.py b/tests_api/test/test_sip_server_api.py new file mode 100644 index 00000000..b4414661 --- /dev/null +++ b/tests_api/test/test_sip_server_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.sip_server_api import SIPServerApi + + +class TestSIPServerApi(unittest.TestCase): + """SIPServerApi unit test stubs""" + + def setUp(self) -> None: + self.api = SIPServerApi() + + def tearDown(self) -> None: + pass + + def test_create_sip_server_test(self) -> None: + """Test case for create_sip_server_test + + Create SIP Server test + """ + pass + + def test_delete_sip_server_test(self) -> None: + """Test case for delete_sip_server_test + + Delete SIP Server test + """ + pass + + def test_get_sip_server_test(self) -> None: + """Test case for get_sip_server_test + + Get SIP Server test + """ + pass + + def test_get_sip_server_tests(self) -> None: + """Test case for get_sip_server_tests + + List SIP Server tests + """ + pass + + def test_update_sip_server_test(self) -> None: + """Test case for update_sip_server_test + + Update SIP Server test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_sip_server_instant_test.py b/tests_api/test/test_sip_server_instant_test.py new file mode 100644 index 00000000..e4d75522 --- /dev/null +++ b/tests_api/test/test_sip_server_instant_test.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.sip_server_instant_test import SipServerInstantTest + +class TestSipServerInstantTest(unittest.TestCase): + """SipServerInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SipServerInstantTest: + """Test SipServerInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SipServerInstantTest` + """ + model = SipServerInstantTest() + if include_optional: + return SipServerInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'sip-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + auth_user = 'username', + mtu_measurements = False, + network_measurements = True, + options_regex = '["a-z"]', + password = 'password', + path_trace_mode = 'classic', + port = 1, + protocol = 'tcp', + register_enabled = True, + sip_registrar = 'voice.thousandeyes.com', + sip_target_time = 100, + sip_time_limit = 5, + target_sip_credentials = tests_api.models.test_sip_credentials.TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username', ), + user = 'username', + fixed_packet_rate = 50, + ipv6_policy = 'use-agent-policy' + ) + else: + return SipServerInstantTest( + agents = [ + tests_api.models.agent.Agent() + ], + port = 1, + target_sip_credentials = tests_api.models.test_sip_credentials.TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username', ), + ) + """ + + def testSipServerInstantTest(self): + """Test SipServerInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_sip_server_test.py b/tests_api/test/test_sip_server_test.py new file mode 100644 index 00000000..fabce23f --- /dev/null +++ b/tests_api/test/test_sip_server_test.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.sip_server_test import SipServerTest + +class TestSipServerTest(unittest.TestCase): + """SipServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SipServerTest: + """Test SipServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SipServerTest` + """ + model = SipServerTest() + if include_optional: + return SipServerTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'sip-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + auth_user = 'username', + mtu_measurements = False, + network_measurements = True, + options_regex = '["a-z"]', + password = 'password', + path_trace_mode = 'classic', + port = 1, + protocol = 'tcp', + register_enabled = True, + sip_registrar = 'voice.thousandeyes.com', + sip_target_time = 100, + sip_time_limit = 5, + target_sip_credentials = tests_api.models.test_sip_credentials.TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username', ), + user = 'username', + fixed_packet_rate = 50, + ipv6_policy = 'use-agent-policy', + bgp_measurements = True + ) + else: + return SipServerTest( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + port = 1, + target_sip_credentials = tests_api.models.test_sip_credentials.TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username', ), + ) + """ + + def testSipServerTest(self): + """Test SipServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_sip_server_tests.py b/tests_api/test/test_sip_server_tests.py new file mode 100644 index 00000000..04f4fe77 --- /dev/null +++ b/tests_api/test/test_sip_server_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.sip_server_tests import SipServerTests + +class TestSipServerTests(unittest.TestCase): + """SipServerTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SipServerTests: + """Test SipServerTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SipServerTests` + """ + model = SipServerTests() + if include_optional: + return SipServerTests( + tests = [ + null + ] + ) + else: + return SipServerTests( + ) + """ + + def testSipServerTests(self): + """Test SipServerTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_sip_test_protocol.py b/tests_api/test/test_sip_test_protocol.py new file mode 100644 index 00000000..0a8a9e5c --- /dev/null +++ b/tests_api/test/test_sip_test_protocol.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.sip_test_protocol import SipTestProtocol + +class TestSipTestProtocol(unittest.TestCase): + """SipTestProtocol unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSipTestProtocol(self): + """Test SipTestProtocol""" + # inst = SipTestProtocol() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_auth_type.py b/tests_api/test/test_test_auth_type.py new file mode 100644 index 00000000..f34b9a20 --- /dev/null +++ b/tests_api/test/test_test_auth_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_auth_type import TestAuthType + +class TestTestAuthType(unittest.TestCase): + """TestAuthType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestAuthType(self): + """Test TestAuthType""" + # inst = TestAuthType() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_custom_headers.py b/tests_api/test/test_test_custom_headers.py new file mode 100644 index 00000000..c88f3a8e --- /dev/null +++ b/tests_api/test/test_test_custom_headers.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_custom_headers import TestCustomHeaders + +class TestTestCustomHeaders(unittest.TestCase): + """TestCustomHeaders unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestCustomHeaders: + """Test TestCustomHeaders + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestCustomHeaders` + """ + model = TestCustomHeaders() + if include_optional: + return TestCustomHeaders( + root = None, + domains = { + 'key' : tests_api.models.map_item.MapItem( + key = '', + value = '', ) + }, + all = None + ) + else: + return TestCustomHeaders( + ) + """ + + def testTestCustomHeaders(self): + """Test TestCustomHeaders""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_custom_headers_all.py b/tests_api/test/test_test_custom_headers_all.py new file mode 100644 index 00000000..c9a84f15 --- /dev/null +++ b/tests_api/test/test_test_custom_headers_all.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_custom_headers_all import TestCustomHeadersAll + +class TestTestCustomHeadersAll(unittest.TestCase): + """TestCustomHeadersAll unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestCustomHeadersAll: + """Test TestCustomHeadersAll + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestCustomHeadersAll` + """ + model = TestCustomHeadersAll() + if include_optional: + return TestCustomHeadersAll( + key = '', + value = '' + ) + else: + return TestCustomHeadersAll( + ) + """ + + def testTestCustomHeadersAll(self): + """Test TestCustomHeadersAll""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_custom_headers_root.py b/tests_api/test/test_test_custom_headers_root.py new file mode 100644 index 00000000..5f2386a1 --- /dev/null +++ b/tests_api/test/test_test_custom_headers_root.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_custom_headers_root import TestCustomHeadersRoot + +class TestTestCustomHeadersRoot(unittest.TestCase): + """TestCustomHeadersRoot unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestCustomHeadersRoot: + """Test TestCustomHeadersRoot + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestCustomHeadersRoot` + """ + model = TestCustomHeadersRoot() + if include_optional: + return TestCustomHeadersRoot( + key = '', + value = '' + ) + else: + return TestCustomHeadersRoot( + ) + """ + + def testTestCustomHeadersRoot(self): + """Test TestCustomHeadersRoot""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_direction.py b/tests_api/test/test_test_direction.py new file mode 100644 index 00000000..8fab0017 --- /dev/null +++ b/tests_api/test/test_test_direction.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_direction import TestDirection + +class TestTestDirection(unittest.TestCase): + """TestDirection unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestDirection(self): + """Test TestDirection""" + # inst = TestDirection() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_dns_server.py b/tests_api/test/test_test_dns_server.py new file mode 100644 index 00000000..e2a055b0 --- /dev/null +++ b/tests_api/test/test_test_dns_server.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_dns_server import TestDnsServer + +class TestTestDnsServer(unittest.TestCase): + """TestDnsServer unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestDnsServer: + """Test TestDnsServer + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestDnsServer` + """ + model = TestDnsServer() + if include_optional: + return TestDnsServer( + server_id = '1447', + server_name = 'dns-example.net' + ) + else: + return TestDnsServer( + ) + """ + + def testTestDnsServer(self): + """Test TestDnsServer""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_dns_transport_protocol.py b/tests_api/test/test_test_dns_transport_protocol.py new file mode 100644 index 00000000..53bf593a --- /dev/null +++ b/tests_api/test/test_test_dns_transport_protocol.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol + +class TestTestDnsTransportProtocol(unittest.TestCase): + """TestDnsTransportProtocol unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestDnsTransportProtocol(self): + """Test TestDnsTransportProtocol""" + # inst = TestDnsTransportProtocol() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_dscp_id.py b/tests_api/test/test_test_dscp_id.py new file mode 100644 index 00000000..3a541bfe --- /dev/null +++ b/tests_api/test/test_test_dscp_id.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_dscp_id import TestDscpId + +class TestTestDscpId(unittest.TestCase): + """TestDscpId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestDscpId(self): + """Test TestDscpId""" + # inst = TestDscpId() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_http_interval.py b/tests_api/test/test_test_http_interval.py new file mode 100644 index 00000000..b1712498 --- /dev/null +++ b/tests_api/test/test_test_http_interval.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_http_interval import TestHttpInterval + +class TestTestHttpInterval(unittest.TestCase): + """TestHttpInterval unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestHttpInterval(self): + """Test TestHttpInterval""" + # inst = TestHttpInterval() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_interval.py b/tests_api/test/test_test_interval.py new file mode 100644 index 00000000..b52317b5 --- /dev/null +++ b/tests_api/test/test_test_interval.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_interval import TestInterval + +class TestTestInterval(unittest.TestCase): + """TestInterval unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestInterval(self): + """Test TestInterval""" + # inst = TestInterval() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_ipv6_policy.py b/tests_api/test/test_test_ipv6_policy.py new file mode 100644 index 00000000..c6717778 --- /dev/null +++ b/tests_api/test/test_test_ipv6_policy.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_ipv6_policy import TestIpv6Policy + +class TestTestIpv6Policy(unittest.TestCase): + """TestIpv6Policy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestIpv6Policy(self): + """Test TestIpv6Policy""" + # inst = TestIpv6Policy() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_labels_inner.py b/tests_api/test/test_test_labels_inner.py new file mode 100644 index 00000000..833ba468 --- /dev/null +++ b/tests_api/test/test_test_labels_inner.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_labels_inner import TestLabelsInner + +class TestTestLabelsInner(unittest.TestCase): + """TestLabelsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestLabelsInner: + """Test TestLabelsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestLabelsInner` + """ + model = TestLabelsInner() + if include_optional: + return TestLabelsInner( + label_id = '', + name = '', + is_built_in = True + ) + else: + return TestLabelsInner( + ) + """ + + def testTestLabelsInner(self): + """Test TestLabelsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_page_loading_strategy.py b/tests_api/test/test_test_page_loading_strategy.py new file mode 100644 index 00000000..5c4b4e66 --- /dev/null +++ b/tests_api/test/test_test_page_loading_strategy.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy + +class TestTestPageLoadingStrategy(unittest.TestCase): + """TestPageLoadingStrategy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestPageLoadingStrategy(self): + """Test TestPageLoadingStrategy""" + # inst = TestPageLoadingStrategy() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_path_trace_mode.py b/tests_api/test/test_test_path_trace_mode.py new file mode 100644 index 00000000..8bdd004a --- /dev/null +++ b/tests_api/test/test_test_path_trace_mode.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_path_trace_mode import TestPathTraceMode + +class TestTestPathTraceMode(unittest.TestCase): + """TestPathTraceMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestPathTraceMode(self): + """Test TestPathTraceMode""" + # inst = TestPathTraceMode() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_probe_mode.py b/tests_api/test/test_test_probe_mode.py new file mode 100644 index 00000000..6180ae9a --- /dev/null +++ b/tests_api/test/test_test_probe_mode.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_probe_mode import TestProbeMode + +class TestTestProbeMode(unittest.TestCase): + """TestProbeMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestProbeMode(self): + """Test TestProbeMode""" + # inst = TestProbeMode() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_protocol.py b/tests_api/test/test_test_protocol.py new file mode 100644 index 00000000..0b70fbe2 --- /dev/null +++ b/tests_api/test/test_test_protocol.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_protocol import TestProtocol + +class TestTestProtocol(unittest.TestCase): + """TestProtocol unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestProtocol(self): + """Test TestProtocol""" + # inst = TestProtocol() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_request.py b/tests_api/test/test_test_request.py new file mode 100644 index 00000000..da4e8ff9 --- /dev/null +++ b/tests_api/test/test_test_request.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_request import TestRequest + +class TestTestRequest(unittest.TestCase): + """TestRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestRequest: + """Test TestRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestRequest` + """ + model = TestRequest() + if include_optional: + return TestRequest( + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + alert_rules = [344753, 212697], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ] + ) + else: + return TestRequest( + ) + """ + + def testTestRequest(self): + """Test TestRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_request_all_of_agents.py b/tests_api/test/test_test_request_all_of_agents.py new file mode 100644 index 00000000..317a945e --- /dev/null +++ b/tests_api/test/test_test_request_all_of_agents.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents + +class TestTestRequestAllOfAgents(unittest.TestCase): + """TestRequestAllOfAgents unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestRequestAllOfAgents: + """Test TestRequestAllOfAgents + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestRequestAllOfAgents` + """ + model = TestRequestAllOfAgents() + if include_optional: + return TestRequestAllOfAgents( + agent_id = '', + source_ip_address = '' + ) + else: + return TestRequestAllOfAgents( + ) + """ + + def testTestRequestAllOfAgents(self): + """Test TestRequestAllOfAgents""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_shared_accounts_inner.py b/tests_api/test/test_test_shared_accounts_inner.py new file mode 100644 index 00000000..152f0209 --- /dev/null +++ b/tests_api/test/test_test_shared_accounts_inner.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner + +class TestTestSharedAccountsInner(unittest.TestCase): + """TestSharedAccountsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestSharedAccountsInner: + """Test TestSharedAccountsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestSharedAccountsInner` + """ + model = TestSharedAccountsInner() + if include_optional: + return TestSharedAccountsInner( + aid = '105', + name = 'Account name' + ) + else: + return TestSharedAccountsInner( + ) + """ + + def testTestSharedAccountsInner(self): + """Test TestSharedAccountsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_sip_credentials.py b/tests_api/test/test_test_sip_credentials.py new file mode 100644 index 00000000..03be6cdf --- /dev/null +++ b/tests_api/test/test_test_sip_credentials.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_sip_credentials import TestSipCredentials + +class TestTestSipCredentials(unittest.TestCase): + """TestSipCredentials unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestSipCredentials: + """Test TestSipCredentials + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestSipCredentials` + """ + model = TestSipCredentials() + if include_optional: + return TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username' + ) + else: + return TestSipCredentials( + port = 1024, + ) + """ + + def testTestSipCredentials(self): + """Test TestSipCredentials""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_ssl_version_id.py b/tests_api/test/test_test_ssl_version_id.py new file mode 100644 index 00000000..fc1e2596 --- /dev/null +++ b/tests_api/test/test_test_ssl_version_id.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_ssl_version_id import TestSslVersionId + +class TestTestSslVersionId(unittest.TestCase): + """TestSslVersionId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestSslVersionId(self): + """Test TestSslVersionId""" + # inst = TestSslVersionId() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_sub_interval.py b/tests_api/test/test_test_sub_interval.py new file mode 100644 index 00000000..8d1d1922 --- /dev/null +++ b/tests_api/test/test_test_sub_interval.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_sub_interval import TestSubInterval + +class TestTestSubInterval(unittest.TestCase): + """TestSubInterval unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestSubInterval(self): + """Test TestSubInterval""" + # inst = TestSubInterval() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_test_type.py b/tests_api/test/test_test_type.py new file mode 100644 index 00000000..ffc5a157 --- /dev/null +++ b/tests_api/test/test_test_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.test_type import TestType + +class TestTestType(unittest.TestCase): + """TestType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestType(self): + """Test TestType""" + # inst = TestType() + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_tests.py b/tests_api/test/test_tests.py new file mode 100644 index 00000000..62d2a8c0 --- /dev/null +++ b/tests_api/test/test_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.tests import Tests + +class TestTests(unittest.TestCase): + """Tests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Tests: + """Test Tests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Tests` + """ + model = Tests() + if include_optional: + return Tests( + tests = [ + null + ] + ) + else: + return Tests( + ) + """ + + def testTests(self): + """Test Tests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_unauthorized_error.py b/tests_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..1c920f54 --- /dev/null +++ b/tests_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_unexpanded_instant_test.py b/tests_api/test/test_unexpanded_instant_test.py new file mode 100644 index 00000000..5108286c --- /dev/null +++ b/tests_api/test/test_unexpanded_instant_test.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.unexpanded_instant_test import UnexpandedInstantTest + +class TestUnexpandedInstantTest(unittest.TestCase): + """UnexpandedInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTest: + """Test UnexpandedInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTest` + """ + model = UnexpandedInstantTest() + if include_optional: + return UnexpandedInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ) + ) + else: + return UnexpandedInstantTest( + ) + """ + + def testUnexpandedInstantTest(self): + """Test UnexpandedInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_unexpanded_instant_test_links.py b/tests_api/test/test_unexpanded_instant_test_links.py new file mode 100644 index 00000000..b5501fbe --- /dev/null +++ b/tests_api/test/test_unexpanded_instant_test_links.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks + +class TestUnexpandedInstantTestLinks(unittest.TestCase): + """UnexpandedInstantTestLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinks: + """Test UnexpandedInstantTestLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinks` + """ + model = UnexpandedInstantTestLinks() + if include_optional: + return UnexpandedInstantTestLinks( + var_self = None, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}] + ) + else: + return UnexpandedInstantTestLinks( + ) + """ + + def testUnexpandedInstantTestLinks(self): + """Test UnexpandedInstantTestLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_unexpanded_instant_test_links_self.py b/tests_api/test/test_unexpanded_instant_test_links_self.py new file mode 100644 index 00000000..220640dd --- /dev/null +++ b/tests_api/test/test_unexpanded_instant_test_links_self.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf + +class TestUnexpandedInstantTestLinksSelf(unittest.TestCase): + """UnexpandedInstantTestLinksSelf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinksSelf: + """Test UnexpandedInstantTestLinksSelf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinksSelf` + """ + model = UnexpandedInstantTestLinksSelf() + if include_optional: + return UnexpandedInstantTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return UnexpandedInstantTestLinksSelf( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testUnexpandedInstantTestLinksSelf(self): + """Test UnexpandedInstantTestLinksSelf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_unexpanded_instant_test_links_test_results.py b/tests_api/test/test_unexpanded_instant_test_links_test_results.py new file mode 100644 index 00000000..a15de6bf --- /dev/null +++ b/tests_api/test/test_unexpanded_instant_test_links_test_results.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults + +class TestUnexpandedInstantTestLinksTestResults(unittest.TestCase): + """UnexpandedInstantTestLinksTestResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedInstantTestLinksTestResults: + """Test UnexpandedInstantTestLinksTestResults + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedInstantTestLinksTestResults` + """ + model = UnexpandedInstantTestLinksTestResults() + if include_optional: + return UnexpandedInstantTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return UnexpandedInstantTestLinksTestResults( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testUnexpandedInstantTestLinksTestResults(self): + """Test UnexpandedInstantTestLinksTestResults""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_unexpanded_test.py b/tests_api/test/test_unexpanded_test.py new file mode 100644 index 00000000..3d406935 --- /dev/null +++ b/tests_api/test/test_unexpanded_test.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.unexpanded_test import UnexpandedTest + +class TestUnexpandedTest(unittest.TestCase): + """UnexpandedTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnexpandedTest: + """Test UnexpandedTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnexpandedTest` + """ + model = UnexpandedTest() + if include_optional: + return UnexpandedTest( + interval = 120, + alerts_enabled = True, + enabled = True + ) + else: + return UnexpandedTest( + ) + """ + + def testUnexpandedTest(self): + """Test UnexpandedTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_update_agent_to_agent_test.py b/tests_api/test/test_update_agent_to_agent_test.py new file mode 100644 index 00000000..06eaebfc --- /dev/null +++ b/tests_api/test/test_update_agent_to_agent_test.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.update_agent_to_agent_test import UpdateAgentToAgentTest + +class TestUpdateAgentToAgentTest(unittest.TestCase): + """UpdateAgentToAgentTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateAgentToAgentTest: + """Test UpdateAgentToAgentTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateAgentToAgentTest` + """ + model = UpdateAgentToAgentTest() + if include_optional: + return UpdateAgentToAgentTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [344753, 212697], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-agent', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + direction = 'to-target', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + mss = 20, + num_path_traces = 3, + path_trace_mode = 'classic', + port = 1, + protocol = 'tcp', + target_agent_id = '2954', + throughput_measurements = True, + throughput_duration = 5000, + throughput_rate = 8, + fixed_packet_rate = 50, + bgp_measurements = True, + monitors = [17410, 5] + ) + else: + return UpdateAgentToAgentTest( + interval = 120, + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + target_agent_id = '2954', + ) + """ + + def testUpdateAgentToAgentTest(self): + """Test UpdateAgentToAgentTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_update_agent_to_server_test.py b/tests_api/test/test_update_agent_to_server_test.py new file mode 100644 index 00000000..3ed382c6 --- /dev/null +++ b/tests_api/test/test_update_agent_to_server_test.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.update_agent_to_server_test import UpdateAgentToServerTest + +class TestUpdateAgentToServerTest(unittest.TestCase): + """UpdateAgentToServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateAgentToServerTest: + """Test UpdateAgentToServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateAgentToServerTest` + """ + model = UpdateAgentToServerTest() + if include_optional: + return UpdateAgentToServerTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [344753, 212697], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'agent-to-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + bandwidth_measurements = True, + continuous_mode = False, + fixed_packet_rate = 25, + mtu_measurements = False, + num_path_traces = 3, + path_trace_mode = 'classic', + port = 1, + probe_mode = 'auto', + protocol = 'tcp', + server = 'www.thousandeyes.com', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + ipv6_policy = 'use-agent-policy', + ping_payload_size = 0, + network_measurements = True, + bgp_measurements = True, + monitors = [17410, 5] + ) + else: + return UpdateAgentToServerTest( + interval = 120, + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + server = 'www.thousandeyes.com', + ) + """ + + def testUpdateAgentToServerTest(self): + """Test UpdateAgentToServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_update_bgp_test.py b/tests_api/test/test_update_bgp_test.py new file mode 100644 index 00000000..5f10c35c --- /dev/null +++ b/tests_api/test/test_update_bgp_test.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.update_bgp_test import UpdateBgpTest + +class TestUpdateBgpTest(unittest.TestCase): + """UpdateBgpTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateBgpTest: + """Test UpdateBgpTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateBgpTest` + """ + model = UpdateBgpTest() + if include_optional: + return UpdateBgpTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'bgp', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + monitors = [17410, 5], + include_covered_prefixes = True, + prefix = '', + use_public_bgp = False, + alerts_enabled = True, + alert_rules = [344753, 212697] + ) + else: + return UpdateBgpTest( + prefix = '', + ) + """ + + def testUpdateBgpTest(self): + """Test UpdateBgpTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_update_dns_sec_test.py b/tests_api/test/test_update_dns_sec_test.py new file mode 100644 index 00000000..bb1e4186 --- /dev/null +++ b/tests_api/test/test_update_dns_sec_test.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.update_dns_sec_test import UpdateDnsSecTest + +class TestUpdateDnsSecTest(unittest.TestCase): + """UpdateDnsSecTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateDnsSecTest: + """Test UpdateDnsSecTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateDnsSecTest` + """ + model = UpdateDnsSecTest() + if include_optional: + return UpdateDnsSecTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [344753, 212697], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dnssec', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + domain = 'www.thousandeyes.com', + dns_query_class = 'in' + ) + else: + return UpdateDnsSecTest( + interval = 120, + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testUpdateDnsSecTest(self): + """Test UpdateDnsSecTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_update_dns_server_test.py b/tests_api/test/test_update_dns_server_test.py new file mode 100644 index 00000000..de1c4245 --- /dev/null +++ b/tests_api/test/test_update_dns_server_test.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.update_dns_server_test import UpdateDnsServerTest + +class TestUpdateDnsServerTest(unittest.TestCase): + """UpdateDnsServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateDnsServerTest: + """Test UpdateDnsServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateDnsServerTest` + """ + model = UpdateDnsServerTest() + if include_optional: + return UpdateDnsServerTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [344753, 212697], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dns-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + bandwidth_measurements = True, + dns_servers = [ + tests_api.models.test_dns_server.TestDnsServer( + server_id = '1447', + server_name = 'dns-example.net', ) + ], + dns_transport_protocol = 'udp', + domain = 'www.thousandeyes.com', + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + recursive_queries = True, + ipv6_policy = 'use-agent-policy', + fixed_packet_rate = 50, + dns_query_class = 'in', + bgp_measurements = True, + monitors = [17410, 5] + ) + else: + return UpdateDnsServerTest( + interval = 120, + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + dns_servers = [ + tests_api.models.test_dns_server.TestDnsServer( + server_id = '1447', + server_name = 'dns-example.net', ) + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testUpdateDnsServerTest(self): + """Test UpdateDnsServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_update_dns_trace_test.py b/tests_api/test/test_update_dns_trace_test.py new file mode 100644 index 00000000..c51ed2f7 --- /dev/null +++ b/tests_api/test/test_update_dns_trace_test.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.update_dns_trace_test import UpdateDnsTraceTest + +class TestUpdateDnsTraceTest(unittest.TestCase): + """UpdateDnsTraceTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateDnsTraceTest: + """Test UpdateDnsTraceTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateDnsTraceTest` + """ + model = UpdateDnsTraceTest() + if include_optional: + return UpdateDnsTraceTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [344753, 212697], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'dns-trace', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + dns_transport_protocol = 'udp', + domain = 'www.thousandeyes.com', + dns_query_class = 'in' + ) + else: + return UpdateDnsTraceTest( + interval = 120, + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + domain = 'www.thousandeyes.com', + ) + """ + + def testUpdateDnsTraceTest(self): + """Test UpdateDnsTraceTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_update_ftp_server_test.py b/tests_api/test/test_update_ftp_server_test.py new file mode 100644 index 00000000..ee6bf8fc --- /dev/null +++ b/tests_api/test/test_update_ftp_server_test.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.update_ftp_server_test import UpdateFtpServerTest + +class TestUpdateFtpServerTest(unittest.TestCase): + """UpdateFtpServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateFtpServerTest: + """Test UpdateFtpServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateFtpServerTest` + """ + model = UpdateFtpServerTest() + if include_optional: + return UpdateFtpServerTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [344753, 212697], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'ftp-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + bandwidth_measurements = True, + download_limit = 1048576, + ftp_target_time = 1000, + ftp_time_limit = 10, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + request_type = 'download', + url = 'www.thousandeyes.com', + use_active_ftp = True, + use_explicit_ftps = False, + username = 'username', + fixed_packet_rate = 50, + ipv6_policy = 'use-agent-policy', + bgp_measurements = True, + monitors = [17410, 5] + ) + else: + return UpdateFtpServerTest( + interval = 120, + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + password = 'password', + request_type = 'download', + url = 'www.thousandeyes.com', + username = 'username', + ) + """ + + def testUpdateFtpServerTest(self): + """Test UpdateFtpServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_update_http_server_test.py b/tests_api/test/test_update_http_server_test.py new file mode 100644 index 00000000..d7c14676 --- /dev/null +++ b/tests_api/test/test_update_http_server_test.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.update_http_server_test import UpdateHttpServerTest + +class TestUpdateHttpServerTest(unittest.TestCase): + """UpdateHttpServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateHttpServerTest: + """Test UpdateHttpServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateHttpServerTest` + """ + model = UpdateHttpServerTest() + if include_optional: + return UpdateHttpServerTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [344753, 212697], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'http-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + headers = ["header1: value1","header2: value2"], + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + desired_status_code = '200', + download_limit = 2048, + dns_override = '8.8.8.8', + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + post_body = '{ "example" : "value"}', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + ipv6_policy = 'use-agent-policy', + follow_redirects = True, + fixed_packet_rate = 50, + bgp_measurements = True, + monitors = [17410, 5] + ) + else: + return UpdateHttpServerTest( + interval = 120, + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + url = 'www.thousandeyes.com', + ) + """ + + def testUpdateHttpServerTest(self): + """Test UpdateHttpServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_update_page_load_test.py b/tests_api/test/test_update_page_load_test.py new file mode 100644 index 00000000..5da32ff7 --- /dev/null +++ b/tests_api/test/test_update_page_load_test.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.update_page_load_test import UpdatePageLoadTest + +class TestUpdatePageLoadTest(unittest.TestCase): + """UpdatePageLoadTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdatePageLoadTest: + """Test UpdatePageLoadTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdatePageLoadTest` + """ + model = UpdatePageLoadTest() + if include_optional: + return UpdatePageLoadTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [344753, 212697], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'page-load', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + follow_redirects = True, + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + page_load_target_time = 10, + page_load_time_limit = 5, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + block_domains = 'domain.com/', + disable_screenshot = True, + allow_mic_and_camera = True, + allow_geolocation = True, + browser_language = 'en-US', + page_loading_strategy = 'normal', + fixed_packet_rate = 50, + bgp_measurements = True, + monitors = [17410, 5], + http_interval = 120, + subinterval = 60 + ) + else: + return UpdatePageLoadTest( + interval = 120, + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + url = 'www.thousandeyes.com', + http_interval = 120, + ) + """ + + def testUpdatePageLoadTest(self): + """Test UpdatePageLoadTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_update_path_vis_interface_group200_response.py b/tests_api/test/test_update_path_vis_interface_group200_response.py new file mode 100644 index 00000000..e4699aa7 --- /dev/null +++ b/tests_api/test/test_update_path_vis_interface_group200_response.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.update_path_vis_interface_group200_response import UpdatePathVisInterfaceGroup200Response + +class TestUpdatePathVisInterfaceGroup200Response(unittest.TestCase): + """UpdatePathVisInterfaceGroup200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdatePathVisInterfaceGroup200Response: + """Test UpdatePathVisInterfaceGroup200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdatePathVisInterfaceGroup200Response` + """ + model = UpdatePathVisInterfaceGroup200Response() + if include_optional: + return UpdatePathVisInterfaceGroup200Response( + aid = '1123', + group_id = '281474976710706', + group_name = 'PathVis Interface Group', + ip_addresses = [1.1.1.1, 8.8.8.8], + rdns_regexes = [aggr403b-1.iad3.rackspace.net, aggr403c-1.iad3.rackspace.net], + links = tests_api.models.self_links__links.SelfLinks__links( + self = tests_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return UpdatePathVisInterfaceGroup200Response( + ) + """ + + def testUpdatePathVisInterfaceGroup200Response(self): + """Test UpdatePathVisInterfaceGroup200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_update_sip_server_test.py b/tests_api/test/test_update_sip_server_test.py new file mode 100644 index 00000000..62ab60b7 --- /dev/null +++ b/tests_api/test/test_update_sip_server_test.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.update_sip_server_test import UpdateSipServerTest + +class TestUpdateSipServerTest(unittest.TestCase): + """UpdateSipServerTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateSipServerTest: + """Test UpdateSipServerTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateSipServerTest` + """ + model = UpdateSipServerTest() + if include_optional: + return UpdateSipServerTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [344753, 212697], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'sip-server', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + auth_user = 'username', + mtu_measurements = False, + network_measurements = True, + options_regex = '["a-z"]', + password = 'password', + path_trace_mode = 'classic', + port = 1, + protocol = 'tcp', + register_enabled = True, + sip_registrar = 'voice.thousandeyes.com', + sip_target_time = 100, + sip_time_limit = 5, + target_sip_credentials = tests_api.models.test_sip_credentials.TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username', ), + user = 'username', + fixed_packet_rate = 50, + ipv6_policy = 'use-agent-policy', + bgp_measurements = True + ) + else: + return UpdateSipServerTest( + interval = 120, + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + port = 1, + target_sip_credentials = tests_api.models.test_sip_credentials.TestSipCredentials( + auth_user = 'username', + password = 'password', + port = 1024, + protocol = 'tcp', + sip_registrar = 'sip.thousandeyes.com', + user = 'username', ), + ) + """ + + def testUpdateSipServerTest(self): + """Test UpdateSipServerTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_update_voice_test.py b/tests_api/test/test_update_voice_test.py new file mode 100644 index 00000000..e3c3cdc4 --- /dev/null +++ b/tests_api/test/test_update_voice_test.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.update_voice_test import UpdateVoiceTest + +class TestUpdateVoiceTest(unittest.TestCase): + """UpdateVoiceTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateVoiceTest: + """Test UpdateVoiceTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateVoiceTest` + """ + model = UpdateVoiceTest() + if include_optional: + return UpdateVoiceTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [344753, 212697], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'voice', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + codec = 'G.711 @ 64 Kbps', + codec_id = '0', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + duration = 5, + jitter_buffer = 0, + num_path_traces = 3, + port = 1024, + target_agent_id = '281474976710706', + bgp_measurements = True + ) + else: + return UpdateVoiceTest( + interval = 120, + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + target_agent_id = '281474976710706', + ) + """ + + def testUpdateVoiceTest(self): + """Test UpdateVoiceTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_update_web_transaction_test.py b/tests_api/test/test_update_web_transaction_test.py new file mode 100644 index 00000000..a777c079 --- /dev/null +++ b/tests_api/test/test_update_web_transaction_test.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.update_web_transaction_test import UpdateWebTransactionTest + +class TestUpdateWebTransactionTest(unittest.TestCase): + """UpdateWebTransactionTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateWebTransactionTest: + """Test UpdateWebTransactionTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateWebTransactionTest` + """ + model = UpdateWebTransactionTest() + if include_optional: + return UpdateWebTransactionTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [344753, 212697], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'web-transactions', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [9842, 1283], + shared_with_accounts = [2087, 100], + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + credentials = [3247, 1051], + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + desired_status_code = '200', + follow_redirects = True, + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + target_time = 1, + time_limit = 5, + transaction_script = 'if (true) { return true; }', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + block_domains = 'domain.com/', + disable_screenshot = True, + allow_mic_and_camera = True, + allow_geolocation = True, + browser_language = 'en-US', + page_loading_strategy = 'normal', + fixed_packet_rate = 50, + bgp_measurements = True, + monitors = [17410, 5], + subinterval = 60 + ) + else: + return UpdateWebTransactionTest( + interval = 120, + agents = [ + {"agentId":"125","sourceIpAddress":"1.1.1.1"} + ], + transaction_script = 'if (true) { return true; }', + url = 'www.thousandeyes.com', + ) + """ + + def testUpdateWebTransactionTest(self): + """Test UpdateWebTransactionTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_voice_api.py b/tests_api/test/test_voice_api.py new file mode 100644 index 00000000..94ae0dba --- /dev/null +++ b/tests_api/test/test_voice_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.voice_api import VoiceApi + + +class TestVoiceApi(unittest.TestCase): + """VoiceApi unit test stubs""" + + def setUp(self) -> None: + self.api = VoiceApi() + + def tearDown(self) -> None: + pass + + def test_create_voice_test(self) -> None: + """Test case for create_voice_test + + Create Voice test + """ + pass + + def test_delete_voice_test(self) -> None: + """Test case for delete_voice_test + + Delete Voice test + """ + pass + + def test_get_voice_test(self) -> None: + """Test case for get_voice_test + + Get Voice test + """ + pass + + def test_get_voice_tests(self) -> None: + """Test case for get_voice_tests + + List Voice tests + """ + pass + + def test_update_voice_test(self) -> None: + """Test case for update_voice_test + + Update Voice test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_voice_instant_test.py b/tests_api/test/test_voice_instant_test.py new file mode 100644 index 00000000..a80e5833 --- /dev/null +++ b/tests_api/test/test_voice_instant_test.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.voice_instant_test import VoiceInstantTest + +class TestVoiceInstantTest(unittest.TestCase): + """VoiceInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VoiceInstantTest: + """Test VoiceInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VoiceInstantTest` + """ + model = VoiceInstantTest() + if include_optional: + return VoiceInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'voice', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + codec = 'G.711 @ 64 Kbps', + codec_id = '0', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + duration = 5, + jitter_buffer = 0, + num_path_traces = 3, + port = 1024, + target_agent_id = '281474976710706' + ) + else: + return VoiceInstantTest( + agents = [ + tests_api.models.agent.Agent() + ], + target_agent_id = '281474976710706', + ) + """ + + def testVoiceInstantTest(self): + """Test VoiceInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_voice_test.py b/tests_api/test/test_voice_test.py new file mode 100644 index 00000000..f71cab12 --- /dev/null +++ b/tests_api/test/test_voice_test.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.voice_test import VoiceTest + +class TestVoiceTest(unittest.TestCase): + """VoiceTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VoiceTest: + """Test VoiceTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VoiceTest` + """ + model = VoiceTest() + if include_optional: + return VoiceTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'voice', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + codec = 'G.711 @ 64 Kbps', + codec_id = '0', + dscp = 'Best Effort (DSCP 0)', + dscp_id = '0', + duration = 5, + jitter_buffer = 0, + num_path_traces = 3, + port = 1024, + target_agent_id = '281474976710706', + bgp_measurements = True + ) + else: + return VoiceTest( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + target_agent_id = '281474976710706', + ) + """ + + def testVoiceTest(self): + """Test VoiceTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_voice_tests.py b/tests_api/test/test_voice_tests.py new file mode 100644 index 00000000..632e2484 --- /dev/null +++ b/tests_api/test/test_voice_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.voice_tests import VoiceTests + +class TestVoiceTests(unittest.TestCase): + """VoiceTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VoiceTests: + """Test VoiceTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VoiceTests` + """ + model = VoiceTests() + if include_optional: + return VoiceTests( + tests = [ + null + ] + ) + else: + return VoiceTests( + ) + """ + + def testVoiceTests(self): + """Test VoiceTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_web_transaction_api.py b/tests_api/test/test_web_transaction_api.py new file mode 100644 index 00000000..e5db1f9e --- /dev/null +++ b/tests_api/test/test_web_transaction_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest + +from tests_api.api.web_transaction_api import WebTransactionApi + + +class TestWebTransactionApi(unittest.TestCase): + """WebTransactionApi unit test stubs""" + + def setUp(self) -> None: + self.api = WebTransactionApi() + + def tearDown(self) -> None: + pass + + def test_create_web_transactions_test(self) -> None: + """Test case for create_web_transactions_test + + Create Web Transactions test + """ + pass + + def test_delete_web_transactions_test(self) -> None: + """Test case for delete_web_transactions_test + + Delete Web Transactions test + """ + pass + + def test_get_web_transactions_test(self) -> None: + """Test case for get_web_transactions_test + + Get Web Transactions test + """ + pass + + def test_get_web_transactions_tests(self) -> None: + """Test case for get_web_transactions_tests + + List Web Transactions tests + """ + pass + + def test_update_web_transactions_test(self) -> None: + """Test case for update_web_transactions_test + + Update Web Transactions test + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_web_transaction_instant_test.py b/tests_api/test/test_web_transaction_instant_test.py new file mode 100644 index 00000000..b4b8f78f --- /dev/null +++ b/tests_api/test/test_web_transaction_instant_test.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.web_transaction_instant_test import WebTransactionInstantTest + +class TestWebTransactionInstantTest(unittest.TestCase): + """WebTransactionInstantTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebTransactionInstantTest: + """Test WebTransactionInstantTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebTransactionInstantTest` + """ + model = WebTransactionInstantTest() + if include_optional: + return WebTransactionInstantTest( + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'web-transactions', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + credentials = ["3247","1051"], + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + desired_status_code = '200', + follow_redirects = True, + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + target_time = 1, + time_limit = 5, + transaction_script = 'if (true) { return true; }', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + block_domains = 'domain.com/', + disable_screenshot = True, + allow_mic_and_camera = True, + allow_geolocation = True, + browser_language = 'en-US', + page_loading_strategy = 'normal', + fixed_packet_rate = 50 + ) + else: + return WebTransactionInstantTest( + agents = [ + tests_api.models.agent.Agent() + ], + transaction_script = 'if (true) { return true; }', + url = 'www.thousandeyes.com', + ) + """ + + def testWebTransactionInstantTest(self): + """Test WebTransactionInstantTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_web_transaction_test.py b/tests_api/test/test_web_transaction_test.py new file mode 100644 index 00000000..7ea2c640 --- /dev/null +++ b/tests_api/test/test_web_transaction_test.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.web_transaction_test import WebTransactionTest + +class TestWebTransactionTest(unittest.TestCase): + """WebTransactionTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebTransactionTest: + """Test WebTransactionTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebTransactionTest` + """ + model = WebTransactionTest() + if include_optional: + return WebTransactionTest( + interval = 120, + alerts_enabled = True, + enabled = True, + alert_rules = [ + tests_api.models.alert_rule.AlertRule( + rule_id = '127094', + rule_name = 'The End of the Internet', + expression = '((hops((hopDelay >= 100 ms))))', + direction = 'to-target', + is_default = True, + alert_type = 'http-server', + minimum_sources = 10, + minimum_sources_pct = 99, + rounds_violating_mode = 'exact', + rounds_violating_out_of = 5, + rounds_violating_required = 2, ) + ], + created_by = 'user@user.com', + created_date = '2022-07-17T22:00:54Z', + description = 'ThousandEyes Test', + live_share = False, + modified_by = 'user@user.com', + modified_date = '2022-07-17T22:00:54Z', + saved_event = True, + test_id = '281474976710706', + test_name = 'ThousandEyes Test', + type = 'web-transactions', + links = tests_api.models.unexpanded_instant_test__links.UnexpandedInstantTest__links( + self = null, + test_results = [{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/pathvis"}], ), + labels = [ + {"labelId":"961","name":"Artem label","isBuiltIn":false} + ], + shared_with_accounts = [ + tests_api.models.test_shared_accounts_inner.TestSharedAccounts_inner( + aid = '105', + name = 'Account name', ) + ], + agents = [ + tests_api.models.agent.Agent() + ], + auth_type = 'none', + bandwidth_measurements = True, + client_certificate = '-----BEGIN PRIVATE KEY----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +-----END CERTIFICATE----- +', + content_regex = '(regex)+', + credentials = [3247, 1051], + custom_headers = {"root":{"header1":"value1"},"domains":{"domain1.com":{"header2":"value2"}},"all":{"header3":"value3"}}, + desired_status_code = '200', + follow_redirects = True, + http_target_time = 100, + http_time_limit = 5, + http_version = 1, + include_headers = True, + mtu_measurements = False, + network_measurements = True, + num_path_traces = 3, + password = 'password', + path_trace_mode = 'classic', + probe_mode = 'auto', + protocol = 'tcp', + ssl_version = 'Auto', + ssl_version_id = '0', + target_time = 1, + time_limit = 5, + transaction_script = 'if (true) { return true; }', + url = 'www.thousandeyes.com', + use_ntlm = False, + user_agent = 'curl', + username = 'username', + verify_certificate = True, + block_domains = 'domain.com/', + disable_screenshot = True, + allow_mic_and_camera = True, + allow_geolocation = True, + browser_language = 'en-US', + page_loading_strategy = 'normal', + fixed_packet_rate = 50, + bgp_measurements = True, + monitors = [ + tests_api.models.monitor.Monitor( + country_id = 'GB', + monitor_id = '1234', + ip_address = '4.69.184.193', + network = 'Level 3 Communications, Inc. (AS 3356)', + monitor_type = 'public', + monitor_name = 'Seattle, WA', ) + ], + subinterval = 60 + ) + else: + return WebTransactionTest( + interval = 120, + agents = [ + tests_api.models.agent.Agent() + ], + transaction_script = 'if (true) { return true; }', + url = 'www.thousandeyes.com', + ) + """ + + def testWebTransactionTest(self): + """Test WebTransactionTest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/test/test_web_transaction_tests.py b/tests_api/test/test_web_transaction_tests.py new file mode 100644 index 00000000..997b6df6 --- /dev/null +++ b/tests_api/test/test_web_transaction_tests.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 unittest +import datetime + +from tests_api.models.web_transaction_tests import WebTransactionTests + +class TestWebTransactionTests(unittest.TestCase): + """WebTransactionTests unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebTransactionTests: + """Test WebTransactionTests + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebTransactionTests` + """ + model = WebTransactionTests() + if include_optional: + return WebTransactionTests( + tests = [ + null + ] + ) + else: + return WebTransactionTests( + ) + """ + + def testWebTransactionTests(self): + """Test WebTransactionTests""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests_api/tests_api/__init__.py b/tests_api/tests_api/__init__.py new file mode 100644 index 00000000..fb399dd3 --- /dev/null +++ b/tests_api/tests_api/__init__.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.api.agent_to_agent_api import AgentToAgentApi +from tests_api.api.agent_to_server_api import AgentToServerApi +from tests_api.api.all_test_types_api import AllTestTypesApi +from tests_api.api.bgp_api import BGPApi +from tests_api.api.dnssec_api import DNSSECApi +from tests_api.api.dns_server_api import DNSServerApi +from tests_api.api.dns_trace_api import DNSTraceApi +from tests_api.api.ftp_server_api import FTPServerApi +from tests_api.api.http_server_api import HTTPServerApi +from tests_api.api.page_load_api import PageLoadApi +from tests_api.api.path_visualization_interface_groups_api import PathVisualizationInterfaceGroupsApi +from tests_api.api.sip_server_api import SIPServerApi +from tests_api.api.voice_api import VoiceApi +from tests_api.api.web_transaction_api import WebTransactionApi + +# import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.api_client import ApiClient +from tests_api.configuration import Configuration +from tests_api.exceptions import OpenApiException +from tests_api.exceptions import ApiTypeError +from tests_api.exceptions import ApiValueError +from tests_api.exceptions import ApiKeyError +from tests_api.exceptions import ApiAttributeError +from tests_api.exceptions import ApiException + +# import models into sdk package +from tests_api.models.agent import Agent +from tests_api.models.agent_base import AgentBase +from tests_api.models.agent_to_agent_instant_test import AgentToAgentInstantTest +from tests_api.models.agent_to_agent_test import AgentToAgentTest +from tests_api.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from tests_api.models.agent_to_agent_tests import AgentToAgentTests +from tests_api.models.agent_to_server_instant_test import AgentToServerInstantTest +from tests_api.models.agent_to_server_test import AgentToServerTest +from tests_api.models.agent_to_server_tests import AgentToServerTests +from tests_api.models.alert_rounds_violation_mode import AlertRoundsViolationMode +from tests_api.models.alert_rule import AlertRule +from tests_api.models.alert_type import AlertType +from tests_api.models.base_request import BaseRequest +from tests_api.models.base_test import BaseTest +from tests_api.models.bgp_test import BgpTest +from tests_api.models.bgp_tests import BgpTests +from tests_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.dns_sec_instant_test import DnsSecInstantTest +from tests_api.models.dns_sec_test import DnsSecTest +from tests_api.models.dns_sec_tests import DnsSecTests +from tests_api.models.dns_server_instant_test import DnsServerInstantTest +from tests_api.models.dns_server_test import DnsServerTest +from tests_api.models.dns_server_tests import DnsServerTests +from tests_api.models.dns_trace_instant_test import DnsTraceInstantTest +from tests_api.models.dns_trace_test import DnsTraceTest +from tests_api.models.dns_trace_tests import DnsTraceTests +from tests_api.models.error import Error +from tests_api.models.expand import Expand +from tests_api.models.ftp_server_instant_test import FtpServerInstantTest +from tests_api.models.ftp_server_request_type import FtpServerRequestType +from tests_api.models.ftp_server_test import FtpServerTest +from tests_api.models.ftp_server_tests import FtpServerTests +from tests_api.models.get_agent_to_agent_test200_response import GetAgentToAgentTest200Response +from tests_api.models.get_agent_to_agent_tests200_response import GetAgentToAgentTests200Response +from tests_api.models.get_agent_to_server_test200_response import GetAgentToServerTest200Response +from tests_api.models.get_agent_to_server_tests200_response import GetAgentToServerTests200Response +from tests_api.models.get_bgp_test200_response import GetBgpTest200Response +from tests_api.models.get_bgp_tests200_response import GetBgpTests200Response +from tests_api.models.get_dns_server_test200_response import GetDNSServerTest200Response +from tests_api.models.get_dns_server_tests200_response import GetDNSServerTests200Response +from tests_api.models.get_dns_sec_test200_response import GetDnsSecTest200Response +from tests_api.models.get_dns_sec_tests200_response import GetDnsSecTests200Response +from tests_api.models.get_dns_trace_test200_response import GetDnsTraceTest200Response +from tests_api.models.get_dns_trace_tests200_response import GetDnsTraceTests200Response +from tests_api.models.get_ftp_server_test200_response import GetFtpServerTest200Response +from tests_api.models.get_ftp_server_tests200_response import GetFtpServerTests200Response +from tests_api.models.get_http_server_test200_response import GetHttpServerTest200Response +from tests_api.models.get_http_server_tests200_response import GetHttpServerTests200Response +from tests_api.models.get_page_load_test200_response import GetPageLoadTest200Response +from tests_api.models.get_page_load_tests200_response import GetPageLoadTests200Response +from tests_api.models.get_path_vis_interface_groups200_response import GetPathVisInterfaceGroups200Response +from tests_api.models.get_sip_server_test200_response import GetSipServerTest200Response +from tests_api.models.get_sip_server_tests200_response import GetSipServerTests200Response +from tests_api.models.get_tests200_response import GetTests200Response +from tests_api.models.get_voice_test200_response import GetVoiceTest200Response +from tests_api.models.get_voice_tests200_response import GetVoiceTests200Response +from tests_api.models.get_web_transactions_test200_response import GetWebTransactionsTest200Response +from tests_api.models.get_web_transactions_tests200_response import GetWebTransactionsTests200Response +from tests_api.models.http_server_instant_test import HttpServerInstantTest +from tests_api.models.http_server_test import HttpServerTest +from tests_api.models.http_server_tests import HttpServerTests +from tests_api.models.instant_test import InstantTest +from tests_api.models.interface_group import InterfaceGroup +from tests_api.models.interface_groups import InterfaceGroups +from tests_api.models.link import Link +from tests_api.models.map_item import MapItem +from tests_api.models.monitor import Monitor +from tests_api.models.monitor_type import MonitorType +from tests_api.models.monitors_request import MonitorsRequest +from tests_api.models.page_load_instant_test import PageLoadInstantTest +from tests_api.models.page_load_test import PageLoadTest +from tests_api.models.page_load_tests import PageLoadTests +from tests_api.models.self_links import SelfLinks +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.simple_test import SimpleTest +from tests_api.models.sip_server_instant_test import SipServerInstantTest +from tests_api.models.sip_server_test import SipServerTest +from tests_api.models.sip_server_tests import SipServerTests +from tests_api.models.sip_test_protocol import SipTestProtocol +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_custom_headers_all import TestCustomHeadersAll +from tests_api.models.test_custom_headers_root import TestCustomHeadersRoot +from tests_api.models.test_direction import TestDirection +from tests_api.models.test_dns_server import TestDnsServer +from tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_http_interval import TestHttpInterval +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_request import TestRequest +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_sip_credentials import TestSipCredentials +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.test_sub_interval import TestSubInterval +from tests_api.models.test_type import TestType +from tests_api.models.tests import Tests +from tests_api.models.unauthorized_error import UnauthorizedError +from tests_api.models.unexpanded_instant_test import UnexpandedInstantTest +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +from tests_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf +from tests_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults +from tests_api.models.unexpanded_test import UnexpandedTest +from tests_api.models.update_agent_to_agent_test import UpdateAgentToAgentTest +from tests_api.models.update_agent_to_server_test import UpdateAgentToServerTest +from tests_api.models.update_bgp_test import UpdateBgpTest +from tests_api.models.update_dns_sec_test import UpdateDnsSecTest +from tests_api.models.update_dns_server_test import UpdateDnsServerTest +from tests_api.models.update_dns_trace_test import UpdateDnsTraceTest +from tests_api.models.update_ftp_server_test import UpdateFtpServerTest +from tests_api.models.update_http_server_test import UpdateHttpServerTest +from tests_api.models.update_page_load_test import UpdatePageLoadTest +from tests_api.models.update_path_vis_interface_group200_response import UpdatePathVisInterfaceGroup200Response +from tests_api.models.update_sip_server_test import UpdateSipServerTest +from tests_api.models.update_voice_test import UpdateVoiceTest +from tests_api.models.update_web_transaction_test import UpdateWebTransactionTest +from tests_api.models.voice_instant_test import VoiceInstantTest +from tests_api.models.voice_test import VoiceTest +from tests_api.models.voice_tests import VoiceTests +from tests_api.models.web_transaction_instant_test import WebTransactionInstantTest +from tests_api.models.web_transaction_test import WebTransactionTest +from tests_api.models.web_transaction_tests import WebTransactionTests diff --git a/tests_api/tests_api/api/__init__.py b/tests_api/tests_api/api/__init__.py new file mode 100644 index 00000000..b09ffe56 --- /dev/null +++ b/tests_api/tests_api/api/__init__.py @@ -0,0 +1,18 @@ +# flake8: noqa + +# import apis into api package +from tests_api.api.agent_to_agent_api import AgentToAgentApi +from tests_api.api.agent_to_server_api import AgentToServerApi +from tests_api.api.all_test_types_api import AllTestTypesApi +from tests_api.api.bgp_api import BGPApi +from tests_api.api.dnssec_api import DNSSECApi +from tests_api.api.dns_server_api import DNSServerApi +from tests_api.api.dns_trace_api import DNSTraceApi +from tests_api.api.ftp_server_api import FTPServerApi +from tests_api.api.http_server_api import HTTPServerApi +from tests_api.api.page_load_api import PageLoadApi +from tests_api.api.path_visualization_interface_groups_api import PathVisualizationInterfaceGroupsApi +from tests_api.api.sip_server_api import SIPServerApi +from tests_api.api.voice_api import VoiceApi +from tests_api.api.web_transaction_api import WebTransactionApi + diff --git a/tests_api/tests_api/api/agent_to_agent_api.py b/tests_api/tests_api/api/agent_to_agent_api.py new file mode 100644 index 00000000..7ea3d640 --- /dev/null +++ b/tests_api/tests_api/api/agent_to_agent_api.py @@ -0,0 +1,1620 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.agent_to_agent_test import AgentToAgentTest +from tests_api.models.expand import Expand +from tests_api.models.get_agent_to_agent_test200_response import GetAgentToAgentTest200Response +from tests_api.models.get_agent_to_agent_tests200_response import GetAgentToAgentTests200Response +from tests_api.models.update_agent_to_agent_test import UpdateAgentToAgentTest + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class AgentToAgentApi: + """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 create_agent_to_agent_test( + self, + update_agent_to_agent_test: UpdateAgentToAgentTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> AgentToAgentTest: + """Create Agent to Agent test + + Creates a new Agent to Agent test. This method requires Account Admin permissions. + + :param update_agent_to_agent_test: (required) + :type update_agent_to_agent_test: UpdateAgentToAgentTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_agent_to_agent_test_serialize( + update_agent_to_agent_test=update_agent_to_agent_test, + 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]] = { + '201': "AgentToAgentTest", + '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 create_agent_to_agent_test_with_http_info( + self, + update_agent_to_agent_test: UpdateAgentToAgentTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[AgentToAgentTest]: + """Create Agent to Agent test + + Creates a new Agent to Agent test. This method requires Account Admin permissions. + + :param update_agent_to_agent_test: (required) + :type update_agent_to_agent_test: UpdateAgentToAgentTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_agent_to_agent_test_serialize( + update_agent_to_agent_test=update_agent_to_agent_test, + 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]] = { + '201': "AgentToAgentTest", + '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 create_agent_to_agent_test_without_preload_content( + self, + update_agent_to_agent_test: UpdateAgentToAgentTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Create Agent to Agent test + + Creates a new Agent to Agent test. This method requires Account Admin permissions. + + :param update_agent_to_agent_test: (required) + :type update_agent_to_agent_test: UpdateAgentToAgentTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_agent_to_agent_test_serialize( + update_agent_to_agent_test=update_agent_to_agent_test, + 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]] = { + '201': "AgentToAgentTest", + '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 _create_agent_to_agent_test_serialize( + self, + update_agent_to_agent_test, + 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 + # 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 update_agent_to_agent_test is not None: + _body_params = update_agent_to_agent_test + + + # 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/tests/agent-to-agent', + 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 delete_agent_to_agent_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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, + ) -> None: + """Delete Agent to Agent test + + Deletes the specified Agent to Agent test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_agent_to_agent_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_agent_to_agent_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[None]: + """Delete Agent to Agent test + + Deletes the specified Agent to Agent test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_agent_to_agent_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_agent_to_agent_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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: + """Delete Agent to Agent test + + Deletes the specified Agent to Agent test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_agent_to_agent_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_agent_to_agent_test_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/tests/agent-to-agent/{testId}', + 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_agent_to_agent_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetAgentToAgentTest200Response: + """Get Agent to Agent test + + Returns details for a Agent to Agent test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_to_agent_test_serialize( + test_id=test_id, + 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': "GetAgentToAgentTest200Response", + '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_to_agent_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetAgentToAgentTest200Response]: + """Get Agent to Agent test + + Returns details for a Agent to Agent test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_to_agent_test_serialize( + test_id=test_id, + 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': "GetAgentToAgentTest200Response", + '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_to_agent_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Get Agent to Agent test + + Returns details for a Agent to Agent test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_to_agent_test_serialize( + test_id=test_id, + 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': "GetAgentToAgentTest200Response", + '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_to_agent_test_serialize( + self, + test_id, + 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 test_id is not None: + _path_params['testId'] = test_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 + + + # 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/tests/agent-to-agent/{testId}', + 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_agent_to_agent_tests( + 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, + ) -> GetAgentToAgentTests200Response: + """List Agent to Agent tests + + Returns a list of Agent to Agent tests and saved events. + + :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_to_agent_tests_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': "GetAgentToAgentTests200Response", + '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_to_agent_tests_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[GetAgentToAgentTests200Response]: + """List Agent to Agent tests + + Returns a list of Agent to Agent tests and saved events. + + :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_to_agent_tests_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': "GetAgentToAgentTests200Response", + '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_to_agent_tests_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 to Agent tests + + Returns a list of Agent to Agent tests and saved events. + + :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_to_agent_tests_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': "GetAgentToAgentTests200Response", + '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_to_agent_tests_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/tests/agent-to-agent', + 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 update_agent_to_agent_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_agent_to_agent_test: UpdateAgentToAgentTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetAgentToAgentTest200Response: + """Update Agent to Agent test + + Updates a Agent to Agent test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_agent_to_agent_test: (required) + :type update_agent_to_agent_test: UpdateAgentToAgentTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_agent_to_agent_test_serialize( + test_id=test_id, + update_agent_to_agent_test=update_agent_to_agent_test, + 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': "GetAgentToAgentTest200Response", + '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 update_agent_to_agent_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_agent_to_agent_test: UpdateAgentToAgentTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetAgentToAgentTest200Response]: + """Update Agent to Agent test + + Updates a Agent to Agent test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_agent_to_agent_test: (required) + :type update_agent_to_agent_test: UpdateAgentToAgentTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_agent_to_agent_test_serialize( + test_id=test_id, + update_agent_to_agent_test=update_agent_to_agent_test, + 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': "GetAgentToAgentTest200Response", + '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 update_agent_to_agent_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_agent_to_agent_test: UpdateAgentToAgentTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Update Agent to Agent test + + Updates a Agent to Agent test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_agent_to_agent_test: (required) + :type update_agent_to_agent_test: UpdateAgentToAgentTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_agent_to_agent_test_serialize( + test_id=test_id, + update_agent_to_agent_test=update_agent_to_agent_test, + 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': "GetAgentToAgentTest200Response", + '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 _update_agent_to_agent_test_serialize( + self, + test_id, + update_agent_to_agent_test, + 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 test_id is not None: + _path_params['testId'] = test_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 update_agent_to_agent_test is not None: + _body_params = update_agent_to_agent_test + + + # 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='PUT', + resource_path='/v7/tests/agent-to-agent/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api/agent_to_server_api.py b/tests_api/tests_api/api/agent_to_server_api.py new file mode 100644 index 00000000..bed19f70 --- /dev/null +++ b/tests_api/tests_api/api/agent_to_server_api.py @@ -0,0 +1,1620 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.agent_to_server_test import AgentToServerTest +from tests_api.models.expand import Expand +from tests_api.models.get_agent_to_server_test200_response import GetAgentToServerTest200Response +from tests_api.models.get_agent_to_server_tests200_response import GetAgentToServerTests200Response +from tests_api.models.update_agent_to_server_test import UpdateAgentToServerTest + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class AgentToServerApi: + """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 create_agent_to_server_test( + self, + update_agent_to_server_test: UpdateAgentToServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> AgentToServerTest: + """Create Agent to Server test + + Creates a new Agent to Server test. This method requires Account Admin permissions. + + :param update_agent_to_server_test: (required) + :type update_agent_to_server_test: UpdateAgentToServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_agent_to_server_test_serialize( + update_agent_to_server_test=update_agent_to_server_test, + 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]] = { + '201': "AgentToServerTest", + '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 create_agent_to_server_test_with_http_info( + self, + update_agent_to_server_test: UpdateAgentToServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[AgentToServerTest]: + """Create Agent to Server test + + Creates a new Agent to Server test. This method requires Account Admin permissions. + + :param update_agent_to_server_test: (required) + :type update_agent_to_server_test: UpdateAgentToServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_agent_to_server_test_serialize( + update_agent_to_server_test=update_agent_to_server_test, + 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]] = { + '201': "AgentToServerTest", + '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 create_agent_to_server_test_without_preload_content( + self, + update_agent_to_server_test: UpdateAgentToServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Create Agent to Server test + + Creates a new Agent to Server test. This method requires Account Admin permissions. + + :param update_agent_to_server_test: (required) + :type update_agent_to_server_test: UpdateAgentToServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_agent_to_server_test_serialize( + update_agent_to_server_test=update_agent_to_server_test, + 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]] = { + '201': "AgentToServerTest", + '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 _create_agent_to_server_test_serialize( + self, + update_agent_to_server_test, + 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 + # 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 update_agent_to_server_test is not None: + _body_params = update_agent_to_server_test + + + # 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/tests/agent-to-server', + 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 delete_agent_to_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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, + ) -> None: + """Delete Agent to Server test + + Deletes an Agent to Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_agent_to_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_agent_to_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[None]: + """Delete Agent to Server test + + Deletes an Agent to Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_agent_to_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_agent_to_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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: + """Delete Agent to Server test + + Deletes an Agent to Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_agent_to_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_agent_to_server_test_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/tests/agent-to-server/{testId}', + 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_agent_to_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetAgentToServerTest200Response: + """Get Agent to Server test + + Returns details for a Agent to Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_to_server_test_serialize( + test_id=test_id, + 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': "GetAgentToServerTest200Response", + '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_to_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetAgentToServerTest200Response]: + """Get Agent to Server test + + Returns details for a Agent to Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_to_server_test_serialize( + test_id=test_id, + 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': "GetAgentToServerTest200Response", + '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_to_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Get Agent to Server test + + Returns details for a Agent to Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_to_server_test_serialize( + test_id=test_id, + 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': "GetAgentToServerTest200Response", + '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_to_server_test_serialize( + self, + test_id, + 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 test_id is not None: + _path_params['testId'] = test_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 + + + # 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/tests/agent-to-server/{testId}', + 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_agent_to_server_tests( + 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, + ) -> GetAgentToServerTests200Response: + """List Agent to Server tests + + Returns a list of Agent to Server tests and saved events. + + :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_to_server_tests_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': "GetAgentToServerTests200Response", + '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_to_server_tests_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[GetAgentToServerTests200Response]: + """List Agent to Server tests + + Returns a list of Agent to Server tests and saved events. + + :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_to_server_tests_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': "GetAgentToServerTests200Response", + '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_to_server_tests_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 to Server tests + + Returns a list of Agent to Server tests and saved events. + + :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_to_server_tests_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': "GetAgentToServerTests200Response", + '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_to_server_tests_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/tests/agent-to-server', + 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 update_agent_to_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_agent_to_server_test: UpdateAgentToServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetAgentToServerTest200Response: + """Update Agent to Server test + + Updates an Agent to Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_agent_to_server_test: (required) + :type update_agent_to_server_test: UpdateAgentToServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_agent_to_server_test_serialize( + test_id=test_id, + update_agent_to_server_test=update_agent_to_server_test, + 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': "GetAgentToServerTest200Response", + '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 update_agent_to_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_agent_to_server_test: UpdateAgentToServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetAgentToServerTest200Response]: + """Update Agent to Server test + + Updates an Agent to Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_agent_to_server_test: (required) + :type update_agent_to_server_test: UpdateAgentToServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_agent_to_server_test_serialize( + test_id=test_id, + update_agent_to_server_test=update_agent_to_server_test, + 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': "GetAgentToServerTest200Response", + '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 update_agent_to_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_agent_to_server_test: UpdateAgentToServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Update Agent to Server test + + Updates an Agent to Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_agent_to_server_test: (required) + :type update_agent_to_server_test: UpdateAgentToServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_agent_to_server_test_serialize( + test_id=test_id, + update_agent_to_server_test=update_agent_to_server_test, + 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': "GetAgentToServerTest200Response", + '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 _update_agent_to_server_test_serialize( + self, + test_id, + update_agent_to_server_test, + 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 test_id is not None: + _path_params['testId'] = test_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 update_agent_to_server_test is not None: + _body_params = update_agent_to_server_test + + + # 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='PUT', + resource_path='/v7/tests/agent-to-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api/all_test_types_api.py b/tests_api/tests_api/api/all_test_types_api.py new file mode 100644 index 00000000..74f50cfd --- /dev/null +++ b/tests_api/tests_api/api/all_test_types_api.py @@ -0,0 +1,335 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.get_tests200_response import GetTests200Response + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class AllTestTypesApi: + """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_tests( + 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, + ) -> GetTests200Response: + """List configured tests + + Returns configured tests and saved events. + + :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_tests_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': "GetTests200Response", + '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_tests_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[GetTests200Response]: + """List configured tests + + Returns configured tests and saved events. + + :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_tests_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': "GetTests200Response", + '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_tests_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 configured tests + + Returns configured tests and saved events. + + :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_tests_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': "GetTests200Response", + '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_tests_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/tests', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api/bgp_api.py b/tests_api/tests_api/api/bgp_api.py new file mode 100644 index 00000000..b85675b3 --- /dev/null +++ b/tests_api/tests_api/api/bgp_api.py @@ -0,0 +1,1620 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.bgp_test import BgpTest +from tests_api.models.expand import Expand +from tests_api.models.get_bgp_test200_response import GetBgpTest200Response +from tests_api.models.get_bgp_tests200_response import GetBgpTests200Response +from tests_api.models.update_bgp_test import UpdateBgpTest + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class BGPApi: + """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 create_bgp_test( + self, + update_bgp_test: UpdateBgpTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> BgpTest: + """Create BGP test + + Creates a new BGP test. This method requires Account Admin permissions. + + :param update_bgp_test: (required) + :type update_bgp_test: UpdateBgpTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_bgp_test_serialize( + update_bgp_test=update_bgp_test, + 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]] = { + '201': "BgpTest", + '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 create_bgp_test_with_http_info( + self, + update_bgp_test: UpdateBgpTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[BgpTest]: + """Create BGP test + + Creates a new BGP test. This method requires Account Admin permissions. + + :param update_bgp_test: (required) + :type update_bgp_test: UpdateBgpTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_bgp_test_serialize( + update_bgp_test=update_bgp_test, + 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]] = { + '201': "BgpTest", + '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 create_bgp_test_without_preload_content( + self, + update_bgp_test: UpdateBgpTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Create BGP test + + Creates a new BGP test. This method requires Account Admin permissions. + + :param update_bgp_test: (required) + :type update_bgp_test: UpdateBgpTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_bgp_test_serialize( + update_bgp_test=update_bgp_test, + 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]] = { + '201': "BgpTest", + '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 _create_bgp_test_serialize( + self, + update_bgp_test, + 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 + # 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 update_bgp_test is not None: + _body_params = update_bgp_test + + + # 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/tests/bgp', + 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 delete_bgp_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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, + ) -> None: + """Delete BGP test + + Deletes a BGP test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_bgp_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_bgp_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[None]: + """Delete BGP test + + Deletes a BGP test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_bgp_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_bgp_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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: + """Delete BGP test + + Deletes a BGP test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_bgp_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_bgp_test_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/tests/bgp/{testId}', + 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_bgp_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetBgpTest200Response: + """Get BGP test + + Returns details for a BGP test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_bgp_test_serialize( + test_id=test_id, + 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': "GetBgpTest200Response", + '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_bgp_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetBgpTest200Response]: + """Get BGP test + + Returns details for a BGP test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_bgp_test_serialize( + test_id=test_id, + 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': "GetBgpTest200Response", + '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_bgp_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Get BGP test + + Returns details for a BGP test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_bgp_test_serialize( + test_id=test_id, + 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': "GetBgpTest200Response", + '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_bgp_test_serialize( + self, + test_id, + 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 test_id is not None: + _path_params['testId'] = test_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 + + + # 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/tests/bgp/{testId}', + 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_bgp_tests( + 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, + ) -> GetBgpTests200Response: + """List BGP tests + + Returns a list of BGP tests and saved events. + + :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_bgp_tests_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': "GetBgpTests200Response", + '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_bgp_tests_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[GetBgpTests200Response]: + """List BGP tests + + Returns a list of BGP tests and saved events. + + :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_bgp_tests_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': "GetBgpTests200Response", + '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_bgp_tests_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 BGP tests + + Returns a list of BGP tests and saved events. + + :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_bgp_tests_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': "GetBgpTests200Response", + '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_bgp_tests_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/tests/bgp', + 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 update_bgp_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_bgp_test: UpdateBgpTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetBgpTest200Response: + """Update BGP test + + Updates a BGP test. This method requires Account Admin permissions. The target test cannot be a live share or saved event. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_bgp_test: (required) + :type update_bgp_test: UpdateBgpTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_bgp_test_serialize( + test_id=test_id, + update_bgp_test=update_bgp_test, + 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': "GetBgpTest200Response", + '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 update_bgp_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_bgp_test: UpdateBgpTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetBgpTest200Response]: + """Update BGP test + + Updates a BGP test. This method requires Account Admin permissions. The target test cannot be a live share or saved event. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_bgp_test: (required) + :type update_bgp_test: UpdateBgpTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_bgp_test_serialize( + test_id=test_id, + update_bgp_test=update_bgp_test, + 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': "GetBgpTest200Response", + '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 update_bgp_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_bgp_test: UpdateBgpTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Update BGP test + + Updates a BGP test. This method requires Account Admin permissions. The target test cannot be a live share or saved event. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_bgp_test: (required) + :type update_bgp_test: UpdateBgpTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_bgp_test_serialize( + test_id=test_id, + update_bgp_test=update_bgp_test, + 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': "GetBgpTest200Response", + '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 _update_bgp_test_serialize( + self, + test_id, + update_bgp_test, + 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 test_id is not None: + _path_params['testId'] = test_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 update_bgp_test is not None: + _body_params = update_bgp_test + + + # 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='PUT', + resource_path='/v7/tests/bgp/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api/dns_server_api.py b/tests_api/tests_api/api/dns_server_api.py new file mode 100644 index 00000000..46ce782d --- /dev/null +++ b/tests_api/tests_api/api/dns_server_api.py @@ -0,0 +1,1620 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.dns_server_test import DnsServerTest +from tests_api.models.expand import Expand +from tests_api.models.get_dns_server_test200_response import GetDNSServerTest200Response +from tests_api.models.get_dns_server_tests200_response import GetDNSServerTests200Response +from tests_api.models.update_dns_server_test import UpdateDnsServerTest + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class DNSServerApi: + """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 create_dns_server_test( + self, + update_dns_server_test: UpdateDnsServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> DnsServerTest: + """Create DNS Server test + + Creates a new DNS Server test. This method requires Account Admin permissions. + + :param update_dns_server_test: (required) + :type update_dns_server_test: UpdateDnsServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_dns_server_test_serialize( + update_dns_server_test=update_dns_server_test, + 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]] = { + '201': "DnsServerTest", + '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 create_dns_server_test_with_http_info( + self, + update_dns_server_test: UpdateDnsServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[DnsServerTest]: + """Create DNS Server test + + Creates a new DNS Server test. This method requires Account Admin permissions. + + :param update_dns_server_test: (required) + :type update_dns_server_test: UpdateDnsServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_dns_server_test_serialize( + update_dns_server_test=update_dns_server_test, + 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]] = { + '201': "DnsServerTest", + '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 create_dns_server_test_without_preload_content( + self, + update_dns_server_test: UpdateDnsServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Create DNS Server test + + Creates a new DNS Server test. This method requires Account Admin permissions. + + :param update_dns_server_test: (required) + :type update_dns_server_test: UpdateDnsServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_dns_server_test_serialize( + update_dns_server_test=update_dns_server_test, + 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]] = { + '201': "DnsServerTest", + '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 _create_dns_server_test_serialize( + self, + update_dns_server_test, + 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 + # 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 update_dns_server_test is not None: + _body_params = update_dns_server_test + + + # 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/tests/dns-server', + 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 delete_dns_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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, + ) -> None: + """Delete DNS Server test + + Deletes the specified DNS Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_dns_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_dns_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[None]: + """Delete DNS Server test + + Deletes the specified DNS Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_dns_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_dns_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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: + """Delete DNS Server test + + Deletes the specified DNS Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_dns_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_dns_server_test_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/tests/dns-server/{testId}', + 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_dns_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetDNSServerTest200Response: + """Get DNS Server test + + Returns details for a DNS Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_dns_server_test_serialize( + test_id=test_id, + 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': "GetDNSServerTest200Response", + '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_dns_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetDNSServerTest200Response]: + """Get DNS Server test + + Returns details for a DNS Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_dns_server_test_serialize( + test_id=test_id, + 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': "GetDNSServerTest200Response", + '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_dns_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Get DNS Server test + + Returns details for a DNS Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_dns_server_test_serialize( + test_id=test_id, + 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': "GetDNSServerTest200Response", + '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_dns_server_test_serialize( + self, + test_id, + 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 test_id is not None: + _path_params['testId'] = test_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 + + + # 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/tests/dns-server/{testId}', + 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_dns_server_tests( + 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, + ) -> GetDNSServerTests200Response: + """List DNS Server tests + + Returns a list of all DNS Server tests and saved events. + + :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_dns_server_tests_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': "GetDNSServerTests200Response", + '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_dns_server_tests_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[GetDNSServerTests200Response]: + """List DNS Server tests + + Returns a list of all DNS Server tests and saved events. + + :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_dns_server_tests_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': "GetDNSServerTests200Response", + '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_dns_server_tests_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 DNS Server tests + + Returns a list of all DNS Server tests and saved events. + + :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_dns_server_tests_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': "GetDNSServerTests200Response", + '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_dns_server_tests_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/tests/dns-server', + 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 update_dns_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_dns_server_test: UpdateDnsServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetDNSServerTest200Response: + """Update DNS Server test + + Updates a DNS Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_dns_server_test: (required) + :type update_dns_server_test: UpdateDnsServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_dns_server_test_serialize( + test_id=test_id, + update_dns_server_test=update_dns_server_test, + 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': "GetDNSServerTest200Response", + '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 update_dns_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_dns_server_test: UpdateDnsServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetDNSServerTest200Response]: + """Update DNS Server test + + Updates a DNS Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_dns_server_test: (required) + :type update_dns_server_test: UpdateDnsServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_dns_server_test_serialize( + test_id=test_id, + update_dns_server_test=update_dns_server_test, + 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': "GetDNSServerTest200Response", + '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 update_dns_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_dns_server_test: UpdateDnsServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Update DNS Server test + + Updates a DNS Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_dns_server_test: (required) + :type update_dns_server_test: UpdateDnsServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_dns_server_test_serialize( + test_id=test_id, + update_dns_server_test=update_dns_server_test, + 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': "GetDNSServerTest200Response", + '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 _update_dns_server_test_serialize( + self, + test_id, + update_dns_server_test, + 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 test_id is not None: + _path_params['testId'] = test_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 update_dns_server_test is not None: + _body_params = update_dns_server_test + + + # 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='PUT', + resource_path='/v7/tests/dns-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api/dns_trace_api.py b/tests_api/tests_api/api/dns_trace_api.py new file mode 100644 index 00000000..8cfb4929 --- /dev/null +++ b/tests_api/tests_api/api/dns_trace_api.py @@ -0,0 +1,1620 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.dns_trace_test import DnsTraceTest +from tests_api.models.expand import Expand +from tests_api.models.get_dns_trace_test200_response import GetDnsTraceTest200Response +from tests_api.models.get_dns_trace_tests200_response import GetDnsTraceTests200Response +from tests_api.models.update_dns_trace_test import UpdateDnsTraceTest + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class DNSTraceApi: + """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 create_dns_trace_test( + self, + update_dns_trace_test: UpdateDnsTraceTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> DnsTraceTest: + """Create DNS Trace test + + Creates a new DNS Trace test. This method requires Account Admin permissions. + + :param update_dns_trace_test: (required) + :type update_dns_trace_test: UpdateDnsTraceTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_dns_trace_test_serialize( + update_dns_trace_test=update_dns_trace_test, + 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]] = { + '201': "DnsTraceTest", + '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 create_dns_trace_test_with_http_info( + self, + update_dns_trace_test: UpdateDnsTraceTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[DnsTraceTest]: + """Create DNS Trace test + + Creates a new DNS Trace test. This method requires Account Admin permissions. + + :param update_dns_trace_test: (required) + :type update_dns_trace_test: UpdateDnsTraceTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_dns_trace_test_serialize( + update_dns_trace_test=update_dns_trace_test, + 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]] = { + '201': "DnsTraceTest", + '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 create_dns_trace_test_without_preload_content( + self, + update_dns_trace_test: UpdateDnsTraceTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Create DNS Trace test + + Creates a new DNS Trace test. This method requires Account Admin permissions. + + :param update_dns_trace_test: (required) + :type update_dns_trace_test: UpdateDnsTraceTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_dns_trace_test_serialize( + update_dns_trace_test=update_dns_trace_test, + 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]] = { + '201': "DnsTraceTest", + '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 _create_dns_trace_test_serialize( + self, + update_dns_trace_test, + 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 + # 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 update_dns_trace_test is not None: + _body_params = update_dns_trace_test + + + # 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/tests/dns-trace', + 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 delete_dns_trace_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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, + ) -> None: + """Delete DNS Trace test + + Deletes the specified DNS Trace test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_dns_trace_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_dns_trace_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[None]: + """Delete DNS Trace test + + Deletes the specified DNS Trace test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_dns_trace_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_dns_trace_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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: + """Delete DNS Trace test + + Deletes the specified DNS Trace test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_dns_trace_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_dns_trace_test_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/tests/dns-trace/{testId}', + 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_dns_trace_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetDnsTraceTest200Response: + """Get DNS Trace test + + Returns details for a DNS Trace test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_dns_trace_test_serialize( + test_id=test_id, + 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': "GetDnsTraceTest200Response", + '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_dns_trace_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetDnsTraceTest200Response]: + """Get DNS Trace test + + Returns details for a DNS Trace test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_dns_trace_test_serialize( + test_id=test_id, + 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': "GetDnsTraceTest200Response", + '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_dns_trace_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Get DNS Trace test + + Returns details for a DNS Trace test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_dns_trace_test_serialize( + test_id=test_id, + 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': "GetDnsTraceTest200Response", + '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_dns_trace_test_serialize( + self, + test_id, + 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 test_id is not None: + _path_params['testId'] = test_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 + + + # 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/tests/dns-trace/{testId}', + 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_dns_trace_tests( + 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, + ) -> GetDnsTraceTests200Response: + """List DNS Trace tests + + Returns a list of all DNS Trace tests and saved events. + + :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_dns_trace_tests_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': "GetDnsTraceTests200Response", + '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_dns_trace_tests_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[GetDnsTraceTests200Response]: + """List DNS Trace tests + + Returns a list of all DNS Trace tests and saved events. + + :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_dns_trace_tests_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': "GetDnsTraceTests200Response", + '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_dns_trace_tests_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 DNS Trace tests + + Returns a list of all DNS Trace tests and saved events. + + :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_dns_trace_tests_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': "GetDnsTraceTests200Response", + '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_dns_trace_tests_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/tests/dns-trace', + 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 update_dns_trace_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_dns_trace_test: UpdateDnsTraceTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetDnsTraceTest200Response: + """Update DNS Trace test + + Updates a DNS Trace test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_dns_trace_test: (required) + :type update_dns_trace_test: UpdateDnsTraceTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_dns_trace_test_serialize( + test_id=test_id, + update_dns_trace_test=update_dns_trace_test, + 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': "GetDnsTraceTest200Response", + '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 update_dns_trace_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_dns_trace_test: UpdateDnsTraceTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetDnsTraceTest200Response]: + """Update DNS Trace test + + Updates a DNS Trace test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_dns_trace_test: (required) + :type update_dns_trace_test: UpdateDnsTraceTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_dns_trace_test_serialize( + test_id=test_id, + update_dns_trace_test=update_dns_trace_test, + 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': "GetDnsTraceTest200Response", + '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 update_dns_trace_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_dns_trace_test: UpdateDnsTraceTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Update DNS Trace test + + Updates a DNS Trace test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_dns_trace_test: (required) + :type update_dns_trace_test: UpdateDnsTraceTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_dns_trace_test_serialize( + test_id=test_id, + update_dns_trace_test=update_dns_trace_test, + 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': "GetDnsTraceTest200Response", + '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 _update_dns_trace_test_serialize( + self, + test_id, + update_dns_trace_test, + 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 test_id is not None: + _path_params['testId'] = test_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 update_dns_trace_test is not None: + _body_params = update_dns_trace_test + + + # 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='PUT', + resource_path='/v7/tests/dns-trace/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api/dnssec_api.py b/tests_api/tests_api/api/dnssec_api.py new file mode 100644 index 00000000..2597a76b --- /dev/null +++ b/tests_api/tests_api/api/dnssec_api.py @@ -0,0 +1,1620 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.dns_sec_test import DnsSecTest +from tests_api.models.expand import Expand +from tests_api.models.get_dns_sec_test200_response import GetDnsSecTest200Response +from tests_api.models.get_dns_sec_tests200_response import GetDnsSecTests200Response +from tests_api.models.update_dns_sec_test import UpdateDnsSecTest + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class DNSSECApi: + """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 create_dns_sec_test( + self, + update_dns_sec_test: UpdateDnsSecTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> DnsSecTest: + """Create DNSSEC test + + Creates a new DNSSEC test. This method requires Account Admin permissions. + + :param update_dns_sec_test: (required) + :type update_dns_sec_test: UpdateDnsSecTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_dns_sec_test_serialize( + update_dns_sec_test=update_dns_sec_test, + 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]] = { + '201': "DnsSecTest", + '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 create_dns_sec_test_with_http_info( + self, + update_dns_sec_test: UpdateDnsSecTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[DnsSecTest]: + """Create DNSSEC test + + Creates a new DNSSEC test. This method requires Account Admin permissions. + + :param update_dns_sec_test: (required) + :type update_dns_sec_test: UpdateDnsSecTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_dns_sec_test_serialize( + update_dns_sec_test=update_dns_sec_test, + 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]] = { + '201': "DnsSecTest", + '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 create_dns_sec_test_without_preload_content( + self, + update_dns_sec_test: UpdateDnsSecTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Create DNSSEC test + + Creates a new DNSSEC test. This method requires Account Admin permissions. + + :param update_dns_sec_test: (required) + :type update_dns_sec_test: UpdateDnsSecTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_dns_sec_test_serialize( + update_dns_sec_test=update_dns_sec_test, + 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]] = { + '201': "DnsSecTest", + '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 _create_dns_sec_test_serialize( + self, + update_dns_sec_test, + 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 + # 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 update_dns_sec_test is not None: + _body_params = update_dns_sec_test + + + # 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/tests/dnssec', + 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 delete_dns_sec_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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, + ) -> None: + """Delete DNSSEC test + + Deletes the specified DNSSEC test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_dns_sec_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_dns_sec_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[None]: + """Delete DNSSEC test + + Deletes the specified DNSSEC test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_dns_sec_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_dns_sec_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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: + """Delete DNSSEC test + + Deletes the specified DNSSEC test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_dns_sec_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_dns_sec_test_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/tests/dnssec/{testId}', + 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_dns_sec_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetDnsSecTest200Response: + """Get DNSSEC test + + Returns details for a DNSSEC test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_dns_sec_test_serialize( + test_id=test_id, + 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': "GetDnsSecTest200Response", + '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_dns_sec_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetDnsSecTest200Response]: + """Get DNSSEC test + + Returns details for a DNSSEC test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_dns_sec_test_serialize( + test_id=test_id, + 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': "GetDnsSecTest200Response", + '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_dns_sec_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Get DNSSEC test + + Returns details for a DNSSEC test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_dns_sec_test_serialize( + test_id=test_id, + 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': "GetDnsSecTest200Response", + '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_dns_sec_test_serialize( + self, + test_id, + 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 test_id is not None: + _path_params['testId'] = test_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 + + + # 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/tests/dnssec/{testId}', + 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_dns_sec_tests( + 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, + ) -> GetDnsSecTests200Response: + """List DNS Sec tests + + Returns a list of all DNS Sec tests and saved events. + + :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_dns_sec_tests_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': "GetDnsSecTests200Response", + '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_dns_sec_tests_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[GetDnsSecTests200Response]: + """List DNS Sec tests + + Returns a list of all DNS Sec tests and saved events. + + :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_dns_sec_tests_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': "GetDnsSecTests200Response", + '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_dns_sec_tests_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 DNS Sec tests + + Returns a list of all DNS Sec tests and saved events. + + :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_dns_sec_tests_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': "GetDnsSecTests200Response", + '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_dns_sec_tests_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/tests/dnssec', + 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 update_dns_sec_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_dns_sec_test: UpdateDnsSecTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetDnsSecTest200Response: + """Update DNSSEC test + + Updates a DNSSEC test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_dns_sec_test: (required) + :type update_dns_sec_test: UpdateDnsSecTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_dns_sec_test_serialize( + test_id=test_id, + update_dns_sec_test=update_dns_sec_test, + 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': "GetDnsSecTest200Response", + '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 update_dns_sec_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_dns_sec_test: UpdateDnsSecTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetDnsSecTest200Response]: + """Update DNSSEC test + + Updates a DNSSEC test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_dns_sec_test: (required) + :type update_dns_sec_test: UpdateDnsSecTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_dns_sec_test_serialize( + test_id=test_id, + update_dns_sec_test=update_dns_sec_test, + 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': "GetDnsSecTest200Response", + '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 update_dns_sec_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_dns_sec_test: UpdateDnsSecTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Update DNSSEC test + + Updates a DNSSEC test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_dns_sec_test: (required) + :type update_dns_sec_test: UpdateDnsSecTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_dns_sec_test_serialize( + test_id=test_id, + update_dns_sec_test=update_dns_sec_test, + 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': "GetDnsSecTest200Response", + '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 _update_dns_sec_test_serialize( + self, + test_id, + update_dns_sec_test, + 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 test_id is not None: + _path_params['testId'] = test_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 update_dns_sec_test is not None: + _body_params = update_dns_sec_test + + + # 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='PUT', + resource_path='/v7/tests/dnssec/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api/ftp_server_api.py b/tests_api/tests_api/api/ftp_server_api.py new file mode 100644 index 00000000..356967c5 --- /dev/null +++ b/tests_api/tests_api/api/ftp_server_api.py @@ -0,0 +1,1620 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.expand import Expand +from tests_api.models.ftp_server_test import FtpServerTest +from tests_api.models.get_ftp_server_test200_response import GetFtpServerTest200Response +from tests_api.models.get_ftp_server_tests200_response import GetFtpServerTests200Response +from tests_api.models.update_ftp_server_test import UpdateFtpServerTest + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class FTPServerApi: + """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 create_ftp_server_test( + self, + update_ftp_server_test: UpdateFtpServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> FtpServerTest: + """Create FTP Server test + + Creates a new FTP Server test. This method requires Account Admin permissions. + + :param update_ftp_server_test: (required) + :type update_ftp_server_test: UpdateFtpServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_ftp_server_test_serialize( + update_ftp_server_test=update_ftp_server_test, + 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]] = { + '201': "FtpServerTest", + '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 create_ftp_server_test_with_http_info( + self, + update_ftp_server_test: UpdateFtpServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[FtpServerTest]: + """Create FTP Server test + + Creates a new FTP Server test. This method requires Account Admin permissions. + + :param update_ftp_server_test: (required) + :type update_ftp_server_test: UpdateFtpServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_ftp_server_test_serialize( + update_ftp_server_test=update_ftp_server_test, + 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]] = { + '201': "FtpServerTest", + '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 create_ftp_server_test_without_preload_content( + self, + update_ftp_server_test: UpdateFtpServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Create FTP Server test + + Creates a new FTP Server test. This method requires Account Admin permissions. + + :param update_ftp_server_test: (required) + :type update_ftp_server_test: UpdateFtpServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_ftp_server_test_serialize( + update_ftp_server_test=update_ftp_server_test, + 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]] = { + '201': "FtpServerTest", + '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 _create_ftp_server_test_serialize( + self, + update_ftp_server_test, + 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 + # 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 update_ftp_server_test is not None: + _body_params = update_ftp_server_test + + + # 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/tests/ftp-server', + 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 delete_ftp_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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, + ) -> None: + """Delete FTP Server test + + Deletes the specified FTP Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_ftp_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_ftp_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[None]: + """Delete FTP Server test + + Deletes the specified FTP Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_ftp_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_ftp_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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: + """Delete FTP Server test + + Deletes the specified FTP Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_ftp_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_ftp_server_test_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/tests/ftp-server/{testId}', + 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_ftp_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetFtpServerTest200Response: + """Get FTP Server test + + Returns details for a FTP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_ftp_server_test_serialize( + test_id=test_id, + 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': "GetFtpServerTest200Response", + '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_ftp_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetFtpServerTest200Response]: + """Get FTP Server test + + Returns details for a FTP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_ftp_server_test_serialize( + test_id=test_id, + 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': "GetFtpServerTest200Response", + '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_ftp_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Get FTP Server test + + Returns details for a FTP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_ftp_server_test_serialize( + test_id=test_id, + 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': "GetFtpServerTest200Response", + '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_ftp_server_test_serialize( + self, + test_id, + 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 test_id is not None: + _path_params['testId'] = test_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 + + + # 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/tests/ftp-server/{testId}', + 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_ftp_server_tests( + 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, + ) -> GetFtpServerTests200Response: + """List FTP Server tests + + Returns a list of FTP Server tests and saved events. + + :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_ftp_server_tests_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': "GetFtpServerTests200Response", + '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_ftp_server_tests_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[GetFtpServerTests200Response]: + """List FTP Server tests + + Returns a list of FTP Server tests and saved events. + + :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_ftp_server_tests_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': "GetFtpServerTests200Response", + '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_ftp_server_tests_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 FTP Server tests + + Returns a list of FTP Server tests and saved events. + + :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_ftp_server_tests_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': "GetFtpServerTests200Response", + '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_ftp_server_tests_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/tests/ftp-server', + 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 update_ftp_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_ftp_server_test: UpdateFtpServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetFtpServerTest200Response: + """Update FTP Server test + + Updates a FTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_ftp_server_test: (required) + :type update_ftp_server_test: UpdateFtpServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_ftp_server_test_serialize( + test_id=test_id, + update_ftp_server_test=update_ftp_server_test, + 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': "GetFtpServerTest200Response", + '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 update_ftp_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_ftp_server_test: UpdateFtpServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetFtpServerTest200Response]: + """Update FTP Server test + + Updates a FTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_ftp_server_test: (required) + :type update_ftp_server_test: UpdateFtpServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_ftp_server_test_serialize( + test_id=test_id, + update_ftp_server_test=update_ftp_server_test, + 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': "GetFtpServerTest200Response", + '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 update_ftp_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_ftp_server_test: UpdateFtpServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Update FTP Server test + + Updates a FTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_ftp_server_test: (required) + :type update_ftp_server_test: UpdateFtpServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_ftp_server_test_serialize( + test_id=test_id, + update_ftp_server_test=update_ftp_server_test, + 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': "GetFtpServerTest200Response", + '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 _update_ftp_server_test_serialize( + self, + test_id, + update_ftp_server_test, + 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 test_id is not None: + _path_params['testId'] = test_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 update_ftp_server_test is not None: + _body_params = update_ftp_server_test + + + # 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='PUT', + resource_path='/v7/tests/ftp-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api/http_server_api.py b/tests_api/tests_api/api/http_server_api.py new file mode 100644 index 00000000..23a8c6df --- /dev/null +++ b/tests_api/tests_api/api/http_server_api.py @@ -0,0 +1,1620 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.expand import Expand +from tests_api.models.get_http_server_test200_response import GetHttpServerTest200Response +from tests_api.models.get_http_server_tests200_response import GetHttpServerTests200Response +from tests_api.models.http_server_test import HttpServerTest +from tests_api.models.update_http_server_test import UpdateHttpServerTest + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class HTTPServerApi: + """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 create_http_server_test( + self, + update_http_server_test: UpdateHttpServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> HttpServerTest: + """Create HTTP Server test + + Creates a new HTTP Server test. This method requires Account Admin permissions. + + :param update_http_server_test: (required) + :type update_http_server_test: UpdateHttpServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_http_server_test_serialize( + update_http_server_test=update_http_server_test, + 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]] = { + '201': "HttpServerTest", + '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 create_http_server_test_with_http_info( + self, + update_http_server_test: UpdateHttpServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[HttpServerTest]: + """Create HTTP Server test + + Creates a new HTTP Server test. This method requires Account Admin permissions. + + :param update_http_server_test: (required) + :type update_http_server_test: UpdateHttpServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_http_server_test_serialize( + update_http_server_test=update_http_server_test, + 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]] = { + '201': "HttpServerTest", + '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 create_http_server_test_without_preload_content( + self, + update_http_server_test: UpdateHttpServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Create HTTP Server test + + Creates a new HTTP Server test. This method requires Account Admin permissions. + + :param update_http_server_test: (required) + :type update_http_server_test: UpdateHttpServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_http_server_test_serialize( + update_http_server_test=update_http_server_test, + 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]] = { + '201': "HttpServerTest", + '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 _create_http_server_test_serialize( + self, + update_http_server_test, + 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 + # 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 update_http_server_test is not None: + _body_params = update_http_server_test + + + # 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/tests/http-server', + 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 delete_http_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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, + ) -> None: + """Delete HTTP Server test + + Deletes the specified HTTP Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_http_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_http_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[None]: + """Delete HTTP Server test + + Deletes the specified HTTP Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_http_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_http_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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: + """Delete HTTP Server test + + Deletes the specified HTTP Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_http_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_http_server_test_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/tests/http-server/{testId}', + 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_http_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetHttpServerTest200Response: + """Get HTTP Server test + + Returns details for a HTTP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_http_server_test_serialize( + test_id=test_id, + 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': "GetHttpServerTest200Response", + '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_http_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetHttpServerTest200Response]: + """Get HTTP Server test + + Returns details for a HTTP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_http_server_test_serialize( + test_id=test_id, + 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': "GetHttpServerTest200Response", + '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_http_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Get HTTP Server test + + Returns details for a HTTP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_http_server_test_serialize( + test_id=test_id, + 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': "GetHttpServerTest200Response", + '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_http_server_test_serialize( + self, + test_id, + 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 test_id is not None: + _path_params['testId'] = test_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 + + + # 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/tests/http-server/{testId}', + 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_http_server_tests( + 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, + ) -> GetHttpServerTests200Response: + """List HTTP Server tests + + Returns a list of all HTTP Server tests and saved events. + + :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_http_server_tests_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': "GetHttpServerTests200Response", + '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_http_server_tests_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[GetHttpServerTests200Response]: + """List HTTP Server tests + + Returns a list of all HTTP Server tests and saved events. + + :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_http_server_tests_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': "GetHttpServerTests200Response", + '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_http_server_tests_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 HTTP Server tests + + Returns a list of all HTTP Server tests and saved events. + + :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_http_server_tests_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': "GetHttpServerTests200Response", + '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_http_server_tests_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/tests/http-server', + 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 update_http_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_http_server_test: UpdateHttpServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetHttpServerTest200Response: + """Update HTTP Server test + + Updates a HTTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_http_server_test: (required) + :type update_http_server_test: UpdateHttpServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_http_server_test_serialize( + test_id=test_id, + update_http_server_test=update_http_server_test, + 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': "GetHttpServerTest200Response", + '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 update_http_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_http_server_test: UpdateHttpServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetHttpServerTest200Response]: + """Update HTTP Server test + + Updates a HTTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_http_server_test: (required) + :type update_http_server_test: UpdateHttpServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_http_server_test_serialize( + test_id=test_id, + update_http_server_test=update_http_server_test, + 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': "GetHttpServerTest200Response", + '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 update_http_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_http_server_test: UpdateHttpServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Update HTTP Server test + + Updates a HTTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_http_server_test: (required) + :type update_http_server_test: UpdateHttpServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_http_server_test_serialize( + test_id=test_id, + update_http_server_test=update_http_server_test, + 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': "GetHttpServerTest200Response", + '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 _update_http_server_test_serialize( + self, + test_id, + update_http_server_test, + 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 test_id is not None: + _path_params['testId'] = test_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 update_http_server_test is not None: + _body_params = update_http_server_test + + + # 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='PUT', + resource_path='/v7/tests/http-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api/page_load_api.py b/tests_api/tests_api/api/page_load_api.py new file mode 100644 index 00000000..5786607c --- /dev/null +++ b/tests_api/tests_api/api/page_load_api.py @@ -0,0 +1,1620 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.expand import Expand +from tests_api.models.get_page_load_test200_response import GetPageLoadTest200Response +from tests_api.models.get_page_load_tests200_response import GetPageLoadTests200Response +from tests_api.models.page_load_test import PageLoadTest +from tests_api.models.update_page_load_test import UpdatePageLoadTest + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class PageLoadApi: + """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 create_page_load_test( + self, + update_page_load_test: UpdatePageLoadTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> PageLoadTest: + """Create Page Load test + + Creates a new Page Load test. This method requires Account Admin permissions. + + :param update_page_load_test: (required) + :type update_page_load_test: UpdatePageLoadTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_page_load_test_serialize( + update_page_load_test=update_page_load_test, + 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]] = { + '201': "PageLoadTest", + '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 create_page_load_test_with_http_info( + self, + update_page_load_test: UpdatePageLoadTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[PageLoadTest]: + """Create Page Load test + + Creates a new Page Load test. This method requires Account Admin permissions. + + :param update_page_load_test: (required) + :type update_page_load_test: UpdatePageLoadTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_page_load_test_serialize( + update_page_load_test=update_page_load_test, + 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]] = { + '201': "PageLoadTest", + '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 create_page_load_test_without_preload_content( + self, + update_page_load_test: UpdatePageLoadTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Create Page Load test + + Creates a new Page Load test. This method requires Account Admin permissions. + + :param update_page_load_test: (required) + :type update_page_load_test: UpdatePageLoadTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_page_load_test_serialize( + update_page_load_test=update_page_load_test, + 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]] = { + '201': "PageLoadTest", + '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 _create_page_load_test_serialize( + self, + update_page_load_test, + 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 + # 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 update_page_load_test is not None: + _body_params = update_page_load_test + + + # 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/tests/page-load', + 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 delete_page_load_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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, + ) -> None: + """Delete Page Load test + + Deletes the specified Page Load test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_page_load_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_page_load_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[None]: + """Delete Page Load test + + Deletes the specified Page Load test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_page_load_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_page_load_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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: + """Delete Page Load test + + Deletes the specified Page Load test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_page_load_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_page_load_test_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/tests/page-load/{testId}', + 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_page_load_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetPageLoadTest200Response: + """Get Page Load test + + Returns details for a Page Load test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_page_load_test_serialize( + test_id=test_id, + 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': "GetPageLoadTest200Response", + '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_page_load_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetPageLoadTest200Response]: + """Get Page Load test + + Returns details for a Page Load test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_page_load_test_serialize( + test_id=test_id, + 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': "GetPageLoadTest200Response", + '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_page_load_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Get Page Load test + + Returns details for a Page Load test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_page_load_test_serialize( + test_id=test_id, + 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': "GetPageLoadTest200Response", + '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_page_load_test_serialize( + self, + test_id, + 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 test_id is not None: + _path_params['testId'] = test_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 + + + # 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/tests/page-load/{testId}', + 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_page_load_tests( + 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, + ) -> GetPageLoadTests200Response: + """List Page Load tests + + Returns a list of all Page Load tests and saved events. + + :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_page_load_tests_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': "GetPageLoadTests200Response", + '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_page_load_tests_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[GetPageLoadTests200Response]: + """List Page Load tests + + Returns a list of all Page Load tests and saved events. + + :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_page_load_tests_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': "GetPageLoadTests200Response", + '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_page_load_tests_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 Page Load tests + + Returns a list of all Page Load tests and saved events. + + :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_page_load_tests_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': "GetPageLoadTests200Response", + '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_page_load_tests_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/tests/page-load', + 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 update_page_load_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_page_load_test: UpdatePageLoadTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetPageLoadTest200Response: + """Update Page Load test + + Updates a Page Load test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_page_load_test: (required) + :type update_page_load_test: UpdatePageLoadTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_page_load_test_serialize( + test_id=test_id, + update_page_load_test=update_page_load_test, + 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': "GetPageLoadTest200Response", + '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 update_page_load_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_page_load_test: UpdatePageLoadTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetPageLoadTest200Response]: + """Update Page Load test + + Updates a Page Load test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_page_load_test: (required) + :type update_page_load_test: UpdatePageLoadTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_page_load_test_serialize( + test_id=test_id, + update_page_load_test=update_page_load_test, + 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': "GetPageLoadTest200Response", + '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 update_page_load_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_page_load_test: UpdatePageLoadTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Update Page Load test + + Updates a Page Load test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_page_load_test: (required) + :type update_page_load_test: UpdatePageLoadTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_page_load_test_serialize( + test_id=test_id, + update_page_load_test=update_page_load_test, + 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': "GetPageLoadTest200Response", + '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 _update_page_load_test_serialize( + self, + test_id, + update_page_load_test, + 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 test_id is not None: + _path_params['testId'] = test_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 update_page_load_test is not None: + _body_params = update_page_load_test + + + # 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='PUT', + resource_path='/v7/tests/page-load/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api/path_visualization_interface_groups_api.py b/tests_api/tests_api/api/path_visualization_interface_groups_api.py new file mode 100644 index 00000000..cc05b624 --- /dev/null +++ b/tests_api/tests_api/api/path_visualization_interface_groups_api.py @@ -0,0 +1,1263 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.get_path_vis_interface_groups200_response import GetPathVisInterfaceGroups200Response +from tests_api.models.interface_group import InterfaceGroup +from tests_api.models.update_path_vis_interface_group200_response import UpdatePathVisInterfaceGroup200Response + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class PathVisualizationInterfaceGroupsApi: + """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 create_path_vis_interface_groups( + self, + interface_group: InterfaceGroup, + 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, + ) -> InterfaceGroup: + """Create interface group for path visualization + + Creates a new path visualization interface group. + + :param interface_group: (required) + :type interface_group: InterfaceGroup + :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._create_path_vis_interface_groups_serialize( + interface_group=interface_group, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InterfaceGroup", + '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 create_path_vis_interface_groups_with_http_info( + self, + interface_group: InterfaceGroup, + 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[InterfaceGroup]: + """Create interface group for path visualization + + Creates a new path visualization interface group. + + :param interface_group: (required) + :type interface_group: InterfaceGroup + :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._create_path_vis_interface_groups_serialize( + interface_group=interface_group, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InterfaceGroup", + '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 create_path_vis_interface_groups_without_preload_content( + self, + interface_group: InterfaceGroup, + 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: + """Create interface group for path visualization + + Creates a new path visualization interface group. + + :param interface_group: (required) + :type interface_group: InterfaceGroup + :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._create_path_vis_interface_groups_serialize( + interface_group=interface_group, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InterfaceGroup", + '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 _create_path_vis_interface_groups_serialize( + self, + interface_group, + 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 + if interface_group is not None: + _body_params = interface_group + + + # 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/network/path-vis/interface-groups', + 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 delete_path_vis_interface_group( + self, + interface_group_id: Annotated[StrictStr, Field(description="ID of the network path vis interface group")], + 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, + ) -> None: + """Delete interface group + + Deletes a path visualization interface group. + + :param interface_group_id: ID of the network path vis interface group (required) + :type interface_group_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._delete_path_vis_interface_group_serialize( + interface_group_id=interface_group_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_path_vis_interface_group_with_http_info( + self, + interface_group_id: Annotated[StrictStr, Field(description="ID of the network path vis interface group")], + 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[None]: + """Delete interface group + + Deletes a path visualization interface group. + + :param interface_group_id: ID of the network path vis interface group (required) + :type interface_group_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._delete_path_vis_interface_group_serialize( + interface_group_id=interface_group_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_path_vis_interface_group_without_preload_content( + self, + interface_group_id: Annotated[StrictStr, Field(description="ID of the network path vis interface group")], + 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: + """Delete interface group + + Deletes a path visualization interface group. + + :param interface_group_id: ID of the network path vis interface group (required) + :type interface_group_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._delete_path_vis_interface_group_serialize( + interface_group_id=interface_group_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_path_vis_interface_group_serialize( + self, + interface_group_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 interface_group_id is not None: + _path_params['interfaceGroupId'] = interface_group_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/network/path-vis/interface-groups/{interfaceGroupId}', + 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_path_vis_interface_groups( + 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, + ) -> GetPathVisInterfaceGroups200Response: + """List interface groups for path visualization + + Returns a list of all path visualization interface groups. For more information about interface groups, see https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#grouping. + + :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_path_vis_interface_groups_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': "GetPathVisInterfaceGroups200Response", + '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_path_vis_interface_groups_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[GetPathVisInterfaceGroups200Response]: + """List interface groups for path visualization + + Returns a list of all path visualization interface groups. For more information about interface groups, see https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#grouping. + + :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_path_vis_interface_groups_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': "GetPathVisInterfaceGroups200Response", + '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_path_vis_interface_groups_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 interface groups for path visualization + + Returns a list of all path visualization interface groups. For more information about interface groups, see https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#grouping. + + :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_path_vis_interface_groups_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': "GetPathVisInterfaceGroups200Response", + '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_path_vis_interface_groups_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/network/path-vis/interface-groups', + 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 update_path_vis_interface_group( + self, + interface_group_id: Annotated[StrictStr, Field(description="ID of the network path vis interface group")], + interface_group: InterfaceGroup, + 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, + ) -> UpdatePathVisInterfaceGroup200Response: + """Update interface group + + Updates a path visualization interface group.. + + :param interface_group_id: ID of the network path vis interface group (required) + :type interface_group_id: str + :param interface_group: (required) + :type interface_group: InterfaceGroup + :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._update_path_vis_interface_group_serialize( + interface_group_id=interface_group_id, + interface_group=interface_group, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdatePathVisInterfaceGroup200Response", + '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 update_path_vis_interface_group_with_http_info( + self, + interface_group_id: Annotated[StrictStr, Field(description="ID of the network path vis interface group")], + interface_group: InterfaceGroup, + 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[UpdatePathVisInterfaceGroup200Response]: + """Update interface group + + Updates a path visualization interface group.. + + :param interface_group_id: ID of the network path vis interface group (required) + :type interface_group_id: str + :param interface_group: (required) + :type interface_group: InterfaceGroup + :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._update_path_vis_interface_group_serialize( + interface_group_id=interface_group_id, + interface_group=interface_group, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdatePathVisInterfaceGroup200Response", + '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 update_path_vis_interface_group_without_preload_content( + self, + interface_group_id: Annotated[StrictStr, Field(description="ID of the network path vis interface group")], + interface_group: InterfaceGroup, + 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: + """Update interface group + + Updates a path visualization interface group.. + + :param interface_group_id: ID of the network path vis interface group (required) + :type interface_group_id: str + :param interface_group: (required) + :type interface_group: InterfaceGroup + :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._update_path_vis_interface_group_serialize( + interface_group_id=interface_group_id, + interface_group=interface_group, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdatePathVisInterfaceGroup200Response", + '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 _update_path_vis_interface_group_serialize( + self, + interface_group_id, + interface_group, + 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 interface_group_id is not None: + _path_params['interfaceGroupId'] = interface_group_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 + if interface_group is not None: + _body_params = interface_group + + + # 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='PUT', + resource_path='/v7/network/path-vis/interface-groups/{interfaceGroupId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api/sip_server_api.py b/tests_api/tests_api/api/sip_server_api.py new file mode 100644 index 00000000..8b108856 --- /dev/null +++ b/tests_api/tests_api/api/sip_server_api.py @@ -0,0 +1,1620 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.expand import Expand +from tests_api.models.get_sip_server_test200_response import GetSipServerTest200Response +from tests_api.models.get_sip_server_tests200_response import GetSipServerTests200Response +from tests_api.models.sip_server_test import SipServerTest +from tests_api.models.update_sip_server_test import UpdateSipServerTest + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class SIPServerApi: + """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 create_sip_server_test( + self, + update_sip_server_test: UpdateSipServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> SipServerTest: + """Create SIP Server test + + Creates a new SIP Server test. This method requires Account Admin permissions. + + :param update_sip_server_test: (required) + :type update_sip_server_test: UpdateSipServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_sip_server_test_serialize( + update_sip_server_test=update_sip_server_test, + 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]] = { + '201': "SipServerTest", + '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 create_sip_server_test_with_http_info( + self, + update_sip_server_test: UpdateSipServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[SipServerTest]: + """Create SIP Server test + + Creates a new SIP Server test. This method requires Account Admin permissions. + + :param update_sip_server_test: (required) + :type update_sip_server_test: UpdateSipServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_sip_server_test_serialize( + update_sip_server_test=update_sip_server_test, + 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]] = { + '201': "SipServerTest", + '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 create_sip_server_test_without_preload_content( + self, + update_sip_server_test: UpdateSipServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Create SIP Server test + + Creates a new SIP Server test. This method requires Account Admin permissions. + + :param update_sip_server_test: (required) + :type update_sip_server_test: UpdateSipServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_sip_server_test_serialize( + update_sip_server_test=update_sip_server_test, + 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]] = { + '201': "SipServerTest", + '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 _create_sip_server_test_serialize( + self, + update_sip_server_test, + 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 + # 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 update_sip_server_test is not None: + _body_params = update_sip_server_test + + + # 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/tests/sip-server', + 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 delete_sip_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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, + ) -> None: + """Delete SIP Server test + + Deletes the specified SIP Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_sip_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_sip_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[None]: + """Delete SIP Server test + + Deletes the specified SIP Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_sip_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_sip_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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: + """Delete SIP Server test + + Deletes the specified SIP Server test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_sip_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_sip_server_test_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/tests/sip-server/{testId}', + 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_sip_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetSipServerTest200Response: + """Get SIP Server test + + Returns details for a SIP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_sip_server_test_serialize( + test_id=test_id, + 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': "GetSipServerTest200Response", + '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_sip_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetSipServerTest200Response]: + """Get SIP Server test + + Returns details for a SIP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_sip_server_test_serialize( + test_id=test_id, + 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': "GetSipServerTest200Response", + '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_sip_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Get SIP Server test + + Returns details for a SIP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_sip_server_test_serialize( + test_id=test_id, + 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': "GetSipServerTest200Response", + '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_sip_server_test_serialize( + self, + test_id, + 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 test_id is not None: + _path_params['testId'] = test_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 + + + # 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/tests/sip-server/{testId}', + 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_sip_server_tests( + 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, + ) -> GetSipServerTests200Response: + """List SIP Server tests + + Returns a list of SIP Server tests and saved events. + + :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_sip_server_tests_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': "GetSipServerTests200Response", + '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_sip_server_tests_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[GetSipServerTests200Response]: + """List SIP Server tests + + Returns a list of SIP Server tests and saved events. + + :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_sip_server_tests_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': "GetSipServerTests200Response", + '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_sip_server_tests_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 SIP Server tests + + Returns a list of SIP Server tests and saved events. + + :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_sip_server_tests_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': "GetSipServerTests200Response", + '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_sip_server_tests_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/tests/sip-server', + 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 update_sip_server_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_sip_server_test: UpdateSipServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetSipServerTest200Response: + """Update SIP Server test + + Updates a SIP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_sip_server_test: (required) + :type update_sip_server_test: UpdateSipServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_sip_server_test_serialize( + test_id=test_id, + update_sip_server_test=update_sip_server_test, + 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': "GetSipServerTest200Response", + '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 update_sip_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_sip_server_test: UpdateSipServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetSipServerTest200Response]: + """Update SIP Server test + + Updates a SIP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_sip_server_test: (required) + :type update_sip_server_test: UpdateSipServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_sip_server_test_serialize( + test_id=test_id, + update_sip_server_test=update_sip_server_test, + 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': "GetSipServerTest200Response", + '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 update_sip_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_sip_server_test: UpdateSipServerTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Update SIP Server test + + Updates a SIP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_sip_server_test: (required) + :type update_sip_server_test: UpdateSipServerTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_sip_server_test_serialize( + test_id=test_id, + update_sip_server_test=update_sip_server_test, + 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': "GetSipServerTest200Response", + '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 _update_sip_server_test_serialize( + self, + test_id, + update_sip_server_test, + 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 test_id is not None: + _path_params['testId'] = test_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 update_sip_server_test is not None: + _body_params = update_sip_server_test + + + # 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='PUT', + resource_path='/v7/tests/sip-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api/voice_api.py b/tests_api/tests_api/api/voice_api.py new file mode 100644 index 00000000..57211686 --- /dev/null +++ b/tests_api/tests_api/api/voice_api.py @@ -0,0 +1,1620 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.expand import Expand +from tests_api.models.get_voice_test200_response import GetVoiceTest200Response +from tests_api.models.get_voice_tests200_response import GetVoiceTests200Response +from tests_api.models.update_voice_test import UpdateVoiceTest +from tests_api.models.voice_test import VoiceTest + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class VoiceApi: + """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 create_voice_test( + self, + update_voice_test: UpdateVoiceTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> VoiceTest: + """Create Voice test + + Creates a new Voice test. This method requires Account Admin permissions. + + :param update_voice_test: (required) + :type update_voice_test: UpdateVoiceTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_voice_test_serialize( + update_voice_test=update_voice_test, + 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]] = { + '201': "VoiceTest", + '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 create_voice_test_with_http_info( + self, + update_voice_test: UpdateVoiceTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[VoiceTest]: + """Create Voice test + + Creates a new Voice test. This method requires Account Admin permissions. + + :param update_voice_test: (required) + :type update_voice_test: UpdateVoiceTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_voice_test_serialize( + update_voice_test=update_voice_test, + 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]] = { + '201': "VoiceTest", + '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 create_voice_test_without_preload_content( + self, + update_voice_test: UpdateVoiceTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Create Voice test + + Creates a new Voice test. This method requires Account Admin permissions. + + :param update_voice_test: (required) + :type update_voice_test: UpdateVoiceTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_voice_test_serialize( + update_voice_test=update_voice_test, + 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]] = { + '201': "VoiceTest", + '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 _create_voice_test_serialize( + self, + update_voice_test, + 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 + # 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 update_voice_test is not None: + _body_params = update_voice_test + + + # 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/tests/voice', + 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 delete_voice_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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, + ) -> None: + """Delete Voice test + + Deletes the specified Voice test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_voice_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_voice_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[None]: + """Delete Voice test + + Deletes the specified Voice test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_voice_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_voice_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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: + """Delete Voice test + + Deletes the specified Voice test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_voice_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_voice_test_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/tests/voice/{testId}', + 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_voice_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetVoiceTest200Response: + """Get Voice test + + Returns details for a Voice test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_voice_test_serialize( + test_id=test_id, + 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': "GetVoiceTest200Response", + '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_voice_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetVoiceTest200Response]: + """Get Voice test + + Returns details for a Voice test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_voice_test_serialize( + test_id=test_id, + 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': "GetVoiceTest200Response", + '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_voice_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Get Voice test + + Returns details for a Voice test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_voice_test_serialize( + test_id=test_id, + 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': "GetVoiceTest200Response", + '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_voice_test_serialize( + self, + test_id, + 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 test_id is not None: + _path_params['testId'] = test_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 + + + # 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/tests/voice/{testId}', + 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_voice_tests( + 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, + ) -> GetVoiceTests200Response: + """List Voice tests + + Returns a list of Voice tests and saved events. + + :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_voice_tests_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': "GetVoiceTests200Response", + '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_voice_tests_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[GetVoiceTests200Response]: + """List Voice tests + + Returns a list of Voice tests and saved events. + + :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_voice_tests_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': "GetVoiceTests200Response", + '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_voice_tests_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 Voice tests + + Returns a list of Voice tests and saved events. + + :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_voice_tests_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': "GetVoiceTests200Response", + '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_voice_tests_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/tests/voice', + 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 update_voice_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_voice_test: UpdateVoiceTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetVoiceTest200Response: + """Update Voice test + + Updates a Voice test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_voice_test: (required) + :type update_voice_test: UpdateVoiceTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_voice_test_serialize( + test_id=test_id, + update_voice_test=update_voice_test, + 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': "GetVoiceTest200Response", + '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 update_voice_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_voice_test: UpdateVoiceTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetVoiceTest200Response]: + """Update Voice test + + Updates a Voice test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_voice_test: (required) + :type update_voice_test: UpdateVoiceTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_voice_test_serialize( + test_id=test_id, + update_voice_test=update_voice_test, + 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': "GetVoiceTest200Response", + '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 update_voice_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_voice_test: UpdateVoiceTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Update Voice test + + Updates a Voice test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_voice_test: (required) + :type update_voice_test: UpdateVoiceTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_voice_test_serialize( + test_id=test_id, + update_voice_test=update_voice_test, + 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': "GetVoiceTest200Response", + '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 _update_voice_test_serialize( + self, + test_id, + update_voice_test, + 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 test_id is not None: + _path_params['testId'] = test_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 update_voice_test is not None: + _body_params = update_voice_test + + + # 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='PUT', + resource_path='/v7/tests/voice/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api/web_transaction_api.py b/tests_api/tests_api/api/web_transaction_api.py new file mode 100644 index 00000000..365f236d --- /dev/null +++ b/tests_api/tests_api/api/web_transaction_api.py @@ -0,0 +1,1620 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.expand import Expand +from tests_api.models.get_web_transactions_test200_response import GetWebTransactionsTest200Response +from tests_api.models.get_web_transactions_tests200_response import GetWebTransactionsTests200Response +from tests_api.models.update_web_transaction_test import UpdateWebTransactionTest +from tests_api.models.web_transaction_test import WebTransactionTest + +from tests_api.api_client import ApiClient +from tests_api.api_response import ApiResponse +from tests_api.rest import RESTResponseType + + +class WebTransactionApi: + """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 create_web_transactions_test( + self, + update_web_transaction_test: UpdateWebTransactionTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> WebTransactionTest: + """Create Web Transactions test + + Creates a new Web Transactions test. This method requires Account Admin permissions. + + :param update_web_transaction_test: (required) + :type update_web_transaction_test: UpdateWebTransactionTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_web_transactions_test_serialize( + update_web_transaction_test=update_web_transaction_test, + 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]] = { + '201': "WebTransactionTest", + '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 create_web_transactions_test_with_http_info( + self, + update_web_transaction_test: UpdateWebTransactionTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[WebTransactionTest]: + """Create Web Transactions test + + Creates a new Web Transactions test. This method requires Account Admin permissions. + + :param update_web_transaction_test: (required) + :type update_web_transaction_test: UpdateWebTransactionTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_web_transactions_test_serialize( + update_web_transaction_test=update_web_transaction_test, + 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]] = { + '201': "WebTransactionTest", + '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 create_web_transactions_test_without_preload_content( + self, + update_web_transaction_test: UpdateWebTransactionTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Create Web Transactions test + + Creates a new Web Transactions test. This method requires Account Admin permissions. + + :param update_web_transaction_test: (required) + :type update_web_transaction_test: UpdateWebTransactionTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._create_web_transactions_test_serialize( + update_web_transaction_test=update_web_transaction_test, + 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]] = { + '201': "WebTransactionTest", + '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 _create_web_transactions_test_serialize( + self, + update_web_transaction_test, + 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 + # 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 update_web_transaction_test is not None: + _body_params = update_web_transaction_test + + + # 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/tests/web-transactions', + 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 delete_web_transactions_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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, + ) -> None: + """Delete Web Transactions test + + Deletes the specified Web Transactions test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_web_transactions_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_web_transactions_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[None]: + """Delete Web Transactions test + + Deletes the specified Web Transactions test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_web_transactions_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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 delete_web_transactions_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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: + """Delete Web Transactions test + + Deletes the specified Web Transactions test. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_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._delete_web_transactions_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_web_transactions_test_serialize( + self, + test_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 test_id is not None: + _path_params['testId'] = test_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/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/tests/web-transactions/{testId}', + 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_web_transactions_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetWebTransactionsTest200Response: + """Get Web Transactions test + + Returns details for a Web Transactions test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_web_transactions_test_serialize( + test_id=test_id, + 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': "GetWebTransactionsTest200Response", + '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_web_transactions_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetWebTransactionsTest200Response]: + """Get Web Transactions test + + Returns details for a Web Transactions test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_web_transactions_test_serialize( + test_id=test_id, + 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': "GetWebTransactionsTest200Response", + '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_web_transactions_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Get Web Transactions test + + Returns details for a Web Transactions test, including name, intervals, targets, alert rules and agents. + + :param test_id: ID of the test (required) + :type test_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 expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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_web_transactions_test_serialize( + test_id=test_id, + 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': "GetWebTransactionsTest200Response", + '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_web_transactions_test_serialize( + self, + test_id, + 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 test_id is not None: + _path_params['testId'] = test_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 + + + # 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/tests/web-transactions/{testId}', + 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_web_transactions_tests( + 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, + ) -> GetWebTransactionsTests200Response: + """List Web Transactions tests + + Returns a list of all Web Transactions tests and saved events. + + :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_web_transactions_tests_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': "GetWebTransactionsTests200Response", + '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_web_transactions_tests_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[GetWebTransactionsTests200Response]: + """List Web Transactions tests + + Returns a list of all Web Transactions tests and saved events. + + :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_web_transactions_tests_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': "GetWebTransactionsTests200Response", + '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_web_transactions_tests_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 Web Transactions tests + + Returns a list of all Web Transactions tests and saved events. + + :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_web_transactions_tests_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': "GetWebTransactionsTests200Response", + '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_web_transactions_tests_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/tests/web-transactions', + 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 update_web_transactions_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_web_transaction_test: UpdateWebTransactionTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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, + ) -> GetWebTransactionsTest200Response: + """Update Web Transactions test + + Updates a Web Transactions test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_web_transaction_test: (required) + :type update_web_transaction_test: UpdateWebTransactionTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_web_transactions_test_serialize( + test_id=test_id, + update_web_transaction_test=update_web_transaction_test, + 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': "GetWebTransactionsTest200Response", + '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 update_web_transactions_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_web_transaction_test: UpdateWebTransactionTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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[GetWebTransactionsTest200Response]: + """Update Web Transactions test + + Updates a Web Transactions test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_web_transaction_test: (required) + :type update_web_transaction_test: UpdateWebTransactionTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_web_transactions_test_serialize( + test_id=test_id, + update_web_transaction_test=update_web_transaction_test, + 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': "GetWebTransactionsTest200Response", + '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 update_web_transactions_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the test")], + update_web_transaction_test: UpdateWebTransactionTest, + 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[Expand]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` 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: + """Update Web Transactions test + + Updates a Web Transactions test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: ID of the test (required) + :type test_id: str + :param update_web_transaction_test: (required) + :type update_web_transaction_test: UpdateWebTransactionTest + :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 on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[Expand] + :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._update_web_transactions_test_serialize( + test_id=test_id, + update_web_transaction_test=update_web_transaction_test, + 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': "GetWebTransactionsTest200Response", + '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 _update_web_transactions_test_serialize( + self, + test_id, + update_web_transaction_test, + 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 test_id is not None: + _path_params['testId'] = test_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 update_web_transaction_test is not None: + _body_params = update_web_transaction_test + + + # 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='PUT', + resource_path='/v7/tests/web-transactions/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/tests_api/tests_api/api_client.py b/tests_api/tests_api/api_client.py new file mode 100644 index 00000000..9cdfa3ed --- /dev/null +++ b/tests_api/tests_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.configuration import Configuration +from tests_api.api_response import ApiResponse +import tests_api.models +from tests_api import rest +from tests_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(tests_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) diff --git a/tests_api/tests_api/api_response.py b/tests_api/tests_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/tests_api/tests_api/api_response.py @@ -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 + } diff --git a/tests_api/tests_api/configuration.py b/tests_api/tests_api/configuration.py new file mode 100644 index 00000000..cac5fc70 --- /dev/null +++ b/tests_api/tests_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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("tests_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 diff --git a/tests_api/tests_api/exceptions.py b/tests_api/tests_api/exceptions.py new file mode 100644 index 00000000..0606791f --- /dev/null +++ b/tests_api/tests_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 diff --git a/tests_api/tests_api/models/__init__.py b/tests_api/tests_api/models/__init__.py new file mode 100644 index 00000000..c6f44a2c --- /dev/null +++ b/tests_api/tests_api/models/__init__.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +# flake8: noqa +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.agent import Agent +from tests_api.models.agent_base import AgentBase +from tests_api.models.agent_to_agent_instant_test import AgentToAgentInstantTest +from tests_api.models.agent_to_agent_test import AgentToAgentTest +from tests_api.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from tests_api.models.agent_to_agent_tests import AgentToAgentTests +from tests_api.models.agent_to_server_instant_test import AgentToServerInstantTest +from tests_api.models.agent_to_server_test import AgentToServerTest +from tests_api.models.agent_to_server_tests import AgentToServerTests +from tests_api.models.alert_rounds_violation_mode import AlertRoundsViolationMode +from tests_api.models.alert_rule import AlertRule +from tests_api.models.alert_type import AlertType +from tests_api.models.base_request import BaseRequest +from tests_api.models.base_test import BaseTest +from tests_api.models.bgp_test import BgpTest +from tests_api.models.bgp_tests import BgpTests +from tests_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.dns_sec_instant_test import DnsSecInstantTest +from tests_api.models.dns_sec_test import DnsSecTest +from tests_api.models.dns_sec_tests import DnsSecTests +from tests_api.models.dns_server_instant_test import DnsServerInstantTest +from tests_api.models.dns_server_test import DnsServerTest +from tests_api.models.dns_server_tests import DnsServerTests +from tests_api.models.dns_trace_instant_test import DnsTraceInstantTest +from tests_api.models.dns_trace_test import DnsTraceTest +from tests_api.models.dns_trace_tests import DnsTraceTests +from tests_api.models.error import Error +from tests_api.models.expand import Expand +from tests_api.models.ftp_server_instant_test import FtpServerInstantTest +from tests_api.models.ftp_server_request_type import FtpServerRequestType +from tests_api.models.ftp_server_test import FtpServerTest +from tests_api.models.ftp_server_tests import FtpServerTests +from tests_api.models.get_agent_to_agent_test200_response import GetAgentToAgentTest200Response +from tests_api.models.get_agent_to_agent_tests200_response import GetAgentToAgentTests200Response +from tests_api.models.get_agent_to_server_test200_response import GetAgentToServerTest200Response +from tests_api.models.get_agent_to_server_tests200_response import GetAgentToServerTests200Response +from tests_api.models.get_bgp_test200_response import GetBgpTest200Response +from tests_api.models.get_bgp_tests200_response import GetBgpTests200Response +from tests_api.models.get_dns_server_test200_response import GetDNSServerTest200Response +from tests_api.models.get_dns_server_tests200_response import GetDNSServerTests200Response +from tests_api.models.get_dns_sec_test200_response import GetDnsSecTest200Response +from tests_api.models.get_dns_sec_tests200_response import GetDnsSecTests200Response +from tests_api.models.get_dns_trace_test200_response import GetDnsTraceTest200Response +from tests_api.models.get_dns_trace_tests200_response import GetDnsTraceTests200Response +from tests_api.models.get_ftp_server_test200_response import GetFtpServerTest200Response +from tests_api.models.get_ftp_server_tests200_response import GetFtpServerTests200Response +from tests_api.models.get_http_server_test200_response import GetHttpServerTest200Response +from tests_api.models.get_http_server_tests200_response import GetHttpServerTests200Response +from tests_api.models.get_page_load_test200_response import GetPageLoadTest200Response +from tests_api.models.get_page_load_tests200_response import GetPageLoadTests200Response +from tests_api.models.get_path_vis_interface_groups200_response import GetPathVisInterfaceGroups200Response +from tests_api.models.get_sip_server_test200_response import GetSipServerTest200Response +from tests_api.models.get_sip_server_tests200_response import GetSipServerTests200Response +from tests_api.models.get_tests200_response import GetTests200Response +from tests_api.models.get_voice_test200_response import GetVoiceTest200Response +from tests_api.models.get_voice_tests200_response import GetVoiceTests200Response +from tests_api.models.get_web_transactions_test200_response import GetWebTransactionsTest200Response +from tests_api.models.get_web_transactions_tests200_response import GetWebTransactionsTests200Response +from tests_api.models.http_server_instant_test import HttpServerInstantTest +from tests_api.models.http_server_test import HttpServerTest +from tests_api.models.http_server_tests import HttpServerTests +from tests_api.models.instant_test import InstantTest +from tests_api.models.interface_group import InterfaceGroup +from tests_api.models.interface_groups import InterfaceGroups +from tests_api.models.link import Link +from tests_api.models.map_item import MapItem +from tests_api.models.monitor import Monitor +from tests_api.models.monitor_type import MonitorType +from tests_api.models.monitors_request import MonitorsRequest +from tests_api.models.page_load_instant_test import PageLoadInstantTest +from tests_api.models.page_load_test import PageLoadTest +from tests_api.models.page_load_tests import PageLoadTests +from tests_api.models.self_links import SelfLinks +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.simple_test import SimpleTest +from tests_api.models.sip_server_instant_test import SipServerInstantTest +from tests_api.models.sip_server_test import SipServerTest +from tests_api.models.sip_server_tests import SipServerTests +from tests_api.models.sip_test_protocol import SipTestProtocol +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_custom_headers_all import TestCustomHeadersAll +from tests_api.models.test_custom_headers_root import TestCustomHeadersRoot +from tests_api.models.test_direction import TestDirection +from tests_api.models.test_dns_server import TestDnsServer +from tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_http_interval import TestHttpInterval +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_request import TestRequest +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_sip_credentials import TestSipCredentials +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.test_sub_interval import TestSubInterval +from tests_api.models.test_type import TestType +from tests_api.models.tests import Tests +from tests_api.models.unauthorized_error import UnauthorizedError +from tests_api.models.unexpanded_instant_test import UnexpandedInstantTest +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +from tests_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf +from tests_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults +from tests_api.models.unexpanded_test import UnexpandedTest +from tests_api.models.update_agent_to_agent_test import UpdateAgentToAgentTest +from tests_api.models.update_agent_to_server_test import UpdateAgentToServerTest +from tests_api.models.update_bgp_test import UpdateBgpTest +from tests_api.models.update_dns_sec_test import UpdateDnsSecTest +from tests_api.models.update_dns_server_test import UpdateDnsServerTest +from tests_api.models.update_dns_trace_test import UpdateDnsTraceTest +from tests_api.models.update_ftp_server_test import UpdateFtpServerTest +from tests_api.models.update_http_server_test import UpdateHttpServerTest +from tests_api.models.update_page_load_test import UpdatePageLoadTest +from tests_api.models.update_path_vis_interface_group200_response import UpdatePathVisInterfaceGroup200Response +from tests_api.models.update_sip_server_test import UpdateSipServerTest +from tests_api.models.update_voice_test import UpdateVoiceTest +from tests_api.models.update_web_transaction_test import UpdateWebTransactionTest +from tests_api.models.voice_instant_test import VoiceInstantTest +from tests_api.models.voice_test import VoiceTest +from tests_api.models.voice_tests import VoiceTests +from tests_api.models.web_transaction_instant_test import WebTransactionInstantTest +from tests_api.models.web_transaction_test import WebTransactionTest +from tests_api.models.web_transaction_tests import WebTransactionTests diff --git a/tests_api/tests_api/models/agent.py b/tests_api/tests_api/models/agent.py new file mode 100644 index 00000000..be22a76d --- /dev/null +++ b/tests_api/tests_api/models/agent.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_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 agent’s 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 + + diff --git a/tests_api/tests_api/models/agent_base.py b/tests_api/tests_api/models/agent_base.py new file mode 100644 index 00000000..f043d39d --- /dev/null +++ b/tests_api/tests_api/models/agent_base.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 agent’s 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 + + diff --git a/tests_api/tests_api/models/agent_to_agent_instant_test.py b/tests_api/tests_api/models/agent_to_agent_instant_test.py new file mode 100644 index 00000000..ba854ec0 --- /dev/null +++ b/tests_api/tests_api/models/agent_to_agent_instant_test.py @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from tests_api.models.test_direction import TestDirection +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AgentToAgentInstantTest(BaseModel): + """ + AgentToAgentInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + direction: Optional[TestDirection] = None + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + mss: Optional[Annotated[int, Field(le=1400, strict=True, ge=20)]] = Field(default=None, description="Maximum segment size, in bytes.") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + protocol: Optional[AgentToAgentTestProtocol] = None + target_agent_id: StrictStr = Field(description="`agentId` of the target agent for the test.", alias="targetAgentId") + throughput_measurements: Optional[StrictBool] = Field(default=False, description="Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent.", alias="throughputMeasurements") + throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration") + throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate"] + + 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 AgentToAgentInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 AgentToAgentInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "direction": obj.get("direction"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "mss": obj.get("mss"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "targetAgentId": obj.get("targetAgentId"), + "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False, + "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000, + "throughputRate": obj.get("throughputRate"), + "fixedPacketRate": obj.get("fixedPacketRate") + }) + return _obj + + diff --git a/tests_api/tests_api/models/agent_to_agent_test.py b/tests_api/tests_api/models/agent_to_agent_test.py new file mode 100644 index 00000000..fb7afb06 --- /dev/null +++ b/tests_api/tests_api/models/agent_to_agent_test.py @@ -0,0 +1,228 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from tests_api.models.alert_rule import AlertRule +from tests_api.models.monitor import Monitor +from tests_api.models.test_direction import TestDirection +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AgentToAgentTest(BaseModel): + """ + AgentToAgentTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + direction: Optional[TestDirection] = None + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + mss: Optional[Annotated[int, Field(le=1400, strict=True, ge=20)]] = Field(default=None, description="Maximum segment size, in bytes.") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + protocol: Optional[AgentToAgentTestProtocol] = None + target_agent_id: StrictStr = Field(description="`agentId` of the target agent for the test.", alias="targetAgentId") + throughput_measurements: Optional[StrictBool] = Field(default=False, description="Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent.", alias="throughputMeasurements") + throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration") + throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate", "bgpMeasurements", "monitors"] + + 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 AgentToAgentTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "dscp", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AgentToAgentTest 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "direction": obj.get("direction"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "mss": obj.get("mss"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "targetAgentId": obj.get("targetAgentId"), + "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False, + "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000, + "throughputRate": obj.get("throughputRate"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/agent_to_agent_test_protocol.py b/tests_api/tests_api/models/agent_to_agent_test_protocol.py new file mode 100644 index 00000000..c5ac3390 --- /dev/null +++ b/tests_api/tests_api/models/agent_to_agent_test_protocol.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 AgentToAgentTestProtocol(str, Enum): + """ + AgentToAgentTestProtocol + """ + + """ + allowed enum values + """ + TCP = 'tcp' + UDP = 'udp' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AgentToAgentTestProtocol from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/agent_to_agent_tests.py b/tests_api/tests_api/models/agent_to_agent_tests.py new file mode 100644 index 00000000..047a98de --- /dev/null +++ b/tests_api/tests_api/models/agent_to_agent_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.agent_to_agent_test import AgentToAgentTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AgentToAgentTests(BaseModel): + """ + AgentToAgentTests + """ # noqa: E501 + tests: Optional[List[AgentToAgentTest]] = None + __properties: ClassVar[List[str]] = ["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 AgentToAgentTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AgentToAgentTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [AgentToAgentTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/agent_to_server_instant_test.py b/tests_api/tests_api/models/agent_to_server_instant_test.py new file mode 100644 index 00000000..9cec0219 --- /dev/null +++ b/tests_api/tests_api/models/agent_to_server_instant_test.py @@ -0,0 +1,202 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AgentToServerInstantTest(BaseModel): + """ + AgentToServerInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + continuous_mode: Optional[StrictBool] = Field(default=None, description="To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. ", alias="continuousMode") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1`", alias="fixedPacketRate") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + server: StrictStr = Field(description="Target name or IP address.") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize") + network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements"] + + 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 AgentToServerInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 AgentToServerInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "continuousMode": obj.get("continuousMode"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "ipv6Policy": obj.get("ipv6Policy"), + "pingPayloadSize": obj.get("pingPayloadSize"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False + }) + return _obj + + diff --git a/tests_api/tests_api/models/agent_to_server_test.py b/tests_api/tests_api/models/agent_to_server_test.py new file mode 100644 index 00000000..a1edfee9 --- /dev/null +++ b/tests_api/tests_api/models/agent_to_server_test.py @@ -0,0 +1,233 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.monitor import Monitor +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AgentToServerTest(BaseModel): + """ + AgentToServerTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + continuous_mode: Optional[StrictBool] = Field(default=None, description="To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. ", alias="continuousMode") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1`", alias="fixedPacketRate") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + server: StrictStr = Field(description="Target name or IP address.") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize") + network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "bgpMeasurements", "monitors"] + + 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 AgentToServerTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "dscp", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AgentToServerTest 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "continuousMode": obj.get("continuousMode"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "ipv6Policy": obj.get("ipv6Policy"), + "pingPayloadSize": obj.get("pingPayloadSize"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False, + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/agent_to_server_tests.py b/tests_api/tests_api/models/agent_to_server_tests.py new file mode 100644 index 00000000..8f10718c --- /dev/null +++ b/tests_api/tests_api/models/agent_to_server_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.agent_to_server_test import AgentToServerTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AgentToServerTests(BaseModel): + """ + AgentToServerTests + """ # noqa: E501 + tests: Optional[List[AgentToServerTest]] = None + __properties: ClassVar[List[str]] = ["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 AgentToServerTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AgentToServerTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [AgentToServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/alert_rounds_violation_mode.py b/tests_api/tests_api/models/alert_rounds_violation_mode.py new file mode 100644 index 00000000..c10d238c --- /dev/null +++ b/tests_api/tests_api/models/alert_rounds_violation_mode.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 AlertRoundsViolationMode(str, Enum): + """ + `exact` requires that the same agent(s) meet the threshold in consecutive rounds; default is `any` + """ + + """ + allowed enum values + """ + EXACT = 'exact' + ANY = 'any' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AlertRoundsViolationMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/alert_rule.py b/tests_api/tests_api/models/alert_rule.py new file mode 100644 index 00000000..91dfdad1 --- /dev/null +++ b/tests_api/tests_api/models/alert_rule.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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, StrictInt, StrictStr +from pydantic import Field +from tests_api.models.alert_rounds_violation_mode import AlertRoundsViolationMode +from tests_api.models.alert_type import AlertType +from tests_api.models.test_direction import TestDirection +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AlertRule(BaseModel): + """ + AlertRule + """ # noqa: E501 + rule_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the rule", alias="ruleId") + rule_name: Optional[StrictStr] = Field(default=None, description="Name of the alert rule", alias="ruleName") + expression: Optional[StrictStr] = Field(default=None, description="String expression of alert rule") + direction: Optional[TestDirection] = None + is_default: Optional[StrictBool] = Field(default=None, description="Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", alias="isDefault") + alert_type: Optional[AlertType] = Field(default=None, alias="alertType") + minimum_sources: Optional[StrictInt] = Field(default=None, description="The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", alias="minimumSources") + minimum_sources_pct: Optional[StrictInt] = Field(default=None, description="the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", alias="minimumSourcesPct") + rounds_violating_mode: Optional[AlertRoundsViolationMode] = Field(default=None, alias="roundsViolatingMode") + rounds_violating_out_of: Optional[StrictInt] = Field(default=None, description="Specifies the divisor (y value) for the “X of Y times” condition.", alias="roundsViolatingOutOf") + rounds_violating_required: Optional[StrictInt] = Field(default=None, description="Specifies the numerator (x value) for the “X of Y times” condition", alias="roundsViolatingRequired") + __properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "direction", "isDefault", "alertType", "minimumSources", "minimumSourcesPct", "roundsViolatingMode", "roundsViolatingOutOf", "roundsViolatingRequired"] + + 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 AlertRule 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={ + "rule_id", + "rule_name", + "expression", + "is_default", + "minimum_sources", + "minimum_sources_pct", + "rounds_violating_out_of", + "rounds_violating_required", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AlertRule 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"), + "direction": obj.get("direction"), + "isDefault": obj.get("isDefault"), + "alertType": obj.get("alertType"), + "minimumSources": obj.get("minimumSources"), + "minimumSourcesPct": obj.get("minimumSourcesPct"), + "roundsViolatingMode": obj.get("roundsViolatingMode"), + "roundsViolatingOutOf": obj.get("roundsViolatingOutOf"), + "roundsViolatingRequired": obj.get("roundsViolatingRequired") + }) + return _obj + + diff --git a/tests_api/tests_api/models/alert_type.py b/tests_api/tests_api/models/alert_type.py new file mode 100644 index 00000000..58458930 --- /dev/null +++ b/tests_api/tests_api/models/alert_type.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 AlertType(str, Enum): + """ + Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.thousandeyes.com/v7/alerts/#/alert-details) documentation for a list of possible values + """ + + """ + allowed enum values + """ + PAGE_MINUS_LOAD = 'page-load' + HTTP_MINUS_SERVER = 'http-server' + END_MINUS_TO_MINUS_END_MINUS_SERVER = 'end-to-end-server' + END_MINUS_TO_MINUS_END_MINUS_AGENT = 'end-to-end-agent' + VOICE = 'voice' + DNS_MINUS_SERVER = 'dns-server' + DNS_MINUS_TRACE = 'dns-trace' + DNSSEC = 'dnssec' + BGP = 'bgp' + PATH_MINUS_TRACE = 'path-trace' + FTP = 'ftp' + SIP_MINUS_SERVER = 'sip-server' + TRANSACTIONS = 'transactions' + WEB_MINUS_TRANSACTIONS = 'web-transactions' + AGENT = 'agent' + NETWORK_MINUS_OUTAGE = 'network-outage' + APPLICATION_MINUS_OUTAGE = 'application-outage' + DEVICE_MINUS_DEVICE = 'device-device' + DEVICE_MINUS_INTERFACE = 'device-interface' + ENDPOINT_MINUS_NETWORK_MINUS_SERVER = 'endpoint-network-server' + ENDPOINT_MINUS_HTTP_MINUS_SERVER = 'endpoint-http-server' + ENDPOINT_MINUS_PATH_MINUS_TRACE = 'endpoint-path-trace' + ENDPOINT_MINUS_BROWSER_MINUS_SESSIONS_MINUS_AGENT = 'endpoint-browser-sessions-agent' + ENDPOINT_MINUS_BROWSER_MINUS_SESSIONS_MINUS_APPLICATION = 'endpoint-browser-sessions-application' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AlertType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/base_request.py b/tests_api/tests_api/models/base_request.py new file mode 100644 index 00000000..8cdad24a --- /dev/null +++ b/tests_api/tests_api/models/base_request.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 BaseRequest(BaseModel): + """ + BaseRequest + """ # noqa: E501 + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + __properties: ClassVar[List[str]] = ["labels", "sharedWithAccounts", "alertRules"] + + 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 BaseRequest 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 BaseRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "alertRules": obj.get("alertRules") + }) + return _obj + + diff --git a/tests_api/tests_api/models/base_test.py b/tests_api/tests_api/models/base_test.py new file mode 100644 index 00000000..ce039e28 --- /dev/null +++ b/tests_api/tests_api/models/base_test.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.alert_rule import AlertRule +from tests_api.models.test_interval import TestInterval +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class BaseTest(BaseModel): + """ + BaseTest + """ # 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules"] + + 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 BaseTest 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 alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of BaseTest 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/bgp_test.py b/tests_api/tests_api/models/bgp_test.py new file mode 100644 index 00000000..41fabad3 --- /dev/null +++ b/tests_api/tests_api/models/bgp_test.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.alert_rule import AlertRule +from tests_api.models.monitor import Monitor +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class BgpTest(BaseModel): + """ + BgpTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + include_covered_prefixes: Optional[StrictBool] = Field(default=None, description="Indicate if queries for subprefixes detected under this prefix should included.", alias="includeCoveredPrefixes") + prefix: StrictStr = Field(description="a.b.c.d is a network address, with the prefix length defined as e. Prefixes can be any length from 8 to 24.") + use_public_bgp: Optional[StrictBool] = Field(default=None, description="Indicate if all available public BGP monitors should be used.", alias="usePublicBGP") + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="A list of enabled alert rule objects.", alias="alertRules") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "monitors", "includeCoveredPrefixes", "prefix", "usePublicBGP", "alertsEnabled", "alertRules"] + + 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 BgpTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of BgpTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None, + "includeCoveredPrefixes": obj.get("includeCoveredPrefixes"), + "prefix": obj.get("prefix"), + "usePublicBGP": obj.get("usePublicBGP"), + "alertsEnabled": obj.get("alertsEnabled"), + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/bgp_tests.py b/tests_api/tests_api/models/bgp_tests.py new file mode 100644 index 00000000..b9519f67 --- /dev/null +++ b/tests_api/tests_api/models/bgp_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.bgp_test import BgpTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class BgpTests(BaseModel): + """ + BgpTests + """ # noqa: E501 + tests: Optional[List[BgpTest]] = None + __properties: ClassVar[List[str]] = ["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 BgpTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of BgpTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [BgpTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/cloud_enterprise_agent_type.py b/tests_api/tests_api/models/cloud_enterprise_agent_type.py new file mode 100644 index 00000000..87fa06cb --- /dev/null +++ b/tests_api/tests_api/models/cloud_enterprise_agent_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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)) + + diff --git a/tests_api/tests_api/models/dns_query_class.py b/tests_api/tests_api/models/dns_query_class.py new file mode 100644 index 00000000..e133c6c9 --- /dev/null +++ b/tests_api/tests_api/models/dns_query_class.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 DnsQueryClass(str, Enum): + """ + Domain class used by this test. 'in' stands for Internet, while 'ch' stands for Chaos. + """ + + """ + allowed enum values + """ + IN = 'in' + CH = 'ch' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DnsQueryClass from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/dns_sec_instant_test.py b/tests_api/tests_api/models/dns_sec_instant_test.py new file mode 100644 index 00000000..d18c291f --- /dev/null +++ b/tests_api/tests_api/models/dns_sec_instant_test.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.agent import Agent +from tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsSecInstantTest(BaseModel): + """ + DnsSecInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "domain", "dnsQueryClass"] + + 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 DnsSecInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 DnsSecInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/tests_api/tests_api/models/dns_sec_test.py b/tests_api/tests_api/models/dns_sec_test.py new file mode 100644 index 00000000..14b6210d --- /dev/null +++ b/tests_api/tests_api/models/dns_sec_test.py @@ -0,0 +1,186 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsSecTest(BaseModel): + """ + DnsSecTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "domain", "dnsQueryClass"] + + 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 DnsSecTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 DnsSecTest 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/tests_api/tests_api/models/dns_sec_tests.py b/tests_api/tests_api/models/dns_sec_tests.py new file mode 100644 index 00000000..8657990a --- /dev/null +++ b/tests_api/tests_api/models/dns_sec_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.dns_sec_test import DnsSecTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsSecTests(BaseModel): + """ + DnsSecTests + """ # noqa: E501 + tests: Optional[List[DnsSecTest]] = None + __properties: ClassVar[List[str]] = ["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 DnsSecTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DnsSecTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [DnsSecTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/dns_server_instant_test.py b/tests_api/tests_api/models/dns_server_instant_test.py new file mode 100644 index 00000000..c422b927 --- /dev/null +++ b/tests_api/tests_api/models/dns_server_instant_test.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.test_dns_server import TestDnsServer +from tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsServerInstantTest(BaseModel): + """ + DnsServerInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + dns_servers: List[TestDnsServer] = Field(alias="dnsServers") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + recursive_queries: Optional[StrictBool] = Field(default=None, description="Set true to run query with RD (recursion desired) flag enabled.", alias="recursiveQueries") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass"] + + 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 DnsServerInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 each item in dns_servers (list) + _items = [] + if self.dns_servers: + for _item in self.dns_servers: + if _item: + _items.append(_item.to_dict()) + _dict['dnsServers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DnsServerInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "dnsServers": [TestDnsServer.from_dict(_item) for _item in obj.get("dnsServers")] if obj.get("dnsServers") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "recursiveQueries": obj.get("recursiveQueries"), + "ipv6Policy": obj.get("ipv6Policy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/tests_api/tests_api/models/dns_server_test.py b/tests_api/tests_api/models/dns_server_test.py new file mode 100644 index 00000000..49c993bf --- /dev/null +++ b/tests_api/tests_api/models/dns_server_test.py @@ -0,0 +1,238 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.monitor import Monitor +from tests_api.models.test_dns_server import TestDnsServer +from tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsServerTest(BaseModel): + """ + DnsServerTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + dns_servers: List[TestDnsServer] = Field(alias="dnsServers") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + recursive_queries: Optional[StrictBool] = Field(default=None, description="Set true to run query with RD (recursion desired) flag enabled.", alias="recursiveQueries") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass", "bgpMeasurements", "monitors"] + + 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 DnsServerTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 each item in dns_servers (list) + _items = [] + if self.dns_servers: + for _item in self.dns_servers: + if _item: + _items.append(_item.to_dict()) + _dict['dnsServers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DnsServerTest 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "dnsServers": [TestDnsServer.from_dict(_item) for _item in obj.get("dnsServers")] if obj.get("dnsServers") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "recursiveQueries": obj.get("recursiveQueries"), + "ipv6Policy": obj.get("ipv6Policy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "dnsQueryClass": obj.get("dnsQueryClass"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/dns_server_tests.py b/tests_api/tests_api/models/dns_server_tests.py new file mode 100644 index 00000000..8b80a1fc --- /dev/null +++ b/tests_api/tests_api/models/dns_server_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.dns_server_test import DnsServerTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsServerTests(BaseModel): + """ + DnsServerTests + """ # noqa: E501 + tests: Optional[List[DnsServerTest]] = None + __properties: ClassVar[List[str]] = ["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 DnsServerTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DnsServerTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [DnsServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/dns_trace_instant_test.py b/tests_api/tests_api/models/dns_trace_instant_test.py new file mode 100644 index 00000000..3bba4428 --- /dev/null +++ b/tests_api/tests_api/models/dns_trace_instant_test.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.agent import Agent +from tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsTraceInstantTest(BaseModel): + """ + DnsTraceInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "dnsTransportProtocol", "domain", "dnsQueryClass"] + + 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 DnsTraceInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 DnsTraceInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/tests_api/tests_api/models/dns_trace_test.py b/tests_api/tests_api/models/dns_trace_test.py new file mode 100644 index 00000000..63f001cd --- /dev/null +++ b/tests_api/tests_api/models/dns_trace_test.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsTraceTest(BaseModel): + """ + DnsTraceTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "dnsTransportProtocol", "domain", "dnsQueryClass"] + + 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 DnsTraceTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 DnsTraceTest 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/tests_api/tests_api/models/dns_trace_tests.py b/tests_api/tests_api/models/dns_trace_tests.py new file mode 100644 index 00000000..5d6dc918 --- /dev/null +++ b/tests_api/tests_api/models/dns_trace_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.dns_trace_test import DnsTraceTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class DnsTraceTests(BaseModel): + """ + DnsTraceTests + """ # noqa: E501 + tests: Optional[List[DnsTraceTest]] = None + __properties: ClassVar[List[str]] = ["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 DnsTraceTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of DnsTraceTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [DnsTraceTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/error.py b/tests_api/tests_api/models/error.py new file mode 100644 index 00000000..4fa2016b --- /dev/null +++ b/tests_api/tests_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 + + diff --git a/tests_api/tests_api/models/expand.py b/tests_api/tests_api/models/expand.py new file mode 100644 index 00000000..b1a169c2 --- /dev/null +++ b/tests_api/tests_api/models/expand.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 Expand(str, Enum): + """ + Expand + """ + + """ + allowed enum values + """ + AGENT = 'agent' + ALERT_MINUS_RULE = 'alert-rule' + MONITOR = 'monitor' + LABEL = 'label' + SHARED_MINUS_WITH_MINUS_ACCOUNT = 'shared-with-account' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Expand from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/ftp_server_instant_test.py b/tests_api/tests_api/models/ftp_server_instant_test.py new file mode 100644 index 00000000..e4d96f07 --- /dev/null +++ b/tests_api/tests_api/models/ftp_server_instant_test.py @@ -0,0 +1,206 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.ftp_server_request_type import FtpServerRequestType +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class FtpServerInstantTest(BaseModel): + """ + FtpServerInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + download_limit: Optional[StrictInt] = Field(default=None, description="Specify maximum number of bytes to download from the target object.", alias="downloadLimit") + ftp_target_time: Optional[Annotated[int, Field(le=6000, strict=True, ge=1000)]] = Field(default=None, description="Target time for operation completion; specified in milliseconds.", alias="ftpTargetTime") + ftp_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=10)]] = Field(default=10, description="Set the time limit for the test in seconds.", alias="ftpTimeLimit") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: StrictStr = Field(description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + request_type: FtpServerRequestType = Field(alias="requestType") + url: StrictStr = Field(description="Target for the test.") + use_active_ftp: Optional[StrictBool] = Field(default=False, description="Explicitly set the flag to use active FTP.", alias="useActiveFtp") + use_explicit_ftps: Optional[StrictBool] = Field(default=None, description="Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS.", alias="useExplicitFtps") + username: StrictStr = Field(description="Username for Basic/NTLM authentication.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy"] + + 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 FtpServerInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 FtpServerInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "downloadLimit": obj.get("downloadLimit"), + "ftpTargetTime": obj.get("ftpTargetTime"), + "ftpTimeLimit": obj.get("ftpTimeLimit") if obj.get("ftpTimeLimit") is not None else 10, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "requestType": obj.get("requestType"), + "url": obj.get("url"), + "useActiveFtp": obj.get("useActiveFtp") if obj.get("useActiveFtp") is not None else False, + "useExplicitFtps": obj.get("useExplicitFtps"), + "username": obj.get("username"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy") + }) + return _obj + + diff --git a/tests_api/tests_api/models/ftp_server_request_type.py b/tests_api/tests_api/models/ftp_server_request_type.py new file mode 100644 index 00000000..c1fb72d1 --- /dev/null +++ b/tests_api/tests_api/models/ftp_server_request_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 FtpServerRequestType(str, Enum): + """ + Set the type of activity for the test. + """ + + """ + allowed enum values + """ + DOWNLOAD = 'download' + UPLOAD = 'upload' + LIST = 'list' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FtpServerRequestType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/ftp_server_test.py b/tests_api/tests_api/models/ftp_server_test.py new file mode 100644 index 00000000..a0c4603d --- /dev/null +++ b/tests_api/tests_api/models/ftp_server_test.py @@ -0,0 +1,237 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.ftp_server_request_type import FtpServerRequestType +from tests_api.models.monitor import Monitor +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class FtpServerTest(BaseModel): + """ + FtpServerTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + download_limit: Optional[StrictInt] = Field(default=None, description="Specify maximum number of bytes to download from the target object.", alias="downloadLimit") + ftp_target_time: Optional[Annotated[int, Field(le=6000, strict=True, ge=1000)]] = Field(default=None, description="Target time for operation completion; specified in milliseconds.", alias="ftpTargetTime") + ftp_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=10)]] = Field(default=10, description="Set the time limit for the test in seconds.", alias="ftpTimeLimit") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: StrictStr = Field(description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + request_type: FtpServerRequestType = Field(alias="requestType") + url: StrictStr = Field(description="Target for the test.") + use_active_ftp: Optional[StrictBool] = Field(default=False, description="Explicitly set the flag to use active FTP.", alias="useActiveFtp") + use_explicit_ftps: Optional[StrictBool] = Field(default=None, description="Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS.", alias="useExplicitFtps") + username: StrictStr = Field(description="Username for Basic/NTLM authentication.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy", "bgpMeasurements", "monitors"] + + 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 FtpServerTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of FtpServerTest 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "downloadLimit": obj.get("downloadLimit"), + "ftpTargetTime": obj.get("ftpTargetTime"), + "ftpTimeLimit": obj.get("ftpTimeLimit") if obj.get("ftpTimeLimit") is not None else 10, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "requestType": obj.get("requestType"), + "url": obj.get("url"), + "useActiveFtp": obj.get("useActiveFtp") if obj.get("useActiveFtp") is not None else False, + "useExplicitFtps": obj.get("useExplicitFtps"), + "username": obj.get("username"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/ftp_server_tests.py b/tests_api/tests_api/models/ftp_server_tests.py new file mode 100644 index 00000000..affc7bf3 --- /dev/null +++ b/tests_api/tests_api/models/ftp_server_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.ftp_server_test import FtpServerTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class FtpServerTests(BaseModel): + """ + FtpServerTests + """ # noqa: E501 + tests: Optional[List[FtpServerTest]] = None + __properties: ClassVar[List[str]] = ["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 FtpServerTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of FtpServerTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [FtpServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_agent_to_agent_test200_response.py b/tests_api/tests_api/models/get_agent_to_agent_test200_response.py new file mode 100644 index 00000000..80b3804c --- /dev/null +++ b/tests_api/tests_api/models/get_agent_to_agent_test200_response.py @@ -0,0 +1,228 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from tests_api.models.alert_rule import AlertRule +from tests_api.models.monitor import Monitor +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_direction import TestDirection +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetAgentToAgentTest200Response(BaseModel): + """ + GetAgentToAgentTest200Response + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + direction: Optional[TestDirection] = None + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + mss: Optional[Annotated[int, Field(le=1400, strict=True, ge=20)]] = Field(default=None, description="Maximum segment size, in bytes.") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + protocol: Optional[AgentToAgentTestProtocol] = None + target_agent_id: StrictStr = Field(description="`agentId` of the target agent for the test.", alias="targetAgentId") + throughput_measurements: Optional[StrictBool] = Field(default=False, description="Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent.", alias="throughputMeasurements") + throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration") + throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate", "bgpMeasurements", "monitors"] + + 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 GetAgentToAgentTest200Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "dscp", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetAgentToAgentTest200Response 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "direction": obj.get("direction"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "mss": obj.get("mss"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "targetAgentId": obj.get("targetAgentId"), + "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False, + "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000, + "throughputRate": obj.get("throughputRate"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_agent_to_agent_tests200_response.py b/tests_api/tests_api/models/get_agent_to_agent_tests200_response.py new file mode 100644 index 00000000..ff08d525 --- /dev/null +++ b/tests_api/tests_api/models/get_agent_to_agent_tests200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.agent_to_agent_test import AgentToAgentTest +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetAgentToAgentTests200Response(BaseModel): + """ + GetAgentToAgentTests200Response + """ # noqa: E501 + tests: Optional[List[AgentToAgentTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetAgentToAgentTests200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetAgentToAgentTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [AgentToAgentTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_agent_to_server_test200_response.py b/tests_api/tests_api/models/get_agent_to_server_test200_response.py new file mode 100644 index 00000000..ca613867 --- /dev/null +++ b/tests_api/tests_api/models/get_agent_to_server_test200_response.py @@ -0,0 +1,233 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.monitor import Monitor +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetAgentToServerTest200Response(BaseModel): + """ + GetAgentToServerTest200Response + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + continuous_mode: Optional[StrictBool] = Field(default=None, description="To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. ", alias="continuousMode") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1`", alias="fixedPacketRate") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + server: StrictStr = Field(description="Target name or IP address.") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize") + network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "bgpMeasurements", "monitors"] + + 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 GetAgentToServerTest200Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "dscp", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetAgentToServerTest200Response 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "continuousMode": obj.get("continuousMode"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "ipv6Policy": obj.get("ipv6Policy"), + "pingPayloadSize": obj.get("pingPayloadSize"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False, + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_agent_to_server_tests200_response.py b/tests_api/tests_api/models/get_agent_to_server_tests200_response.py new file mode 100644 index 00000000..2e0a92b8 --- /dev/null +++ b/tests_api/tests_api/models/get_agent_to_server_tests200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.agent_to_server_test import AgentToServerTest +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetAgentToServerTests200Response(BaseModel): + """ + GetAgentToServerTests200Response + """ # noqa: E501 + tests: Optional[List[AgentToServerTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetAgentToServerTests200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetAgentToServerTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [AgentToServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_bgp_test200_response.py b/tests_api/tests_api/models/get_bgp_test200_response.py new file mode 100644 index 00000000..65e87039 --- /dev/null +++ b/tests_api/tests_api/models/get_bgp_test200_response.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.alert_rule import AlertRule +from tests_api.models.monitor import Monitor +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetBgpTest200Response(BaseModel): + """ + GetBgpTest200Response + """ # 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[StrictStr] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + include_covered_prefixes: Optional[StrictBool] = Field(default=None, description="Indicate if queries for subprefixes detected under this prefix should included.", alias="includeCoveredPrefixes") + prefix: StrictStr = Field(description="a.b.c.d is a network address, with the prefix length defined as e. Prefixes can be any length from 8 to 24.") + use_public_bgp: Optional[StrictBool] = Field(default=None, description="Indicate if all available public BGP monitors should be used.", alias="usePublicBGP") + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="A list of enabled alert rule objects.", alias="alertRules") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "monitors", "includeCoveredPrefixes", "prefix", "usePublicBGP", "alertsEnabled", "alertRules"] + + 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 GetBgpTest200Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetBgpTest200Response 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": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None, + "includeCoveredPrefixes": obj.get("includeCoveredPrefixes"), + "prefix": obj.get("prefix"), + "usePublicBGP": obj.get("usePublicBGP"), + "alertsEnabled": obj.get("alertsEnabled"), + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_bgp_tests200_response.py b/tests_api/tests_api/models/get_bgp_tests200_response.py new file mode 100644 index 00000000..c11b4ee0 --- /dev/null +++ b/tests_api/tests_api/models/get_bgp_tests200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.bgp_test import BgpTest +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetBgpTests200Response(BaseModel): + """ + GetBgpTests200Response + """ # noqa: E501 + tests: Optional[List[BgpTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetBgpTests200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetBgpTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [BgpTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_dns_sec_test200_response.py b/tests_api/tests_api/models/get_dns_sec_test200_response.py new file mode 100644 index 00000000..d7d0be49 --- /dev/null +++ b/tests_api/tests_api/models/get_dns_sec_test200_response.py @@ -0,0 +1,186 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetDnsSecTest200Response(BaseModel): + """ + GetDnsSecTest200Response + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "domain", "dnsQueryClass"] + + 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 GetDnsSecTest200Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 GetDnsSecTest200Response 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_dns_sec_tests200_response.py b/tests_api/tests_api/models/get_dns_sec_tests200_response.py new file mode 100644 index 00000000..c0493b5c --- /dev/null +++ b/tests_api/tests_api/models/get_dns_sec_tests200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.dns_sec_test import DnsSecTest +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetDnsSecTests200Response(BaseModel): + """ + GetDnsSecTests200Response + """ # noqa: E501 + tests: Optional[List[DnsSecTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetDnsSecTests200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetDnsSecTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [DnsSecTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_dns_server_test200_response.py b/tests_api/tests_api/models/get_dns_server_test200_response.py new file mode 100644 index 00000000..5d33fe84 --- /dev/null +++ b/tests_api/tests_api/models/get_dns_server_test200_response.py @@ -0,0 +1,238 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.monitor import Monitor +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_dns_server import TestDnsServer +from tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetDNSServerTest200Response(BaseModel): + """ + GetDNSServerTest200Response + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + dns_servers: List[TestDnsServer] = Field(alias="dnsServers") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + recursive_queries: Optional[StrictBool] = Field(default=None, description="Set true to run query with RD (recursion desired) flag enabled.", alias="recursiveQueries") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass", "bgpMeasurements", "monitors"] + + 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 GetDNSServerTest200Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 each item in dns_servers (list) + _items = [] + if self.dns_servers: + for _item in self.dns_servers: + if _item: + _items.append(_item.to_dict()) + _dict['dnsServers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetDNSServerTest200Response 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "dnsServers": [TestDnsServer.from_dict(_item) for _item in obj.get("dnsServers")] if obj.get("dnsServers") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "recursiveQueries": obj.get("recursiveQueries"), + "ipv6Policy": obj.get("ipv6Policy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "dnsQueryClass": obj.get("dnsQueryClass"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_dns_server_tests200_response.py b/tests_api/tests_api/models/get_dns_server_tests200_response.py new file mode 100644 index 00000000..323d12e5 --- /dev/null +++ b/tests_api/tests_api/models/get_dns_server_tests200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.dns_server_test import DnsServerTest +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetDNSServerTests200Response(BaseModel): + """ + GetDNSServerTests200Response + """ # noqa: E501 + tests: Optional[List[DnsServerTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetDNSServerTests200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetDNSServerTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [DnsServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_dns_trace_test200_response.py b/tests_api/tests_api/models/get_dns_trace_test200_response.py new file mode 100644 index 00000000..6113f0c6 --- /dev/null +++ b/tests_api/tests_api/models/get_dns_trace_test200_response.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetDnsTraceTest200Response(BaseModel): + """ + GetDnsTraceTest200Response + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "dnsTransportProtocol", "domain", "dnsQueryClass"] + + 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 GetDnsTraceTest200Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 GetDnsTraceTest200Response 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_dns_trace_tests200_response.py b/tests_api/tests_api/models/get_dns_trace_tests200_response.py new file mode 100644 index 00000000..31c76749 --- /dev/null +++ b/tests_api/tests_api/models/get_dns_trace_tests200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.dns_trace_test import DnsTraceTest +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetDnsTraceTests200Response(BaseModel): + """ + GetDnsTraceTests200Response + """ # noqa: E501 + tests: Optional[List[DnsTraceTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetDnsTraceTests200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetDnsTraceTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [DnsTraceTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_ftp_server_test200_response.py b/tests_api/tests_api/models/get_ftp_server_test200_response.py new file mode 100644 index 00000000..12f32a23 --- /dev/null +++ b/tests_api/tests_api/models/get_ftp_server_test200_response.py @@ -0,0 +1,237 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.ftp_server_request_type import FtpServerRequestType +from tests_api.models.monitor import Monitor +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetFtpServerTest200Response(BaseModel): + """ + GetFtpServerTest200Response + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + download_limit: Optional[StrictInt] = Field(default=None, description="Specify maximum number of bytes to download from the target object.", alias="downloadLimit") + ftp_target_time: Optional[Annotated[int, Field(le=6000, strict=True, ge=1000)]] = Field(default=None, description="Target time for operation completion; specified in milliseconds.", alias="ftpTargetTime") + ftp_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=10)]] = Field(default=10, description="Set the time limit for the test in seconds.", alias="ftpTimeLimit") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: StrictStr = Field(description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + request_type: FtpServerRequestType = Field(alias="requestType") + url: StrictStr = Field(description="Target for the test.") + use_active_ftp: Optional[StrictBool] = Field(default=False, description="Explicitly set the flag to use active FTP.", alias="useActiveFtp") + use_explicit_ftps: Optional[StrictBool] = Field(default=None, description="Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS.", alias="useExplicitFtps") + username: StrictStr = Field(description="Username for Basic/NTLM authentication.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy", "bgpMeasurements", "monitors"] + + 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 GetFtpServerTest200Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetFtpServerTest200Response 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "downloadLimit": obj.get("downloadLimit"), + "ftpTargetTime": obj.get("ftpTargetTime"), + "ftpTimeLimit": obj.get("ftpTimeLimit") if obj.get("ftpTimeLimit") is not None else 10, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "requestType": obj.get("requestType"), + "url": obj.get("url"), + "useActiveFtp": obj.get("useActiveFtp") if obj.get("useActiveFtp") is not None else False, + "useExplicitFtps": obj.get("useExplicitFtps"), + "username": obj.get("username"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_ftp_server_tests200_response.py b/tests_api/tests_api/models/get_ftp_server_tests200_response.py new file mode 100644 index 00000000..b82ab15b --- /dev/null +++ b/tests_api/tests_api/models/get_ftp_server_tests200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.ftp_server_test import FtpServerTest +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetFtpServerTests200Response(BaseModel): + """ + GetFtpServerTests200Response + """ # noqa: E501 + tests: Optional[List[FtpServerTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetFtpServerTests200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetFtpServerTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [FtpServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_http_server_test200_response.py b/tests_api/tests_api/models/get_http_server_test200_response.py new file mode 100644 index 00000000..5b9c59d2 --- /dev/null +++ b/tests_api/tests_api/models/get_http_server_test200_response.py @@ -0,0 +1,270 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.monitor import Monitor +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_ssl_version_id import TestSslVersionId +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetHttpServerTest200Response(BaseModel): + """ + GetHttpServerTest200Response + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "headers", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "postBody", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "ipv6Policy", "followRedirects", "fixedPacketRate", "bgpMeasurements", "monitors"] + + 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 GetHttpServerTest200Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "ssl_version", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetHttpServerTest200Response 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "headers": obj.get("headers"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "postBody": obj.get("postBody"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "ipv6Policy": obj.get("ipv6Policy"), + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_http_server_tests200_response.py b/tests_api/tests_api/models/get_http_server_tests200_response.py new file mode 100644 index 00000000..dd0dae6b --- /dev/null +++ b/tests_api/tests_api/models/get_http_server_tests200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.http_server_test import HttpServerTest +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetHttpServerTests200Response(BaseModel): + """ + GetHttpServerTests200Response + """ # noqa: E501 + tests: Optional[List[HttpServerTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetHttpServerTests200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetHttpServerTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [HttpServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_page_load_test200_response.py b/tests_api/tests_api/models/get_page_load_test200_response.py new file mode 100644 index 00000000..83a0b4f8 --- /dev/null +++ b/tests_api/tests_api/models/get_page_load_test200_response.py @@ -0,0 +1,280 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.monitor import Monitor +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_http_interval import TestHttpInterval +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.test_sub_interval import TestSubInterval +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetPageLoadTest200Response(BaseModel): + """ + GetPageLoadTest200Response + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + page_load_target_time: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`.", alias="pageLoadTargetTime") + page_load_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=10, description="Page load time limit. Must be larger than the `httpTimeLimit`.", alias="pageLoadTimeLimit") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + http_interval: TestHttpInterval = Field(alias="httpInterval") + subinterval: Optional[TestSubInterval] = None + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pageLoadTargetTime", "pageLoadTimeLimit", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate", "bgpMeasurements", "monitors", "httpInterval", "subinterval"] + + 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 GetPageLoadTest200Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "ssl_version", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetPageLoadTest200Response 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pageLoadTargetTime": obj.get("pageLoadTargetTime"), + "pageLoadTimeLimit": obj.get("pageLoadTimeLimit") if obj.get("pageLoadTimeLimit") is not None else 10, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None, + "httpInterval": obj.get("httpInterval"), + "subinterval": obj.get("subinterval") + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_page_load_tests200_response.py b/tests_api/tests_api/models/get_page_load_tests200_response.py new file mode 100644 index 00000000..82e5f075 --- /dev/null +++ b/tests_api/tests_api/models/get_page_load_tests200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.page_load_test import PageLoadTest +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetPageLoadTests200Response(BaseModel): + """ + GetPageLoadTests200Response + """ # noqa: E501 + tests: Optional[List[PageLoadTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetPageLoadTests200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetPageLoadTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [PageLoadTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_path_vis_interface_groups200_response.py b/tests_api/tests_api/models/get_path_vis_interface_groups200_response.py new file mode 100644 index 00000000..24a97209 --- /dev/null +++ b/tests_api/tests_api/models/get_path_vis_interface_groups200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.interface_group import InterfaceGroup +from tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetPathVisInterfaceGroups200Response(BaseModel): + """ + GetPathVisInterfaceGroups200Response + """ # noqa: E501 + path_vis_interface_groups: Optional[List[InterfaceGroup]] = Field(default=None, alias="pathVisInterfaceGroups") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["pathVisInterfaceGroups", "_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 GetPathVisInterfaceGroups200Response 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 path_vis_interface_groups (list) + _items = [] + if self.path_vis_interface_groups: + for _item in self.path_vis_interface_groups: + if _item: + _items.append(_item.to_dict()) + _dict['pathVisInterfaceGroups'] = _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 GetPathVisInterfaceGroups200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pathVisInterfaceGroups": [InterfaceGroup.from_dict(_item) for _item in obj.get("pathVisInterfaceGroups")] if obj.get("pathVisInterfaceGroups") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_sip_server_test200_response.py b/tests_api/tests_api/models/get_sip_server_test200_response.py new file mode 100644 index 00000000..78d8673b --- /dev/null +++ b/tests_api/tests_api/models/get_sip_server_test200_response.py @@ -0,0 +1,223 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.sip_test_protocol import SipTestProtocol +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_sip_credentials import TestSipCredentials +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetSipServerTest200Response(BaseModel): + """ + GetSipServerTest200Response + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_user: Optional[StrictStr] = Field(default=None, description="Username for authentication with SIP server.", alias="authUser") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + options_regex: Optional[StrictStr] = Field(default=None, description="Options regex, this field does not require escaping.", alias="optionsRegex") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Annotated[int, Field(le=65535, strict=True, ge=1)] = Field(description="Target port.") + protocol: Optional[SipTestProtocol] = None + register_enabled: Optional[StrictBool] = Field(default=False, description="Set to true to perform SIP registration on the test target with the SIP REGISTER command.", alias="registerEnabled") + sip_registrar: Optional[StrictStr] = Field(default=None, description="SIP server to be tested, specified by domain name or IP address.", alias="sipRegistrar") + sip_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for test completion in milliseconds.", alias="sipTargetTime") + sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit") + target_sip_credentials: TestSipCredentials = Field(alias="targetSipCredentials") + user: Optional[StrictStr] = Field(default=None, description="Username for SIP registration, should be unique within a ThousandEyes account group.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authUser", "mtuMeasurements", "networkMeasurements", "optionsRegex", "password", "pathTraceMode", "port", "protocol", "registerEnabled", "sipRegistrar", "sipTargetTime", "sipTimeLimit", "targetSipCredentials", "user", "fixedPacketRate", "ipv6Policy", "bgpMeasurements"] + + 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 GetSipServerTest200Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 target_sip_credentials + if self.target_sip_credentials: + _dict['targetSipCredentials'] = self.target_sip_credentials.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetSipServerTest200Response 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authUser": obj.get("authUser"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "optionsRegex": obj.get("optionsRegex"), + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "registerEnabled": obj.get("registerEnabled") if obj.get("registerEnabled") is not None else False, + "sipRegistrar": obj.get("sipRegistrar"), + "sipTargetTime": obj.get("sipTargetTime"), + "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5, + "targetSipCredentials": TestSipCredentials.from_dict(obj.get("targetSipCredentials")) if obj.get("targetSipCredentials") is not None else None, + "user": obj.get("user"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_sip_server_tests200_response.py b/tests_api/tests_api/models/get_sip_server_tests200_response.py new file mode 100644 index 00000000..045a95b7 --- /dev/null +++ b/tests_api/tests_api/models/get_sip_server_tests200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.sip_server_test import SipServerTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetSipServerTests200Response(BaseModel): + """ + GetSipServerTests200Response + """ # noqa: E501 + tests: Optional[List[SipServerTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetSipServerTests200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetSipServerTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [SipServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_tests200_response.py b/tests_api/tests_api/models/get_tests200_response.py new file mode 100644 index 00000000..0ff79669 --- /dev/null +++ b/tests_api/tests_api/models/get_tests200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetTests200Response(BaseModel): + """ + GetTests200Response + """ # noqa: E501 + tests: Optional[List[SimpleTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetTests200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [SimpleTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_voice_test200_response.py b/tests_api/tests_api/models/get_voice_test200_response.py new file mode 100644 index 00000000..00aeccfc --- /dev/null +++ b/tests_api/tests_api/models/get_voice_test200_response.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetVoiceTest200Response(BaseModel): + """ + GetVoiceTest200Response + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + codec: Optional[StrictStr] = Field(default=None, description="Codec label") + codec_id: Optional[StrictStr] = Field(default=None, description="Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab)", alias="codecId") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + duration: Optional[Annotated[int, Field(le=30, strict=True, ge=5)]] = Field(default=5, description="Duration of the test in seconds.") + jitter_buffer: Optional[Annotated[int, Field(le=150, strict=True, ge=0)]] = Field(default=40, description="De-jitter buffer size in seconds.", alias="jitterBuffer") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.") + target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId", "bgpMeasurements"] + + 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 GetVoiceTest200Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "codec", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 GetVoiceTest200Response 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "codec": obj.get("codec"), + "codecId": obj.get("codecId"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "duration": obj.get("duration") if obj.get("duration") is not None else 5, + "jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "port": obj.get("port"), + "targetAgentId": obj.get("targetAgentId"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_voice_tests200_response.py b/tests_api/tests_api/models/get_voice_tests200_response.py new file mode 100644 index 00000000..8834057d --- /dev/null +++ b/tests_api/tests_api/models/get_voice_tests200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.voice_test import VoiceTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetVoiceTests200Response(BaseModel): + """ + GetVoiceTests200Response + """ # noqa: E501 + tests: Optional[List[VoiceTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetVoiceTests200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetVoiceTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [VoiceTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_web_transactions_test200_response.py b/tests_api/tests_api/models/get_web_transactions_test200_response.py new file mode 100644 index 00000000..cf6cf4e7 --- /dev/null +++ b/tests_api/tests_api/models/get_web_transactions_test200_response.py @@ -0,0 +1,283 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.monitor import Monitor +from tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.test_sub_interval import TestSubInterval +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetWebTransactionsTest200Response(BaseModel): + """ + GetWebTransactionsTest200Response + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex") + credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=1)]] = Field(default=None, description="Target time for completion, defaults to 50% of time limit specified in seconds.", alias="targetTime") + time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds.", alias="timeLimit") + transaction_script: StrictStr = Field(description="JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ).", alias="transactionScript") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + subinterval: Optional[TestSubInterval] = None + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "credentials", "customHeaders", "desiredStatusCode", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "targetTime", "timeLimit", "transactionScript", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate", "bgpMeasurements", "monitors", "subinterval"] + + 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 GetWebTransactionsTest200Response 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "ssl_version", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetWebTransactionsTest200Response 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "credentials": obj.get("credentials"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "targetTime": obj.get("targetTime"), + "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, + "transactionScript": obj.get("transactionScript"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None, + "subinterval": obj.get("subinterval") + }) + return _obj + + diff --git a/tests_api/tests_api/models/get_web_transactions_tests200_response.py b/tests_api/tests_api/models/get_web_transactions_tests200_response.py new file mode 100644 index 00000000..82a78dc0 --- /dev/null +++ b/tests_api/tests_api/models/get_web_transactions_tests200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.self_links_links import SelfLinksLinks +from tests_api.models.web_transaction_test import WebTransactionTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetWebTransactionsTests200Response(BaseModel): + """ + GetWebTransactionsTests200Response + """ # noqa: E501 + tests: Optional[List[WebTransactionTest]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["tests", "_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 GetWebTransactionsTests200Response 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 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetWebTransactionsTests200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [WebTransactionTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/http_server_instant_test.py b/tests_api/tests_api/models/http_server_instant_test.py new file mode 100644 index 00000000..bf123a65 --- /dev/null +++ b/tests_api/tests_api/models/http_server_instant_test.py @@ -0,0 +1,239 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class HttpServerInstantTest(BaseModel): + """ + HttpServerInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "headers", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "postBody", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "ipv6Policy", "followRedirects", "fixedPacketRate"] + + 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 HttpServerInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of HttpServerInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "headers": obj.get("headers"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "postBody": obj.get("postBody"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "ipv6Policy": obj.get("ipv6Policy"), + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate") + }) + return _obj + + diff --git a/tests_api/tests_api/models/http_server_test.py b/tests_api/tests_api/models/http_server_test.py new file mode 100644 index 00000000..729d7244 --- /dev/null +++ b/tests_api/tests_api/models/http_server_test.py @@ -0,0 +1,270 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.monitor import Monitor +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class HttpServerTest(BaseModel): + """ + HttpServerTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "headers", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "postBody", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "ipv6Policy", "followRedirects", "fixedPacketRate", "bgpMeasurements", "monitors"] + + 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 HttpServerTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "ssl_version", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of HttpServerTest 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "headers": obj.get("headers"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "postBody": obj.get("postBody"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "ipv6Policy": obj.get("ipv6Policy"), + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/http_server_tests.py b/tests_api/tests_api/models/http_server_tests.py new file mode 100644 index 00000000..6b8bdc52 --- /dev/null +++ b/tests_api/tests_api/models/http_server_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.http_server_test import HttpServerTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class HttpServerTests(BaseModel): + """ + HttpServerTests + """ # noqa: E501 + tests: Optional[List[HttpServerTest]] = None + __properties: ClassVar[List[str]] = ["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 HttpServerTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of HttpServerTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [HttpServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/instant_test.py b/tests_api/tests_api/models/instant_test.py new file mode 100644 index 00000000..e8cf847c --- /dev/null +++ b/tests_api/tests_api/models/instant_test.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_type import TestType +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class InstantTest(BaseModel): + """ + InstantTest + """ # 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") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts"] + + 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 InstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "labels", + "shared_with_accounts", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of InstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/interface_group.py b/tests_api/tests_api/models/interface_group.py new file mode 100644 index 00000000..876b9b26 --- /dev/null +++ b/tests_api/tests_api/models/interface_group.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 InterfaceGroup(BaseModel): + """ + InterfaceGroup + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="Account Group Id") + group_id: Optional[StrictStr] = Field(default=None, description="Group ID", alias="groupId") + group_name: Optional[StrictStr] = Field(default=None, description="Name of the path visualization interface group", alias="groupName") + ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of IP addresses associated with the interface group", alias="ipAddresses") + rdns_regexes: Optional[List[StrictStr]] = Field(default=None, description="Array of RDNS Regexes associated with the interface group", alias="rdnsRegexes") + __properties: ClassVar[List[str]] = ["aid", "groupId", "groupName", "ipAddresses", "rdnsRegexes"] + + 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 InterfaceGroup 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={ + "aid", + "group_id", + "rdns_regexes", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of InterfaceGroup 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"), + "groupId": obj.get("groupId"), + "groupName": obj.get("groupName"), + "ipAddresses": obj.get("ipAddresses"), + "rdnsRegexes": obj.get("rdnsRegexes") + }) + return _obj + + diff --git a/tests_api/tests_api/models/interface_groups.py b/tests_api/tests_api/models/interface_groups.py new file mode 100644 index 00000000..d93432cc --- /dev/null +++ b/tests_api/tests_api/models/interface_groups.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.interface_group import InterfaceGroup +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class InterfaceGroups(BaseModel): + """ + InterfaceGroups + """ # noqa: E501 + path_vis_interface_groups: Optional[List[InterfaceGroup]] = Field(default=None, alias="pathVisInterfaceGroups") + __properties: ClassVar[List[str]] = ["pathVisInterfaceGroups"] + + 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 InterfaceGroups 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 path_vis_interface_groups (list) + _items = [] + if self.path_vis_interface_groups: + for _item in self.path_vis_interface_groups: + if _item: + _items.append(_item.to_dict()) + _dict['pathVisInterfaceGroups'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of InterfaceGroups from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pathVisInterfaceGroups": [InterfaceGroup.from_dict(_item) for _item in obj.get("pathVisInterfaceGroups")] if obj.get("pathVisInterfaceGroups") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/link.py b/tests_api/tests_api/models/link.py new file mode 100644 index 00000000..17761647 --- /dev/null +++ b/tests_api/tests_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 + + diff --git a/tests_api/tests_api/models/map_item.py b/tests_api/tests_api/models/map_item.py new file mode 100644 index 00000000..9a7e26a9 --- /dev/null +++ b/tests_api/tests_api/models/map_item.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 MapItem(BaseModel): + """ + MapItem + """ # noqa: E501 + key: Optional[StrictStr] = None + value: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["key", "value"] + + 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 MapItem 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 MapItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "key": obj.get("key"), + "value": obj.get("value") + }) + return _obj + + diff --git a/tests_api/tests_api/models/monitor.py b/tests_api/tests_api/models/monitor.py new file mode 100644 index 00000000..8bd0e210 --- /dev/null +++ b/tests_api/tests_api/models/monitor.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.monitor_type import MonitorType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Monitor(BaseModel): + """ + Monitor + """ # noqa: E501 + country_id: Optional[StrictStr] = Field(default=None, description="Country ID", alias="countryId") + monitor_id: Optional[StrictStr] = Field(default=None, description="BGP monitor ID", alias="monitorId") + ip_address: Optional[StrictStr] = Field(default=None, description="IP address of the BGP monitor", alias="ipAddress") + network: Optional[StrictStr] = Field(default=None, description="Name of the autonomous system in which the monitor is found") + monitor_type: Optional[MonitorType] = Field(default=None, alias="monitorType") + monitor_name: Optional[StrictStr] = Field(default=None, description="Display name of the BGP monitor", alias="monitorName") + __properties: ClassVar[List[str]] = ["countryId", "monitorId", "ipAddress", "network", "monitorType", "monitorName"] + + 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 Monitor 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={ + "country_id", + "monitor_id", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Monitor from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "countryId": obj.get("countryId"), + "monitorId": obj.get("monitorId"), + "ipAddress": obj.get("ipAddress"), + "network": obj.get("network"), + "monitorType": obj.get("monitorType"), + "monitorName": obj.get("monitorName") + }) + return _obj + + diff --git a/tests_api/tests_api/models/monitor_type.py b/tests_api/tests_api/models/monitor_type.py new file mode 100644 index 00000000..4fa34c58 --- /dev/null +++ b/tests_api/tests_api/models/monitor_type.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 MonitorType(str, Enum): + """ + Type of monitor + """ + + """ + allowed enum values + """ + PUBLIC = 'public' + PRIVATE = 'private' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of MonitorType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/monitors_request.py b/tests_api/tests_api/models/monitors_request.py new file mode 100644 index 00000000..9bea2270 --- /dev/null +++ b/tests_api/tests_api/models/monitors_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 MonitorsRequest(BaseModel): + """ + MonitorsRequest + """ # noqa: E501 + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + __properties: ClassVar[List[str]] = ["monitors"] + + 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 MonitorsRequest 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 MonitorsRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "monitors": obj.get("monitors") + }) + return _obj + + diff --git a/tests_api/tests_api/models/page_load_instant_test.py b/tests_api/tests_api/models/page_load_instant_test.py new file mode 100644 index 00000000..98ce3d42 --- /dev/null +++ b/tests_api/tests_api/models/page_load_instant_test.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PageLoadInstantTest(BaseModel): + """ + PageLoadInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + page_load_target_time: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`.", alias="pageLoadTargetTime") + page_load_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=10, description="Page load time limit. Must be larger than the `httpTimeLimit`.", alias="pageLoadTimeLimit") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pageLoadTargetTime", "pageLoadTimeLimit", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate"] + + 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 PageLoadInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PageLoadInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pageLoadTargetTime": obj.get("pageLoadTargetTime"), + "pageLoadTimeLimit": obj.get("pageLoadTimeLimit") if obj.get("pageLoadTimeLimit") is not None else 10, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "fixedPacketRate": obj.get("fixedPacketRate") + }) + return _obj + + diff --git a/tests_api/tests_api/models/page_load_test.py b/tests_api/tests_api/models/page_load_test.py new file mode 100644 index 00000000..41c931b2 --- /dev/null +++ b/tests_api/tests_api/models/page_load_test.py @@ -0,0 +1,280 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.monitor import Monitor +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_http_interval import TestHttpInterval +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.test_sub_interval import TestSubInterval +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PageLoadTest(BaseModel): + """ + PageLoadTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + page_load_target_time: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`.", alias="pageLoadTargetTime") + page_load_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=10, description="Page load time limit. Must be larger than the `httpTimeLimit`.", alias="pageLoadTimeLimit") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + http_interval: TestHttpInterval = Field(alias="httpInterval") + subinterval: Optional[TestSubInterval] = None + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pageLoadTargetTime", "pageLoadTimeLimit", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate", "bgpMeasurements", "monitors", "httpInterval", "subinterval"] + + 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 PageLoadTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "ssl_version", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PageLoadTest 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pageLoadTargetTime": obj.get("pageLoadTargetTime"), + "pageLoadTimeLimit": obj.get("pageLoadTimeLimit") if obj.get("pageLoadTimeLimit") is not None else 10, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None, + "httpInterval": obj.get("httpInterval"), + "subinterval": obj.get("subinterval") + }) + return _obj + + diff --git a/tests_api/tests_api/models/page_load_tests.py b/tests_api/tests_api/models/page_load_tests.py new file mode 100644 index 00000000..7e703933 --- /dev/null +++ b/tests_api/tests_api/models/page_load_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.page_load_test import PageLoadTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PageLoadTests(BaseModel): + """ + PageLoadTests + """ # noqa: E501 + tests: Optional[List[PageLoadTest]] = None + __properties: ClassVar[List[str]] = ["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 PageLoadTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PageLoadTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [PageLoadTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/self_links.py b/tests_api/tests_api/models/self_links.py new file mode 100644 index 00000000..bfd9d1db --- /dev/null +++ b/tests_api/tests_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_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 + + diff --git a/tests_api/tests_api/models/self_links_links.py b/tests_api/tests_api/models/self_links_links.py new file mode 100644 index 00000000..347857d9 --- /dev/null +++ b/tests_api/tests_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_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 + + diff --git a/tests_api/tests_api/models/simple_test.py b/tests_api/tests_api/models/simple_test.py new file mode 100644 index 00000000..c132c1ac --- /dev/null +++ b/tests_api/tests_api/models/simple_test.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.test_interval import TestInterval +from tests_api.models.test_type import TestType +from tests_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 + + diff --git a/tests_api/tests_api/models/sip_server_instant_test.py b/tests_api/tests_api/models/sip_server_instant_test.py new file mode 100644 index 00000000..96b8834d --- /dev/null +++ b/tests_api/tests_api/models/sip_server_instant_test.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.sip_test_protocol import SipTestProtocol +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_sip_credentials import TestSipCredentials +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SipServerInstantTest(BaseModel): + """ + SipServerInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_user: Optional[StrictStr] = Field(default=None, description="Username for authentication with SIP server.", alias="authUser") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + options_regex: Optional[StrictStr] = Field(default=None, description="Options regex, this field does not require escaping.", alias="optionsRegex") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Annotated[int, Field(le=65535, strict=True, ge=1)] = Field(description="Target port.") + protocol: Optional[SipTestProtocol] = None + register_enabled: Optional[StrictBool] = Field(default=False, description="Set to true to perform SIP registration on the test target with the SIP REGISTER command.", alias="registerEnabled") + sip_registrar: Optional[StrictStr] = Field(default=None, description="SIP server to be tested, specified by domain name or IP address.", alias="sipRegistrar") + sip_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for test completion in milliseconds.", alias="sipTargetTime") + sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit") + target_sip_credentials: TestSipCredentials = Field(alias="targetSipCredentials") + user: Optional[StrictStr] = Field(default=None, description="Username for SIP registration, should be unique within a ThousandEyes account group.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authUser", "mtuMeasurements", "networkMeasurements", "optionsRegex", "password", "pathTraceMode", "port", "protocol", "registerEnabled", "sipRegistrar", "sipTargetTime", "sipTimeLimit", "targetSipCredentials", "user", "fixedPacketRate", "ipv6Policy"] + + 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 SipServerInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 target_sip_credentials + if self.target_sip_credentials: + _dict['targetSipCredentials'] = self.target_sip_credentials.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SipServerInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authUser": obj.get("authUser"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "optionsRegex": obj.get("optionsRegex"), + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "registerEnabled": obj.get("registerEnabled") if obj.get("registerEnabled") is not None else False, + "sipRegistrar": obj.get("sipRegistrar"), + "sipTargetTime": obj.get("sipTargetTime"), + "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5, + "targetSipCredentials": TestSipCredentials.from_dict(obj.get("targetSipCredentials")) if obj.get("targetSipCredentials") is not None else None, + "user": obj.get("user"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy") + }) + return _obj + + diff --git a/tests_api/tests_api/models/sip_server_test.py b/tests_api/tests_api/models/sip_server_test.py new file mode 100644 index 00000000..4aeb7864 --- /dev/null +++ b/tests_api/tests_api/models/sip_server_test.py @@ -0,0 +1,223 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.sip_test_protocol import SipTestProtocol +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_sip_credentials import TestSipCredentials +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SipServerTest(BaseModel): + """ + SipServerTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_user: Optional[StrictStr] = Field(default=None, description="Username for authentication with SIP server.", alias="authUser") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + options_regex: Optional[StrictStr] = Field(default=None, description="Options regex, this field does not require escaping.", alias="optionsRegex") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Annotated[int, Field(le=65535, strict=True, ge=1)] = Field(description="Target port.") + protocol: Optional[SipTestProtocol] = None + register_enabled: Optional[StrictBool] = Field(default=False, description="Set to true to perform SIP registration on the test target with the SIP REGISTER command.", alias="registerEnabled") + sip_registrar: Optional[StrictStr] = Field(default=None, description="SIP server to be tested, specified by domain name or IP address.", alias="sipRegistrar") + sip_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for test completion in milliseconds.", alias="sipTargetTime") + sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit") + target_sip_credentials: TestSipCredentials = Field(alias="targetSipCredentials") + user: Optional[StrictStr] = Field(default=None, description="Username for SIP registration, should be unique within a ThousandEyes account group.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authUser", "mtuMeasurements", "networkMeasurements", "optionsRegex", "password", "pathTraceMode", "port", "protocol", "registerEnabled", "sipRegistrar", "sipTargetTime", "sipTimeLimit", "targetSipCredentials", "user", "fixedPacketRate", "ipv6Policy", "bgpMeasurements"] + + 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 SipServerTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 target_sip_credentials + if self.target_sip_credentials: + _dict['targetSipCredentials'] = self.target_sip_credentials.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SipServerTest 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authUser": obj.get("authUser"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "optionsRegex": obj.get("optionsRegex"), + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "registerEnabled": obj.get("registerEnabled") if obj.get("registerEnabled") is not None else False, + "sipRegistrar": obj.get("sipRegistrar"), + "sipTargetTime": obj.get("sipTargetTime"), + "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5, + "targetSipCredentials": TestSipCredentials.from_dict(obj.get("targetSipCredentials")) if obj.get("targetSipCredentials") is not None else None, + "user": obj.get("user"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True + }) + return _obj + + diff --git a/tests_api/tests_api/models/sip_server_tests.py b/tests_api/tests_api/models/sip_server_tests.py new file mode 100644 index 00000000..3d49b99c --- /dev/null +++ b/tests_api/tests_api/models/sip_server_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.sip_server_test import SipServerTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SipServerTests(BaseModel): + """ + SipServerTests + """ # noqa: E501 + tests: Optional[List[SipServerTest]] = None + __properties: ClassVar[List[str]] = ["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 SipServerTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SipServerTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [SipServerTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/sip_test_protocol.py b/tests_api/tests_api/models/sip_test_protocol.py new file mode 100644 index 00000000..6ceb924f --- /dev/null +++ b/tests_api/tests_api/models/sip_test_protocol.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 SipTestProtocol(str, Enum): + """ + Transport layer for SIP communication. + """ + + """ + allowed enum values + """ + TCP = 'tcp' + TLS = 'tls' + UDP = 'udp' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SipTestProtocol from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/test_auth_type.py b/tests_api/tests_api/models/test_auth_type.py new file mode 100644 index 00000000..5de9f4ef --- /dev/null +++ b/tests_api/tests_api/models/test_auth_type.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestAuthType(str, Enum): + """ + HTTP authentication type. + """ + + """ + allowed enum values + """ + NONE = 'none' + BASIC = 'basic' + NTLM = 'ntlm' + KERBEROS = 'kerberos' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestAuthType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/test_custom_headers.py b/tests_api/tests_api/models/test_custom_headers.py new file mode 100644 index 00000000..adfdaf9f --- /dev/null +++ b/tests_api/tests_api/models/test_custom_headers.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.map_item import MapItem +from tests_api.models.test_custom_headers_all import TestCustomHeadersAll +from tests_api.models.test_custom_headers_root import TestCustomHeadersRoot +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestCustomHeaders(BaseModel): + """ + TestCustomHeaders + """ # noqa: E501 + root: Optional[TestCustomHeadersRoot] = None + domains: Optional[Dict[str, MapItem]] = Field(default=None, description="Use these HTTP headers for the specified domains.") + all: Optional[TestCustomHeadersAll] = None + __properties: ClassVar[List[str]] = ["root", "domains", "all"] + + 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 TestCustomHeaders 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 root + if self.root: + _dict['root'] = self.root.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in domains (dict) + _field_dict = {} + if self.domains: + for _key in self.domains: + if self.domains[_key]: + _field_dict[_key] = self.domains[_key].to_dict() + _dict['domains'] = _field_dict + # override the default output from pydantic by calling `to_dict()` of all + if self.all: + _dict['all'] = self.all.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of TestCustomHeaders from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "root": TestCustomHeadersRoot.from_dict(obj.get("root")) if obj.get("root") is not None else None, + "domains": dict( + (_k, MapItem.from_dict(_v)) + for _k, _v in obj.get("domains").items() + ) + if obj.get("domains") is not None + else None, + "all": TestCustomHeadersAll.from_dict(obj.get("all")) if obj.get("all") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/test_custom_headers_all.py b/tests_api/tests_api/models/test_custom_headers_all.py new file mode 100644 index 00000000..77c61884 --- /dev/null +++ b/tests_api/tests_api/models/test_custom_headers_all.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestCustomHeadersAll(BaseModel): + """ + TestCustomHeadersAll + """ # noqa: E501 + key: Optional[StrictStr] = None + value: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["key", "value"] + + 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 TestCustomHeadersAll 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 TestCustomHeadersAll from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "key": obj.get("key"), + "value": obj.get("value") + }) + return _obj + + diff --git a/tests_api/tests_api/models/test_custom_headers_root.py b/tests_api/tests_api/models/test_custom_headers_root.py new file mode 100644 index 00000000..faa91c27 --- /dev/null +++ b/tests_api/tests_api/models/test_custom_headers_root.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestCustomHeadersRoot(BaseModel): + """ + TestCustomHeadersRoot + """ # noqa: E501 + key: Optional[StrictStr] = None + value: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["key", "value"] + + 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 TestCustomHeadersRoot 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 TestCustomHeadersRoot from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "key": obj.get("key"), + "value": obj.get("value") + }) + return _obj + + diff --git a/tests_api/tests_api/models/test_direction.py b/tests_api/tests_api/models/test_direction.py new file mode 100644 index 00000000..9d30dc35 --- /dev/null +++ b/tests_api/tests_api/models/test_direction.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestDirection(str, Enum): + """ + Direction of the test, which affects how results are shown. + """ + + """ + allowed enum values + """ + TO_MINUS_TARGET = 'to-target' + FROM_MINUS_TARGET = 'from-target' + BIDIRECTIONAL = 'bidirectional' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestDirection from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/test_dns_server.py b/tests_api/tests_api/models/test_dns_server.py new file mode 100644 index 00000000..dc9d3b46 --- /dev/null +++ b/tests_api/tests_api/models/test_dns_server.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestDnsServer(BaseModel): + """ + TestDnsServer + """ # noqa: E501 + server_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the DNS server.", alias="serverId") + server_name: Optional[StrictStr] = Field(default=None, description="Fully qualified domain name (FQDN) of DNS server.", alias="serverName") + __properties: ClassVar[List[str]] = ["serverId", "serverName"] + + 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 TestDnsServer 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 TestDnsServer from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "serverId": obj.get("serverId"), + "serverName": obj.get("serverName") + }) + return _obj + + diff --git a/tests_api/tests_api/models/test_dns_transport_protocol.py b/tests_api/tests_api/models/test_dns_transport_protocol.py new file mode 100644 index 00000000..9d513114 --- /dev/null +++ b/tests_api/tests_api/models/test_dns_transport_protocol.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestDnsTransportProtocol(str, Enum): + """ + Transport protocol used for DNS requests. + """ + + """ + allowed enum values + """ + UDP = 'udp' + TCP = 'tcp' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestDnsTransportProtocol from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/test_dscp_id.py b/tests_api/tests_api/models/test_dscp_id.py new file mode 100644 index 00000000..9a39e369 --- /dev/null +++ b/tests_api/tests_api/models/test_dscp_id.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestDscpId(str, Enum): + """ + DSCP ID [to see list for acceptable values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests) + """ + + """ + allowed enum values + """ + ENUM_0 = '0' + ENUM_8 = '8' + ENUM_16 = '16' + ENUM_24 = '24' + ENUM_32 = '32' + ENUM_40 = '40' + ENUM_48 = '48' + ENUM_56 = '56' + ENUM_10 = '10' + ENUM_12 = '12' + ENUM_14 = '14' + ENUM_18 = '18' + ENUM_20 = '20' + ENUM_22 = '22' + ENUM_26 = '26' + ENUM_28 = '28' + ENUM_30 = '30' + ENUM_34 = '34' + ENUM_36 = '36' + ENUM_38 = '38' + ENUM_46 = '46' + ENUM_44 = '44' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestDscpId from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/test_http_interval.py b/tests_api/tests_api/models/test_http_interval.py new file mode 100644 index 00000000..07c9ae8a --- /dev/null +++ b/tests_api/tests_api/models/test_http_interval.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestHttpInterval(int, Enum): + """ + HTTP test run interval. The interval between HTTP test runs in seconds cannot exceed the specified interval value and defaults to the same value as the interval if not set. + """ + + """ + 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 TestHttpInterval from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/test_interval.py b/tests_api/tests_api/models/test_interval.py new file mode 100644 index 00000000..47e1d5d0 --- /dev/null +++ b/tests_api/tests_api/models/test_interval.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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)) + + diff --git a/tests_api/tests_api/models/test_ipv6_policy.py b/tests_api/tests_api/models/test_ipv6_policy.py new file mode 100644 index 00000000..cb29853b --- /dev/null +++ b/tests_api/tests_api/models/test_ipv6_policy.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestIpv6Policy(str, Enum): + """ + IP version policy. Overrides the IPv6 policy configured at the agent level. + """ + + """ + allowed enum values + """ + FORCE_MINUS_IPV4 = 'force-ipv4' + PREFER_MINUS_IPV6 = 'prefer-ipv6' + FORCE_MINUS_IPV6 = 'force-ipv6' + USE_MINUS_AGENT_MINUS_POLICY = 'use-agent-policy' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestIpv6Policy from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/test_labels_inner.py b/tests_api/tests_api/models/test_labels_inner.py new file mode 100644 index 00000000..37aad988 --- /dev/null +++ b/tests_api/tests_api/models/test_labels_inner.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestLabelsInner(BaseModel): + """ + TestLabelsInner + """ # 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.") + is_built_in: Optional[StrictBool] = Field(default=None, description="Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", alias="isBuiltIn") + __properties: ClassVar[List[str]] = ["labelId", "name", "isBuiltIn"] + + 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 TestLabelsInner 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 TestLabelsInner 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"), + "isBuiltIn": obj.get("isBuiltIn") + }) + return _obj + + diff --git a/tests_api/tests_api/models/test_page_loading_strategy.py b/tests_api/tests_api/models/test_page_loading_strategy.py new file mode 100644 index 00000000..9e621b23 --- /dev/null +++ b/tests_api/tests_api/models/test_page_loading_strategy.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestPageLoadingStrategy(str, Enum): + """ + * `normal`: The test waits until the entire page is fully loaded, including the downloading and parsing of HTML content as well as all associated resources, before advancing to the next action in the transaction test script. * `eager`: The test waits for the DOMContentLoaded event, indicating that HTML content is downloaded and parsed, and the document reaches the \"interactive\" readiness state, before proceeding to the next action in the test script. * `none`: The test only waits for the download of HTML content. Once the HTML is downloaded, the test continues to the next action in the transaction test script without waiting for additional resources. + """ + + """ + allowed enum values + """ + NORMAL = 'normal' + EAGER = 'eager' + NONE = 'none' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestPageLoadingStrategy from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/test_path_trace_mode.py b/tests_api/tests_api/models/test_path_trace_mode.py new file mode 100644 index 00000000..280f8822 --- /dev/null +++ b/tests_api/tests_api/models/test_path_trace_mode.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestPathTraceMode(str, Enum): + """ + Select `inSession` to perform the path trace within a TCP session. + """ + + """ + allowed enum values + """ + CLASSIC = 'classic' + IN_MINUS_SESSION = 'in-session' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestPathTraceMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/test_probe_mode.py b/tests_api/tests_api/models/test_probe_mode.py new file mode 100644 index 00000000..4ef153a5 --- /dev/null +++ b/tests_api/tests_api/models/test_probe_mode.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestProbeMode(str, Enum): + """ + Probe mode used by network test, only valid when the protocol is set to TCP. + """ + + """ + allowed enum values + """ + AUTO = 'auto' + SACK = 'sack' + SYN = 'syn' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestProbeMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/test_protocol.py b/tests_api/tests_api/models/test_protocol.py new file mode 100644 index 00000000..77ba5d7c --- /dev/null +++ b/tests_api/tests_api/models/test_protocol.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestProtocol(str, Enum): + """ + Protocol used by dependent network tests (end-to-end, path trace, PMTUD). + """ + + """ + allowed enum values + """ + TCP = 'tcp' + ICMP = 'icmp' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestProtocol from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/test_request.py b/tests_api/tests_api/models/test_request.py new file mode 100644 index 00000000..f7bfc56d --- /dev/null +++ b/tests_api/tests_api/models/test_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestRequest(BaseModel): + """ + TestRequest + """ # noqa: E501 + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + agents: Optional[List[TestRequestAllOfAgents]] = Field(default=None, description="Contains list of object with required `agentId` and optional `sourceIpAddress`") + __properties: ClassVar[List[str]] = ["labels", "sharedWithAccounts", "alertRules", "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 TestRequest 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 TestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "alertRules": obj.get("alertRules"), + "agents": [TestRequestAllOfAgents.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/test_request_all_of_agents.py b/tests_api/tests_api/models/test_request_all_of_agents.py new file mode 100644 index 00000000..15b7e4ba --- /dev/null +++ b/tests_api/tests_api/models/test_request_all_of_agents.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestRequestAllOfAgents(BaseModel): + """ + TestRequestAllOfAgents + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Agent Id (get `agentId` from `/agents` endpoint)", alias="agentId") + source_ip_address: Optional[StrictStr] = Field(default=None, description="IP address from `ipAddresses` of Agent Details for interface selection (get `ipAddresses` from `/agents` endpoint)", alias="sourceIpAddress") + __properties: ClassVar[List[str]] = ["agentId", "sourceIpAddress"] + + 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 TestRequestAllOfAgents 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 TestRequestAllOfAgents from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "sourceIpAddress": obj.get("sourceIpAddress") + }) + return _obj + + diff --git a/tests_api/tests_api/models/test_shared_accounts_inner.py b/tests_api/tests_api/models/test_shared_accounts_inner.py new file mode 100644 index 00000000..d2faf3e7 --- /dev/null +++ b/tests_api/tests_api/models/test_shared_accounts_inner.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestSharedAccountsInner(BaseModel): + """ + TestSharedAccountsInner + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="Account group ID.") + name: Optional[StrictStr] = Field(default=None, description="Account group name.") + __properties: ClassVar[List[str]] = ["aid", "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 TestSharedAccountsInner 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 TestSharedAccountsInner 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"), + "name": obj.get("name") + }) + return _obj + + diff --git a/tests_api/tests_api/models/test_sip_credentials.py b/tests_api/tests_api/models/test_sip_credentials.py new file mode 100644 index 00000000..1bf64e36 --- /dev/null +++ b/tests_api/tests_api/models/test_sip_credentials.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.sip_test_protocol import SipTestProtocol +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TestSipCredentials(BaseModel): + """ + TestSipCredentials + """ # noqa: E501 + auth_user: Optional[StrictStr] = Field(default=None, description="Username for authentication with SIP server.", alias="authUser") + password: Optional[StrictStr] = Field(default=None, description="Password for authentication with SIP server.") + port: Annotated[int, Field(le=65535, strict=True, ge=1024)] = Field(description="Port number for the chosen protocol.") + protocol: Optional[SipTestProtocol] = None + sip_registrar: Optional[StrictStr] = Field(default=None, description="SIP server to be tested, specified by domain name or IP address.", alias="sipRegistrar") + user: Optional[StrictStr] = Field(default=None, description="Username for SIP registration, should be unique within a ThousandEyes account group.") + __properties: ClassVar[List[str]] = ["authUser", "password", "port", "protocol", "sipRegistrar", "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 TestSipCredentials 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 TestSipCredentials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "authUser": obj.get("authUser"), + "password": obj.get("password"), + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "sipRegistrar": obj.get("sipRegistrar"), + "user": obj.get("user") + }) + return _obj + + diff --git a/tests_api/tests_api/models/test_ssl_version_id.py b/tests_api/tests_api/models/test_ssl_version_id.py new file mode 100644 index 00000000..0d7dfdaf --- /dev/null +++ b/tests_api/tests_api/models/test_ssl_version_id.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestSslVersionId(str, Enum): + """ + SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. + """ + + """ + allowed enum values + """ + ENUM_0 = '0' + ENUM_3 = '3' + ENUM_4 = '4' + ENUM_5 = '5' + ENUM_6 = '6' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestSslVersionId from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/test_sub_interval.py b/tests_api/tests_api/models/test_sub_interval.py new file mode 100644 index 00000000..1adc5923 --- /dev/null +++ b/tests_api/tests_api/models/test_sub_interval.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 TestSubInterval(int, Enum): + """ + Subinterval for round-robin testing (in seconds). Must be less than or equal to interval and must evenly divide interval. + """ + + """ + allowed enum values + """ + NUMBER_60 = 60 + NUMBER_120 = 120 + NUMBER_300 = 300 + NUMBER_600 = 600 + NUMBER_900 = 900 + NUMBER_1200 = 1200 + NUMBER_1800 = 1800 + NUMBER_3600 = 3600 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestSubInterval from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/tests_api/tests_api/models/test_type.py b/tests_api/tests_api/models/test_type.py new file mode 100644 index 00000000..8ad9403e --- /dev/null +++ b/tests_api/tests_api/models/test_type.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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)) + + diff --git a/tests_api/tests_api/models/tests.py b/tests_api/tests_api/models/tests.py new file mode 100644 index 00000000..673fc2ec --- /dev/null +++ b/tests_api/tests_api/models/tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.simple_test import SimpleTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Tests(BaseModel): + """ + Tests + """ # noqa: E501 + tests: Optional[List[SimpleTest]] = None + __properties: ClassVar[List[str]] = ["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 Tests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Tests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [SimpleTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/unauthorized_error.py b/tests_api/tests_api/models/unauthorized_error.py new file mode 100644 index 00000000..de442aca --- /dev/null +++ b/tests_api/tests_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 + + diff --git a/tests_api/tests_api/models/unexpanded_instant_test.py b/tests_api/tests_api/models/unexpanded_instant_test.py new file mode 100644 index 00000000..8bdc7693 --- /dev/null +++ b/tests_api/tests_api/models/unexpanded_instant_test.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.test_type import TestType +from tests_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 + + diff --git a/tests_api/tests_api/models/unexpanded_instant_test_links.py b/tests_api/tests_api/models/unexpanded_instant_test_links.py new file mode 100644 index 00000000..1697abae --- /dev/null +++ b/tests_api/tests_api/models/unexpanded_instant_test_links.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf +from tests_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 + + diff --git a/tests_api/tests_api/models/unexpanded_instant_test_links_self.py b/tests_api/tests_api/models/unexpanded_instant_test_links_self.py new file mode 100644 index 00000000..40fea387 --- /dev/null +++ b/tests_api/tests_api/models/unexpanded_instant_test_links_self.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 + + diff --git a/tests_api/tests_api/models/unexpanded_instant_test_links_test_results.py b/tests_api/tests_api/models/unexpanded_instant_test_links_test_results.py new file mode 100644 index 00000000..9685d106 --- /dev/null +++ b/tests_api/tests_api/models/unexpanded_instant_test_links_test_results.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_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()) + + diff --git a/tests_api/tests_api/models/unexpanded_test.py b/tests_api/tests_api/models/unexpanded_test.py new file mode 100644 index 00000000..aa9a52c5 --- /dev/null +++ b/tests_api/tests_api/models/unexpanded_test.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_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 + + diff --git a/tests_api/tests_api/models/update_agent_to_agent_test.py b/tests_api/tests_api/models/update_agent_to_agent_test.py new file mode 100644 index 00000000..561425c9 --- /dev/null +++ b/tests_api/tests_api/models/update_agent_to_agent_test.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from tests_api.models.test_direction import TestDirection +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdateAgentToAgentTest(BaseModel): + """ + UpdateAgentToAgentTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + agents: List[TestRequestAllOfAgents] = Field(description="Contains list of object with required `agentId` and optional `sourceIpAddress`") + direction: Optional[TestDirection] = None + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + mss: Optional[Annotated[int, Field(le=1400, strict=True, ge=20)]] = Field(default=None, description="Maximum segment size, in bytes.") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + protocol: Optional[AgentToAgentTestProtocol] = None + target_agent_id: StrictStr = Field(description="`agentId` of the target agent for the test.", alias="targetAgentId") + throughput_measurements: Optional[StrictBool] = Field(default=False, description="Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent.", alias="throughputMeasurements") + throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration") + throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate", "bgpMeasurements", "monitors"] + + 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 UpdateAgentToAgentTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 UpdateAgentToAgentTest 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, + "alertRules": obj.get("alertRules"), + "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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [TestRequestAllOfAgents.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "direction": obj.get("direction"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "mss": obj.get("mss"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "targetAgentId": obj.get("targetAgentId"), + "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False, + "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000, + "throughputRate": obj.get("throughputRate"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": obj.get("monitors") + }) + return _obj + + diff --git a/tests_api/tests_api/models/update_agent_to_server_test.py b/tests_api/tests_api/models/update_agent_to_server_test.py new file mode 100644 index 00000000..a1cccf99 --- /dev/null +++ b/tests_api/tests_api/models/update_agent_to_server_test.py @@ -0,0 +1,193 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdateAgentToServerTest(BaseModel): + """ + UpdateAgentToServerTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + agents: List[TestRequestAllOfAgents] = Field(description="Contains list of object with required `agentId` and optional `sourceIpAddress`") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + continuous_mode: Optional[StrictBool] = Field(default=None, description="To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. ", alias="continuousMode") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1`", alias="fixedPacketRate") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + server: StrictStr = Field(description="Target name or IP address.") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize") + network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "bgpMeasurements", "monitors"] + + 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 UpdateAgentToServerTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 UpdateAgentToServerTest 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, + "alertRules": obj.get("alertRules"), + "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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [TestRequestAllOfAgents.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "continuousMode": obj.get("continuousMode"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "ipv6Policy": obj.get("ipv6Policy"), + "pingPayloadSize": obj.get("pingPayloadSize"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False, + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": obj.get("monitors") + }) + return _obj + + diff --git a/tests_api/tests_api/models/update_bgp_test.py b/tests_api/tests_api/models/update_bgp_test.py new file mode 100644 index 00000000..25b3d15e --- /dev/null +++ b/tests_api/tests_api/models/update_bgp_test.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdateBgpTest(BaseModel): + """ + UpdateBgpTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + include_covered_prefixes: Optional[StrictBool] = Field(default=None, description="Indicate if queries for subprefixes detected under this prefix should included.", alias="includeCoveredPrefixes") + prefix: StrictStr = Field(description="a.b.c.d is a network address, with the prefix length defined as e. Prefixes can be any length from 8 to 24.") + use_public_bgp: Optional[StrictBool] = Field(default=None, description="Indicate if all available public BGP monitors should be used.", alias="usePublicBGP") + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "monitors", "includeCoveredPrefixes", "prefix", "usePublicBGP", "alertsEnabled", "alertRules"] + + 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 UpdateBgpTest 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={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + }, + 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 UpdateBgpTest 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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "monitors": obj.get("monitors"), + "includeCoveredPrefixes": obj.get("includeCoveredPrefixes"), + "prefix": obj.get("prefix"), + "usePublicBGP": obj.get("usePublicBGP"), + "alertsEnabled": obj.get("alertsEnabled"), + "alertRules": obj.get("alertRules") + }) + return _obj + + diff --git a/tests_api/tests_api/models/update_dns_sec_test.py b/tests_api/tests_api/models/update_dns_sec_test.py new file mode 100644 index 00000000..96c0bb17 --- /dev/null +++ b/tests_api/tests_api/models/update_dns_sec_test.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdateDnsSecTest(BaseModel): + """ + UpdateDnsSecTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + agents: List[TestRequestAllOfAgents] = Field(description="Contains list of object with required `agentId` and optional `sourceIpAddress`") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "domain", "dnsQueryClass"] + + 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 UpdateDnsSecTest 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={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 UpdateDnsSecTest 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, + "alertRules": obj.get("alertRules"), + "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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [TestRequestAllOfAgents.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/tests_api/tests_api/models/update_dns_server_test.py b/tests_api/tests_api/models/update_dns_server_test.py new file mode 100644 index 00000000..7c232917 --- /dev/null +++ b/tests_api/tests_api/models/update_dns_server_test.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.test_dns_server import TestDnsServer +from tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdateDnsServerTest(BaseModel): + """ + UpdateDnsServerTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + agents: List[TestRequestAllOfAgents] = Field(description="Contains list of object with required `agentId` and optional `sourceIpAddress`") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + dns_servers: List[TestDnsServer] = Field(alias="dnsServers") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + recursive_queries: Optional[StrictBool] = Field(default=None, description="Set true to run query with RD (recursion desired) flag enabled.", alias="recursiveQueries") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass", "bgpMeasurements", "monitors"] + + 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 UpdateDnsServerTest 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={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in dns_servers (list) + _items = [] + if self.dns_servers: + for _item in self.dns_servers: + if _item: + _items.append(_item.to_dict()) + _dict['dnsServers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of UpdateDnsServerTest 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, + "alertRules": obj.get("alertRules"), + "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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [TestRequestAllOfAgents.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "dnsServers": [TestDnsServer.from_dict(_item) for _item in obj.get("dnsServers")] if obj.get("dnsServers") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "recursiveQueries": obj.get("recursiveQueries"), + "ipv6Policy": obj.get("ipv6Policy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "dnsQueryClass": obj.get("dnsQueryClass"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": obj.get("monitors") + }) + return _obj + + diff --git a/tests_api/tests_api/models/update_dns_trace_test.py b/tests_api/tests_api/models/update_dns_trace_test.py new file mode 100644 index 00000000..40e3ff40 --- /dev/null +++ b/tests_api/tests_api/models/update_dns_trace_test.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.dns_query_class import DnsQueryClass +from tests_api.models.test_dns_transport_protocol import TestDnsTransportProtocol +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdateDnsTraceTest(BaseModel): + """ + UpdateDnsTraceTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + agents: List[TestRequestAllOfAgents] = Field(description="Contains list of object with required `agentId` and optional `sourceIpAddress`") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "dnsTransportProtocol", "domain", "dnsQueryClass"] + + 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 UpdateDnsTraceTest 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={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 UpdateDnsTraceTest 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, + "alertRules": obj.get("alertRules"), + "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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [TestRequestAllOfAgents.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass") + }) + return _obj + + diff --git a/tests_api/tests_api/models/update_ftp_server_test.py b/tests_api/tests_api/models/update_ftp_server_test.py new file mode 100644 index 00000000..8ab5e75f --- /dev/null +++ b/tests_api/tests_api/models/update_ftp_server_test.py @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.ftp_server_request_type import FtpServerRequestType +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdateFtpServerTest(BaseModel): + """ + UpdateFtpServerTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + agents: List[TestRequestAllOfAgents] = Field(description="Contains list of object with required `agentId` and optional `sourceIpAddress`") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + download_limit: Optional[StrictInt] = Field(default=None, description="Specify maximum number of bytes to download from the target object.", alias="downloadLimit") + ftp_target_time: Optional[Annotated[int, Field(le=6000, strict=True, ge=1000)]] = Field(default=None, description="Target time for operation completion; specified in milliseconds.", alias="ftpTargetTime") + ftp_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=10)]] = Field(default=10, description="Set the time limit for the test in seconds.", alias="ftpTimeLimit") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: StrictStr = Field(description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + request_type: FtpServerRequestType = Field(alias="requestType") + url: StrictStr = Field(description="Target for the test.") + use_active_ftp: Optional[StrictBool] = Field(default=False, description="Explicitly set the flag to use active FTP.", alias="useActiveFtp") + use_explicit_ftps: Optional[StrictBool] = Field(default=None, description="Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS.", alias="useExplicitFtps") + username: StrictStr = Field(description="Username for Basic/NTLM authentication.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy", "bgpMeasurements", "monitors"] + + 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 UpdateFtpServerTest 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={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 UpdateFtpServerTest 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, + "alertRules": obj.get("alertRules"), + "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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [TestRequestAllOfAgents.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "downloadLimit": obj.get("downloadLimit"), + "ftpTargetTime": obj.get("ftpTargetTime"), + "ftpTimeLimit": obj.get("ftpTimeLimit") if obj.get("ftpTimeLimit") is not None else 10, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "requestType": obj.get("requestType"), + "url": obj.get("url"), + "useActiveFtp": obj.get("useActiveFtp") if obj.get("useActiveFtp") is not None else False, + "useExplicitFtps": obj.get("useExplicitFtps"), + "username": obj.get("username"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": obj.get("monitors") + }) + return _obj + + diff --git a/tests_api/tests_api/models/update_http_server_test.py b/tests_api/tests_api/models/update_http_server_test.py new file mode 100644 index 00000000..fe28e452 --- /dev/null +++ b/tests_api/tests_api/models/update_http_server_test.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdateHttpServerTest(BaseModel): + """ + UpdateHttpServerTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + agents: List[TestRequestAllOfAgents] = Field(description="Contains list of object with required `agentId` and optional `sourceIpAddress`") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "headers", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "postBody", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "ipv6Policy", "followRedirects", "fixedPacketRate", "bgpMeasurements", "monitors"] + + 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 UpdateHttpServerTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of UpdateHttpServerTest 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, + "alertRules": obj.get("alertRules"), + "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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [TestRequestAllOfAgents.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "headers": obj.get("headers"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "postBody": obj.get("postBody"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "ipv6Policy": obj.get("ipv6Policy"), + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": obj.get("monitors") + }) + return _obj + + diff --git a/tests_api/tests_api/models/update_page_load_test.py b/tests_api/tests_api/models/update_page_load_test.py new file mode 100644 index 00000000..ae51de43 --- /dev/null +++ b/tests_api/tests_api/models/update_page_load_test.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_http_interval import TestHttpInterval +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.test_sub_interval import TestSubInterval +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdatePageLoadTest(BaseModel): + """ + UpdatePageLoadTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + agents: List[TestRequestAllOfAgents] = Field(description="Contains list of object with required `agentId` and optional `sourceIpAddress`") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + page_load_target_time: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`.", alias="pageLoadTargetTime") + page_load_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=10, description="Page load time limit. Must be larger than the `httpTimeLimit`.", alias="pageLoadTimeLimit") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + http_interval: TestHttpInterval = Field(alias="httpInterval") + subinterval: Optional[TestSubInterval] = None + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pageLoadTargetTime", "pageLoadTimeLimit", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate", "bgpMeasurements", "monitors", "httpInterval", "subinterval"] + + 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 UpdatePageLoadTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of UpdatePageLoadTest 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, + "alertRules": obj.get("alertRules"), + "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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [TestRequestAllOfAgents.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pageLoadTargetTime": obj.get("pageLoadTargetTime"), + "pageLoadTimeLimit": obj.get("pageLoadTimeLimit") if obj.get("pageLoadTimeLimit") is not None else 10, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": obj.get("monitors"), + "httpInterval": obj.get("httpInterval"), + "subinterval": obj.get("subinterval") + }) + return _obj + + diff --git a/tests_api/tests_api/models/update_path_vis_interface_group200_response.py b/tests_api/tests_api/models/update_path_vis_interface_group200_response.py new file mode 100644 index 00000000..fd6495b5 --- /dev/null +++ b/tests_api/tests_api/models/update_path_vis_interface_group200_response.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdatePathVisInterfaceGroup200Response(BaseModel): + """ + UpdatePathVisInterfaceGroup200Response + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="Account Group Id") + group_id: Optional[StrictStr] = Field(default=None, description="Group ID", alias="groupId") + group_name: Optional[StrictStr] = Field(default=None, description="Name of the path visualization interface group", alias="groupName") + ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of IP addresses associated with the interface group", alias="ipAddresses") + rdns_regexes: Optional[List[StrictStr]] = Field(default=None, description="Array of RDNS Regexes associated with the interface group", alias="rdnsRegexes") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["aid", "groupId", "groupName", "ipAddresses", "rdnsRegexes", "_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 UpdatePathVisInterfaceGroup200Response 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={ + "aid", + "group_id", + "rdns_regexes", + }, + 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 UpdatePathVisInterfaceGroup200Response 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"), + "groupId": obj.get("groupId"), + "groupName": obj.get("groupName"), + "ipAddresses": obj.get("ipAddresses"), + "rdnsRegexes": obj.get("rdnsRegexes"), + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/update_sip_server_test.py b/tests_api/tests_api/models/update_sip_server_test.py new file mode 100644 index 00000000..7c5a239e --- /dev/null +++ b/tests_api/tests_api/models/update_sip_server_test.py @@ -0,0 +1,193 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.sip_test_protocol import SipTestProtocol +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_ipv6_policy import TestIpv6Policy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +from tests_api.models.test_sip_credentials import TestSipCredentials +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdateSipServerTest(BaseModel): + """ + UpdateSipServerTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + agents: List[TestRequestAllOfAgents] = Field(description="Contains list of object with required `agentId` and optional `sourceIpAddress`") + auth_user: Optional[StrictStr] = Field(default=None, description="Username for authentication with SIP server.", alias="authUser") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + options_regex: Optional[StrictStr] = Field(default=None, description="Options regex, this field does not require escaping.", alias="optionsRegex") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Annotated[int, Field(le=65535, strict=True, ge=1)] = Field(description="Target port.") + protocol: Optional[SipTestProtocol] = None + register_enabled: Optional[StrictBool] = Field(default=False, description="Set to true to perform SIP registration on the test target with the SIP REGISTER command.", alias="registerEnabled") + sip_registrar: Optional[StrictStr] = Field(default=None, description="SIP server to be tested, specified by domain name or IP address.", alias="sipRegistrar") + sip_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for test completion in milliseconds.", alias="sipTargetTime") + sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit") + target_sip_credentials: TestSipCredentials = Field(alias="targetSipCredentials") + user: Optional[StrictStr] = Field(default=None, description="Username for SIP registration, should be unique within a ThousandEyes account group.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authUser", "mtuMeasurements", "networkMeasurements", "optionsRegex", "password", "pathTraceMode", "port", "protocol", "registerEnabled", "sipRegistrar", "sipTargetTime", "sipTimeLimit", "targetSipCredentials", "user", "fixedPacketRate", "ipv6Policy", "bgpMeasurements"] + + 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 UpdateSipServerTest 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={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 target_sip_credentials + if self.target_sip_credentials: + _dict['targetSipCredentials'] = self.target_sip_credentials.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of UpdateSipServerTest 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, + "alertRules": obj.get("alertRules"), + "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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [TestRequestAllOfAgents.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authUser": obj.get("authUser"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "optionsRegex": obj.get("optionsRegex"), + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "registerEnabled": obj.get("registerEnabled") if obj.get("registerEnabled") is not None else False, + "sipRegistrar": obj.get("sipRegistrar"), + "sipTargetTime": obj.get("sipTargetTime"), + "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5, + "targetSipCredentials": TestSipCredentials.from_dict(obj.get("targetSipCredentials")) if obj.get("targetSipCredentials") is not None else None, + "user": obj.get("user"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True + }) + return _obj + + diff --git a/tests_api/tests_api/models/update_voice_test.py b/tests_api/tests_api/models/update_voice_test.py new file mode 100644 index 00000000..80404fc4 --- /dev/null +++ b/tests_api/tests_api/models/update_voice_test.py @@ -0,0 +1,177 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdateVoiceTest(BaseModel): + """ + UpdateVoiceTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + agents: List[TestRequestAllOfAgents] = Field(description="Contains list of object with required `agentId` and optional `sourceIpAddress`") + codec: Optional[StrictStr] = Field(default=None, description="Codec label") + codec_id: Optional[StrictStr] = Field(default=None, description="Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab)", alias="codecId") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + duration: Optional[Annotated[int, Field(le=30, strict=True, ge=5)]] = Field(default=5, description="Duration of the test in seconds.") + jitter_buffer: Optional[Annotated[int, Field(le=150, strict=True, ge=0)]] = Field(default=40, description="De-jitter buffer size in seconds.", alias="jitterBuffer") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.") + target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId", "bgpMeasurements"] + + 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 UpdateVoiceTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "codec", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 UpdateVoiceTest 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, + "alertRules": obj.get("alertRules"), + "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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [TestRequestAllOfAgents.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "codec": obj.get("codec"), + "codecId": obj.get("codecId"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "duration": obj.get("duration") if obj.get("duration") is not None else 5, + "jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "port": obj.get("port"), + "targetAgentId": obj.get("targetAgentId"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True + }) + return _obj + + diff --git a/tests_api/tests_api/models/update_web_transaction_test.py b/tests_api/tests_api/models/update_web_transaction_test.py new file mode 100644 index 00000000..c96c3ff3 --- /dev/null +++ b/tests_api/tests_api/models/update_web_transaction_test.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_request_all_of_agents import TestRequestAllOfAgents +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.test_sub_interval import TestSubInterval +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UpdateWebTransactionTest(BaseModel): + """ + UpdateWebTransactionTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + agents: List[TestRequestAllOfAgents] = Field(description="Contains list of object with required `agentId` and optional `sourceIpAddress`") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex") + credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=1)]] = Field(default=None, description="Target time for completion, defaults to 50% of time limit specified in seconds.", alias="targetTime") + time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds.", alias="timeLimit") + transaction_script: StrictStr = Field(description="JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ).", alias="transactionScript") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + subinterval: Optional[TestSubInterval] = None + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "credentials", "customHeaders", "desiredStatusCode", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "targetTime", "timeLimit", "transactionScript", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate", "bgpMeasurements", "monitors", "subinterval"] + + 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 UpdateWebTransactionTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of UpdateWebTransactionTest 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, + "alertRules": obj.get("alertRules"), + "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, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "agents": [TestRequestAllOfAgents.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "credentials": obj.get("credentials"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "targetTime": obj.get("targetTime"), + "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, + "transactionScript": obj.get("transactionScript"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": obj.get("monitors"), + "subinterval": obj.get("subinterval") + }) + return _obj + + diff --git a/tests_api/tests_api/models/voice_instant_test.py b/tests_api/tests_api/models/voice_instant_test.py new file mode 100644 index 00000000..02a3d563 --- /dev/null +++ b/tests_api/tests_api/models/voice_instant_test.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class VoiceInstantTest(BaseModel): + """ + VoiceInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + codec: Optional[StrictStr] = Field(default=None, description="Codec label") + codec_id: Optional[StrictStr] = Field(default=None, description="Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab)", alias="codecId") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + duration: Optional[Annotated[int, Field(le=30, strict=True, ge=5)]] = Field(default=5, description="Duration of the test in seconds.") + jitter_buffer: Optional[Annotated[int, Field(le=150, strict=True, ge=0)]] = Field(default=40, description="De-jitter buffer size in seconds.", alias="jitterBuffer") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.") + target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId"] + + 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 VoiceInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "codec", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 VoiceInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "codec": obj.get("codec"), + "codecId": obj.get("codecId"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "duration": obj.get("duration") if obj.get("duration") is not None else 5, + "jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "port": obj.get("port"), + "targetAgentId": obj.get("targetAgentId") + }) + return _obj + + diff --git a/tests_api/tests_api/models/voice_test.py b/tests_api/tests_api/models/voice_test.py new file mode 100644 index 00000000..464f3339 --- /dev/null +++ b/tests_api/tests_api/models/voice_test.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.test_dscp_id import TestDscpId +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class VoiceTest(BaseModel): + """ + VoiceTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + codec: Optional[StrictStr] = Field(default=None, description="Codec label") + codec_id: Optional[StrictStr] = Field(default=None, description="Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab)", alias="codecId") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + duration: Optional[Annotated[int, Field(le=30, strict=True, ge=5)]] = Field(default=5, description="Duration of the test in seconds.") + jitter_buffer: Optional[Annotated[int, Field(le=150, strict=True, ge=0)]] = Field(default=40, description="De-jitter buffer size in seconds.", alias="jitterBuffer") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.") + target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId", "bgpMeasurements"] + + 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 VoiceTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "codec", + "dscp", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 VoiceTest 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "codec": obj.get("codec"), + "codecId": obj.get("codecId"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "duration": obj.get("duration") if obj.get("duration") is not None else 5, + "jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "port": obj.get("port"), + "targetAgentId": obj.get("targetAgentId"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True + }) + return _obj + + diff --git a/tests_api/tests_api/models/voice_tests.py b/tests_api/tests_api/models/voice_tests.py new file mode 100644 index 00000000..308fdac3 --- /dev/null +++ b/tests_api/tests_api/models/voice_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.voice_test import VoiceTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class VoiceTests(BaseModel): + """ + VoiceTests + """ # noqa: E501 + tests: Optional[List[VoiceTest]] = None + __properties: ClassVar[List[str]] = ["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 VoiceTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of VoiceTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [VoiceTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/models/web_transaction_instant_test.py b/tests_api/tests_api/models/web_transaction_instant_test.py new file mode 100644 index 00000000..aad1e8d1 --- /dev/null +++ b/tests_api/tests_api/models/web_transaction_instant_test.py @@ -0,0 +1,249 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class WebTransactionInstantTest(BaseModel): + """ + WebTransactionInstantTest + """ # 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex") + credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=1)]] = Field(default=None, description="Target time for completion, defaults to 50% of time limit specified in seconds.", alias="targetTime") + time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds.", alias="timeLimit") + transaction_script: StrictStr = Field(description="JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ).", alias="transactionScript") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "credentials", "customHeaders", "desiredStatusCode", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "targetTime", "timeLimit", "transactionScript", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate"] + + 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 WebTransactionInstantTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "ssl_version", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of WebTransactionInstantTest 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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "credentials": obj.get("credentials"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "targetTime": obj.get("targetTime"), + "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, + "transactionScript": obj.get("transactionScript"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "fixedPacketRate": obj.get("fixedPacketRate") + }) + return _obj + + diff --git a/tests_api/tests_api/models/web_transaction_test.py b/tests_api/tests_api/models/web_transaction_test.py new file mode 100644 index 00000000..e84de61d --- /dev/null +++ b/tests_api/tests_api/models/web_transaction_test.py @@ -0,0 +1,283 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 typing_extensions import Annotated +from tests_api.models.agent import Agent +from tests_api.models.alert_rule import AlertRule +from tests_api.models.monitor import Monitor +from tests_api.models.test_auth_type import TestAuthType +from tests_api.models.test_custom_headers import TestCustomHeaders +from tests_api.models.test_interval import TestInterval +from tests_api.models.test_labels_inner import TestLabelsInner +from tests_api.models.test_page_loading_strategy import TestPageLoadingStrategy +from tests_api.models.test_path_trace_mode import TestPathTraceMode +from tests_api.models.test_probe_mode import TestProbeMode +from tests_api.models.test_protocol import TestProtocol +from tests_api.models.test_shared_accounts_inner import TestSharedAccountsInner +from tests_api.models.test_ssl_version_id import TestSslVersionId +from tests_api.models.test_sub_interval import TestSubInterval +from tests_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class WebTransactionTest(BaseModel): + """ + WebTransactionTest + """ # noqa: E501 + interval: TestInterval + 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.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + 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[StrictStr] = None + links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabelsInner]] = None + shared_with_accounts: Optional[List[TestSharedAccountsInner]] = Field(default=None, alias="sharedWithAccounts") + agents: List[Agent] = Field(description="Contains list of agents.") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex") + credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to false.", alias="followRedirects") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=3)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=1)]] = Field(default=None, description="Target time for completion, defaults to 50% of time limit specified in seconds.", alias="targetTime") + time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds.", alias="timeLimit") + transaction_script: StrictStr = Field(description="JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ).", alias="transactionScript") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + subinterval: Optional[TestSubInterval] = None + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "agents", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "credentials", "customHeaders", "desiredStatusCode", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "targetTime", "timeLimit", "transactionScript", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate", "bgpMeasurements", "monitors", "subinterval"] + + 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 WebTransactionTest 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "agents", + "ssl_version", + "monitors", + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of 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 each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # 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 custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of WebTransactionTest 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, + "alertRules": [AlertRule.from_dict(_item) for _item in obj.get("alertRules")] if obj.get("alertRules") is not None else None, + "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, + "labels": [TestLabelsInner.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "sharedWithAccounts": [TestSharedAccountsInner.from_dict(_item) for _item in obj.get("sharedWithAccounts")] if obj.get("sharedWithAccounts") is not None else None, + "agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "authType": obj.get("authType"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "credentials": obj.get("credentials"), + "customHeaders": TestCustomHeaders.from_dict(obj.get("customHeaders")) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "targetTime": obj.get("targetTime"), + "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, + "transactionScript": obj.get("transactionScript"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj.get("monitors")] if obj.get("monitors") is not None else None, + "subinterval": obj.get("subinterval") + }) + return _obj + + diff --git a/tests_api/tests_api/models/web_transaction_tests.py b/tests_api/tests_api/models/web_transaction_tests.py new file mode 100644 index 00000000..6d241775 --- /dev/null +++ b/tests_api/tests_api/models/web_transaction_tests.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_api.models.web_transaction_test import WebTransactionTest +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class WebTransactionTests(BaseModel): + """ + WebTransactionTests + """ # noqa: E501 + tests: Optional[List[WebTransactionTest]] = None + __properties: ClassVar[List[str]] = ["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 WebTransactionTests 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 tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of WebTransactionTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tests": [WebTransactionTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/tests_api/tests_api/py.typed b/tests_api/tests_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/tests_api/tests_api/rest.py b/tests_api/tests_api/rest.py new file mode 100644 index 00000000..ed5a02c9 --- /dev/null +++ b/tests_api/tests_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Tests API + + ### Overview This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + 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 tests_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) diff --git a/tests_api/tox.ini b/tests_api/tox.ini new file mode 100644 index 00000000..543af93d --- /dev/null +++ b/tests_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=tests_api diff --git a/usage_api/.github/workflows/python.yml b/usage_api/.github/workflows/python.yml new file mode 100644 index 00000000..d182533a --- /dev/null +++ b/usage_api/.github/workflows/python.yml @@ -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: usage_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 diff --git a/usage_api/.gitignore b/usage_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/usage_api/.gitignore @@ -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 diff --git a/usage_api/.gitlab-ci.yml b/usage_api/.gitlab-ci.yml new file mode 100644 index 00000000..9365e585 --- /dev/null +++ b/usage_api/.gitlab-ci.yml @@ -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=usage_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 diff --git a/usage_api/.openapi-generator-ignore b/usage_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/usage_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/usage_api/.openapi-generator/FILES b/usage_api/.openapi-generator/FILES new file mode 100644 index 00000000..24ffa16d --- /dev/null +++ b/usage_api/.openapi-generator/FILES @@ -0,0 +1,119 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/AccountGroup.md +docs/AccountGroupId.md +docs/AccountGroupQuota.md +docs/EndpointAgentsEmbeddedInner.md +docs/EndpointAgentsEssentialsInner.md +docs/EndpointAgentsInner.md +docs/EnterpriseAgentUnitsInner.md +docs/EnterpriseAgentsInner.md +docs/Error.md +docs/Expand.md +docs/GetQuotas200Response.md +docs/GetUsage200Response.md +docs/Link.md +docs/OrganizationQuota.md +docs/OrganizationsQuotasAssign.md +docs/OrganizationsQuotasAssignOrganizationsInner.md +docs/OrganizationsQuotasUnassign.md +docs/OrganizationsQuotasUnassignOrganizationsInner.md +docs/Quotas.md +docs/QuotasApi.md +docs/QuotasAssignRequest.md +docs/QuotasAssignResponse.md +docs/QuotasQuotasInner.md +docs/QuotasUnassign.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/TestsInner.md +docs/UnauthorizedError.md +docs/Usage.md +docs/UsageApi.md +docs/UsageUsage.md +docs/UsageUsageQuota.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_account_group_quota.py +test/test_endpoint_agents_embedded_inner.py +test/test_endpoint_agents_essentials_inner.py +test/test_endpoint_agents_inner.py +test/test_enterprise_agent_units_inner.py +test/test_enterprise_agents_inner.py +test/test_error.py +test/test_expand.py +test/test_get_quotas200_response.py +test/test_get_usage200_response.py +test/test_link.py +test/test_organization_quota.py +test/test_organizations_quotas_assign.py +test/test_organizations_quotas_assign_organizations_inner.py +test/test_organizations_quotas_unassign.py +test/test_organizations_quotas_unassign_organizations_inner.py +test/test_quotas.py +test/test_quotas_api.py +test/test_quotas_assign_request.py +test/test_quotas_assign_response.py +test/test_quotas_quotas_inner.py +test/test_quotas_unassign.py +test/test_self_links.py +test/test_self_links_links.py +test/test_tests_inner.py +test/test_unauthorized_error.py +test/test_usage.py +test/test_usage_api.py +test/test_usage_usage.py +test/test_usage_usage_quota.py +tox.ini +usage_api/__init__.py +usage_api/api/__init__.py +usage_api/api/quotas_api.py +usage_api/api/usage_api.py +usage_api/api_client.py +usage_api/api_response.py +usage_api/configuration.py +usage_api/exceptions.py +usage_api/models/__init__.py +usage_api/models/account_group.py +usage_api/models/account_group_id.py +usage_api/models/account_group_quota.py +usage_api/models/endpoint_agents_embedded_inner.py +usage_api/models/endpoint_agents_essentials_inner.py +usage_api/models/endpoint_agents_inner.py +usage_api/models/enterprise_agent_units_inner.py +usage_api/models/enterprise_agents_inner.py +usage_api/models/error.py +usage_api/models/expand.py +usage_api/models/get_quotas200_response.py +usage_api/models/get_usage200_response.py +usage_api/models/link.py +usage_api/models/organization_quota.py +usage_api/models/organizations_quotas_assign.py +usage_api/models/organizations_quotas_assign_organizations_inner.py +usage_api/models/organizations_quotas_unassign.py +usage_api/models/organizations_quotas_unassign_organizations_inner.py +usage_api/models/quotas.py +usage_api/models/quotas_assign_request.py +usage_api/models/quotas_assign_response.py +usage_api/models/quotas_quotas_inner.py +usage_api/models/quotas_unassign.py +usage_api/models/self_links.py +usage_api/models/self_links_links.py +usage_api/models/tests_inner.py +usage_api/models/unauthorized_error.py +usage_api/models/usage.py +usage_api/models/usage_usage.py +usage_api/models/usage_usage_quota.py +usage_api/py.typed +usage_api/rest.py diff --git a/usage_api/.openapi-generator/VERSION b/usage_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/usage_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/usage_api/.travis.yml b/usage_api/.travis.yml new file mode 100644 index 00000000..d7975f96 --- /dev/null +++ b/usage_api/.travis.yml @@ -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=usage_api diff --git a/usage_api/README.md b/usage_api/README.md new file mode 100644 index 00000000..e05f2270 --- /dev/null +++ b/usage_api/README.md @@ -0,0 +1,167 @@ +# usage-api +## Overview +These usage endpoints define the following operations: +* **Usage**: Retrieve usage data for the specified time period (default is one month). + + * Users must have the `View Billing` permission to access this endpoint. + * This endpoint offers visibility across all account groups within the organization. + * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. + +* **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. + + * Users must have the necessary permissions to perform quota-related actions. + +Refer to the API definitions below for detailed usage instructions and optional parameters. + +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 usage_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 usage_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 usage_api +from usage_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 = usage_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 = usage_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with usage_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = usage_api.QuotasApi(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) + organizations_quotas_assign = usage_api.OrganizationsQuotasAssign() # OrganizationsQuotasAssign | (optional) + + try: + # Create or update accout group quotas + api_response = api_instance.assign_organizations_account_groups_quotas(aid=aid, organizations_quotas_assign=organizations_quotas_assign) + print("The response of QuotasApi->assign_organizations_account_groups_quotas:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling QuotasApi->assign_organizations_account_groups_quotas: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*QuotasApi* | [**assign_organizations_account_groups_quotas**](docs/QuotasApi.md#assign_organizations_account_groups_quotas) | **POST** /v7/quotas/account-groups/assign | Create or update accout group quotas +*QuotasApi* | [**assign_organizations_quotas**](docs/QuotasApi.md#assign_organizations_quotas) | **POST** /v7/quotas/assign | Create or update organizations quotas +*QuotasApi* | [**get_quotas**](docs/QuotasApi.md#get_quotas) | **GET** /v7/quotas | Get organization and account group usage quota +*QuotasApi* | [**unassign_organizations_account_groups_quotas**](docs/QuotasApi.md#unassign_organizations_account_groups_quotas) | **POST** /v7/quotas/account-groups/unassign | Remove account group quotas from organizations +*QuotasApi* | [**unassign_organizations_quotas**](docs/QuotasApi.md#unassign_organizations_quotas) | **POST** /v7/quotas/unassign | Remove organization quotas +*UsageApi* | [**get_usage**](docs/UsageApi.md#get_usage) | **GET** /v7/usage | Get usage information for the last month + + +## Documentation For Models + + - [AccountGroup](docs/AccountGroup.md) + - [AccountGroupId](docs/AccountGroupId.md) + - [AccountGroupQuota](docs/AccountGroupQuota.md) + - [EndpointAgentsEmbeddedInner](docs/EndpointAgentsEmbeddedInner.md) + - [EndpointAgentsEssentialsInner](docs/EndpointAgentsEssentialsInner.md) + - [EndpointAgentsInner](docs/EndpointAgentsInner.md) + - [EnterpriseAgentUnitsInner](docs/EnterpriseAgentUnitsInner.md) + - [EnterpriseAgentsInner](docs/EnterpriseAgentsInner.md) + - [Error](docs/Error.md) + - [Expand](docs/Expand.md) + - [GetQuotas200Response](docs/GetQuotas200Response.md) + - [GetUsage200Response](docs/GetUsage200Response.md) + - [Link](docs/Link.md) + - [OrganizationQuota](docs/OrganizationQuota.md) + - [OrganizationsQuotasAssign](docs/OrganizationsQuotasAssign.md) + - [OrganizationsQuotasAssignOrganizationsInner](docs/OrganizationsQuotasAssignOrganizationsInner.md) + - [OrganizationsQuotasUnassign](docs/OrganizationsQuotasUnassign.md) + - [OrganizationsQuotasUnassignOrganizationsInner](docs/OrganizationsQuotasUnassignOrganizationsInner.md) + - [Quotas](docs/Quotas.md) + - [QuotasAssignRequest](docs/QuotasAssignRequest.md) + - [QuotasAssignResponse](docs/QuotasAssignResponse.md) + - [QuotasQuotasInner](docs/QuotasQuotasInner.md) + - [QuotasUnassign](docs/QuotasUnassign.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [TestsInner](docs/TestsInner.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + - [Usage](docs/Usage.md) + - [UsageUsage](docs/UsageUsage.md) + - [UsageUsageQuota](docs/UsageUsageQuota.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/usage_api/docs/AccountGroup.md b/usage_api/docs/AccountGroup.md new file mode 100644 index 00000000..5faee646 --- /dev/null +++ b/usage_api/docs/AccountGroup.md @@ -0,0 +1,29 @@ +# AccountGroup + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**account_group_name** | **str** | Account group name | [optional] + +## Example + +```python +from usage_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) + + diff --git a/usage_api/docs/AccountGroupId.md b/usage_api/docs/AccountGroupId.md new file mode 100644 index 00000000..510011d5 --- /dev/null +++ b/usage_api/docs/AccountGroupId.md @@ -0,0 +1,28 @@ +# AccountGroupId + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] + +## Example + +```python +from usage_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) + + diff --git a/usage_api/docs/AccountGroupQuota.md b/usage_api/docs/AccountGroupQuota.md new file mode 100644 index 00000000..fe000c7b --- /dev/null +++ b/usage_api/docs/AccountGroupQuota.md @@ -0,0 +1,29 @@ +# AccountGroupQuota + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | Value of the quota for the given Account Group. | [optional] +**aid** | **str** | Unique ID of the account group. | [optional] + +## Example + +```python +from usage_api.models.account_group_quota import AccountGroupQuota + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountGroupQuota from a JSON string +account_group_quota_instance = AccountGroupQuota.from_json(json) +# print the JSON string representation of the object +print AccountGroupQuota.to_json() + +# convert the object into a dict +account_group_quota_dict = account_group_quota_instance.to_dict() +# create an instance of AccountGroupQuota from a dict +account_group_quota_form_dict = account_group_quota.from_dict(account_group_quota_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/EndpointAgentsEmbeddedInner.md b/usage_api/docs/EndpointAgentsEmbeddedInner.md new file mode 100644 index 00000000..572a66dd --- /dev/null +++ b/usage_api/docs/EndpointAgentsEmbeddedInner.md @@ -0,0 +1,30 @@ +# EndpointAgentsEmbeddedInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **object** | Unique identifier of the account group that owns the embedded endpoint agents. | [optional] +**account_group_name** | **object** | Name of the account group that owns the embedded endpoint agents. | [optional] +**endpoint_agents_embedded_used** | **int** | Number of endpoint agents embedded owned by the specific account group in the usage period. | [optional] + +## Example + +```python +from usage_api.models.endpoint_agents_embedded_inner import EndpointAgentsEmbeddedInner + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentsEmbeddedInner from a JSON string +endpoint_agents_embedded_inner_instance = EndpointAgentsEmbeddedInner.from_json(json) +# print the JSON string representation of the object +print EndpointAgentsEmbeddedInner.to_json() + +# convert the object into a dict +endpoint_agents_embedded_inner_dict = endpoint_agents_embedded_inner_instance.to_dict() +# create an instance of EndpointAgentsEmbeddedInner from a dict +endpoint_agents_embedded_inner_form_dict = endpoint_agents_embedded_inner.from_dict(endpoint_agents_embedded_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/EndpointAgentsEssentialsInner.md b/usage_api/docs/EndpointAgentsEssentialsInner.md new file mode 100644 index 00000000..2da26b3e --- /dev/null +++ b/usage_api/docs/EndpointAgentsEssentialsInner.md @@ -0,0 +1,30 @@ +# EndpointAgentsEssentialsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **object** | Unique identifier of the account group owning the endpoint agents essentials. | [optional] +**account_group_name** | **object** | Name of the account group which owns the endpoint agents essentials. | [optional] +**endpoint_agents_essentials_used** | **int** | Number of endpoint agents essentials owned by the specific account group in the usage period. | [optional] + +## Example + +```python +from usage_api.models.endpoint_agents_essentials_inner import EndpointAgentsEssentialsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentsEssentialsInner from a JSON string +endpoint_agents_essentials_inner_instance = EndpointAgentsEssentialsInner.from_json(json) +# print the JSON string representation of the object +print EndpointAgentsEssentialsInner.to_json() + +# convert the object into a dict +endpoint_agents_essentials_inner_dict = endpoint_agents_essentials_inner_instance.to_dict() +# create an instance of EndpointAgentsEssentialsInner from a dict +endpoint_agents_essentials_inner_form_dict = endpoint_agents_essentials_inner.from_dict(endpoint_agents_essentials_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/EndpointAgentsInner.md b/usage_api/docs/EndpointAgentsInner.md new file mode 100644 index 00000000..35f1ccb0 --- /dev/null +++ b/usage_api/docs/EndpointAgentsInner.md @@ -0,0 +1,30 @@ +# EndpointAgentsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **object** | Unique identifier of the account group owning the endpoint agents. | [optional] +**account_group_name** | **object** | Name of the account group which owns the endpoint agents. | [optional] +**endpoint_agents_used** | **int** | Number of endpoint agents owned by the specific account group in the usage period. | [optional] + +## Example + +```python +from usage_api.models.endpoint_agents_inner import EndpointAgentsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentsInner from a JSON string +endpoint_agents_inner_instance = EndpointAgentsInner.from_json(json) +# print the JSON string representation of the object +print EndpointAgentsInner.to_json() + +# convert the object into a dict +endpoint_agents_inner_dict = endpoint_agents_inner_instance.to_dict() +# create an instance of EndpointAgentsInner from a dict +endpoint_agents_inner_form_dict = endpoint_agents_inner.from_dict(endpoint_agents_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/EnterpriseAgentUnitsInner.md b/usage_api/docs/EnterpriseAgentUnitsInner.md new file mode 100644 index 00000000..8699c6c4 --- /dev/null +++ b/usage_api/docs/EnterpriseAgentUnitsInner.md @@ -0,0 +1,34 @@ +# EnterpriseAgentUnitsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **object** | Unique identifier of the account group owning the enterprise agent units. | [optional] +**account_group_name** | **object** | Name of the account group which owns the enterprise agent units. | [optional] +**agent_id** | **str** | Unique identifier of the enterprise agent generating usage. | [optional] +**agent_name** | **str** | Name of the enterprise agent generating usage. | [optional] +**enterprise_units_used** | **int** | Number of enterprise agent units owned by the specific account group in the usage period. | [optional] +**enterprise_units_projected** | **int** | Number of enterprise units projected in the current usage period, based on units consumed to date and configuration of enabled tests. This value is updated hourly. Returns non-zero value only for organizations with metered billing. | [optional] +**vagent_id** | **str** | Unique identifier of the virtual agent generating usage | [optional] + +## Example + +```python +from usage_api.models.enterprise_agent_units_inner import EnterpriseAgentUnitsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of EnterpriseAgentUnitsInner from a JSON string +enterprise_agent_units_inner_instance = EnterpriseAgentUnitsInner.from_json(json) +# print the JSON string representation of the object +print EnterpriseAgentUnitsInner.to_json() + +# convert the object into a dict +enterprise_agent_units_inner_dict = enterprise_agent_units_inner_instance.to_dict() +# create an instance of EnterpriseAgentUnitsInner from a dict +enterprise_agent_units_inner_form_dict = enterprise_agent_units_inner.from_dict(enterprise_agent_units_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/EnterpriseAgentsInner.md b/usage_api/docs/EnterpriseAgentsInner.md new file mode 100644 index 00000000..fea4291a --- /dev/null +++ b/usage_api/docs/EnterpriseAgentsInner.md @@ -0,0 +1,30 @@ +# EnterpriseAgentsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **object** | A unique identifier that specifies the account group that owns the enterprise agents. | [optional] +**account_group_name** | **object** | Name of the account group which owns the enterprise agents. | [optional] +**enterprise_agents_used** | **int** | Number of enterprise agents owned by the specific account group in the usage period. | [optional] + +## Example + +```python +from usage_api.models.enterprise_agents_inner import EnterpriseAgentsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of EnterpriseAgentsInner from a JSON string +enterprise_agents_inner_instance = EnterpriseAgentsInner.from_json(json) +# print the JSON string representation of the object +print EnterpriseAgentsInner.to_json() + +# convert the object into a dict +enterprise_agents_inner_dict = enterprise_agents_inner_instance.to_dict() +# create an instance of EnterpriseAgentsInner from a dict +enterprise_agents_inner_form_dict = enterprise_agents_inner.from_dict(enterprise_agents_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/Error.md b/usage_api/docs/Error.md new file mode 100644 index 00000000..17aafc0d --- /dev/null +++ b/usage_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from usage_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/Expand.md b/usage_api/docs/Expand.md new file mode 100644 index 00000000..5d5b5ca2 --- /dev/null +++ b/usage_api/docs/Expand.md @@ -0,0 +1,10 @@ +# Expand + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/GetQuotas200Response.md b/usage_api/docs/GetQuotas200Response.md new file mode 100644 index 00000000..a072e7ad --- /dev/null +++ b/usage_api/docs/GetQuotas200Response.md @@ -0,0 +1,29 @@ +# GetQuotas200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quotas** | [**List[QuotasQuotasInner]**](QuotasQuotasInner.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from usage_api.models.get_quotas200_response import GetQuotas200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetQuotas200Response from a JSON string +get_quotas200_response_instance = GetQuotas200Response.from_json(json) +# print the JSON string representation of the object +print GetQuotas200Response.to_json() + +# convert the object into a dict +get_quotas200_response_dict = get_quotas200_response_instance.to_dict() +# create an instance of GetQuotas200Response from a dict +get_quotas200_response_form_dict = get_quotas200_response.from_dict(get_quotas200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/GetUsage200Response.md b/usage_api/docs/GetUsage200Response.md new file mode 100644 index 00000000..1aaf098c --- /dev/null +++ b/usage_api/docs/GetUsage200Response.md @@ -0,0 +1,29 @@ +# GetUsage200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**usage** | [**UsageUsage**](UsageUsage.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from usage_api.models.get_usage200_response import GetUsage200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetUsage200Response from a JSON string +get_usage200_response_instance = GetUsage200Response.from_json(json) +# print the JSON string representation of the object +print GetUsage200Response.to_json() + +# convert the object into a dict +get_usage200_response_dict = get_usage200_response_instance.to_dict() +# create an instance of GetUsage200Response from a dict +get_usage200_response_form_dict = get_usage200_response.from_dict(get_usage200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/Link.md b/usage_api/docs/Link.md new file mode 100644 index 00000000..6b0e67c1 --- /dev/null +++ b/usage_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from usage_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/OrganizationQuota.md b/usage_api/docs/OrganizationQuota.md new file mode 100644 index 00000000..c404727b --- /dev/null +++ b/usage_api/docs/OrganizationQuota.md @@ -0,0 +1,29 @@ +# OrganizationQuota + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | Value of the quota for the given Organization. | +**org_id** | **str** | Unique ID of the organization. | [optional] + +## Example + +```python +from usage_api.models.organization_quota import OrganizationQuota + +# TODO update the JSON string below +json = "{}" +# create an instance of OrganizationQuota from a JSON string +organization_quota_instance = OrganizationQuota.from_json(json) +# print the JSON string representation of the object +print OrganizationQuota.to_json() + +# convert the object into a dict +organization_quota_dict = organization_quota_instance.to_dict() +# create an instance of OrganizationQuota from a dict +organization_quota_form_dict = organization_quota.from_dict(organization_quota_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/OrganizationsQuotasAssign.md b/usage_api/docs/OrganizationsQuotasAssign.md new file mode 100644 index 00000000..da895889 --- /dev/null +++ b/usage_api/docs/OrganizationsQuotasAssign.md @@ -0,0 +1,28 @@ +# OrganizationsQuotasAssign + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organizations** | [**List[OrganizationsQuotasAssignOrganizationsInner]**](OrganizationsQuotasAssignOrganizationsInner.md) | | [optional] + +## Example + +```python +from usage_api.models.organizations_quotas_assign import OrganizationsQuotasAssign + +# TODO update the JSON string below +json = "{}" +# create an instance of OrganizationsQuotasAssign from a JSON string +organizations_quotas_assign_instance = OrganizationsQuotasAssign.from_json(json) +# print the JSON string representation of the object +print OrganizationsQuotasAssign.to_json() + +# convert the object into a dict +organizations_quotas_assign_dict = organizations_quotas_assign_instance.to_dict() +# create an instance of OrganizationsQuotasAssign from a dict +organizations_quotas_assign_form_dict = organizations_quotas_assign.from_dict(organizations_quotas_assign_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/OrganizationsQuotasAssignOrganizationsInner.md b/usage_api/docs/OrganizationsQuotasAssignOrganizationsInner.md new file mode 100644 index 00000000..e6cf7e71 --- /dev/null +++ b/usage_api/docs/OrganizationsQuotasAssignOrganizationsInner.md @@ -0,0 +1,29 @@ +# OrganizationsQuotasAssignOrganizationsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**org_id** | **str** | Unique identifier of the organization. | [optional] +**account_groups** | [**List[AccountGroupQuota]**](AccountGroupQuota.md) | List of account groups quotas. | [optional] + +## Example + +```python +from usage_api.models.organizations_quotas_assign_organizations_inner import OrganizationsQuotasAssignOrganizationsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of OrganizationsQuotasAssignOrganizationsInner from a JSON string +organizations_quotas_assign_organizations_inner_instance = OrganizationsQuotasAssignOrganizationsInner.from_json(json) +# print the JSON string representation of the object +print OrganizationsQuotasAssignOrganizationsInner.to_json() + +# convert the object into a dict +organizations_quotas_assign_organizations_inner_dict = organizations_quotas_assign_organizations_inner_instance.to_dict() +# create an instance of OrganizationsQuotasAssignOrganizationsInner from a dict +organizations_quotas_assign_organizations_inner_form_dict = organizations_quotas_assign_organizations_inner.from_dict(organizations_quotas_assign_organizations_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/OrganizationsQuotasUnassign.md b/usage_api/docs/OrganizationsQuotasUnassign.md new file mode 100644 index 00000000..2c276326 --- /dev/null +++ b/usage_api/docs/OrganizationsQuotasUnassign.md @@ -0,0 +1,28 @@ +# OrganizationsQuotasUnassign + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organizations** | [**List[OrganizationsQuotasUnassignOrganizationsInner]**](OrganizationsQuotasUnassignOrganizationsInner.md) | | [optional] + +## Example + +```python +from usage_api.models.organizations_quotas_unassign import OrganizationsQuotasUnassign + +# TODO update the JSON string below +json = "{}" +# create an instance of OrganizationsQuotasUnassign from a JSON string +organizations_quotas_unassign_instance = OrganizationsQuotasUnassign.from_json(json) +# print the JSON string representation of the object +print OrganizationsQuotasUnassign.to_json() + +# convert the object into a dict +organizations_quotas_unassign_dict = organizations_quotas_unassign_instance.to_dict() +# create an instance of OrganizationsQuotasUnassign from a dict +organizations_quotas_unassign_form_dict = organizations_quotas_unassign.from_dict(organizations_quotas_unassign_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/OrganizationsQuotasUnassignOrganizationsInner.md b/usage_api/docs/OrganizationsQuotasUnassignOrganizationsInner.md new file mode 100644 index 00000000..28fad9b7 --- /dev/null +++ b/usage_api/docs/OrganizationsQuotasUnassignOrganizationsInner.md @@ -0,0 +1,29 @@ +# OrganizationsQuotasUnassignOrganizationsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**org_id** | **str** | Unique identifier of the organization. | [optional] +**account_groups** | **List[str]** | List of account group IDs. | [optional] + +## Example + +```python +from usage_api.models.organizations_quotas_unassign_organizations_inner import OrganizationsQuotasUnassignOrganizationsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of OrganizationsQuotasUnassignOrganizationsInner from a JSON string +organizations_quotas_unassign_organizations_inner_instance = OrganizationsQuotasUnassignOrganizationsInner.from_json(json) +# print the JSON string representation of the object +print OrganizationsQuotasUnassignOrganizationsInner.to_json() + +# convert the object into a dict +organizations_quotas_unassign_organizations_inner_dict = organizations_quotas_unassign_organizations_inner_instance.to_dict() +# create an instance of OrganizationsQuotasUnassignOrganizationsInner from a dict +organizations_quotas_unassign_organizations_inner_form_dict = organizations_quotas_unassign_organizations_inner.from_dict(organizations_quotas_unassign_organizations_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/Quotas.md b/usage_api/docs/Quotas.md new file mode 100644 index 00000000..126b7119 --- /dev/null +++ b/usage_api/docs/Quotas.md @@ -0,0 +1,28 @@ +# Quotas + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quotas** | [**List[QuotasQuotasInner]**](QuotasQuotasInner.md) | | [optional] + +## Example + +```python +from usage_api.models.quotas import Quotas + +# TODO update the JSON string below +json = "{}" +# create an instance of Quotas from a JSON string +quotas_instance = Quotas.from_json(json) +# print the JSON string representation of the object +print Quotas.to_json() + +# convert the object into a dict +quotas_dict = quotas_instance.to_dict() +# create an instance of Quotas from a dict +quotas_form_dict = quotas.from_dict(quotas_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/QuotasApi.md b/usage_api/docs/QuotasApi.md new file mode 100644 index 00000000..511f7d7e --- /dev/null +++ b/usage_api/docs/QuotasApi.md @@ -0,0 +1,429 @@ +# usage_api.QuotasApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**assign_organizations_account_groups_quotas**](QuotasApi.md#assign_organizations_account_groups_quotas) | **POST** /v7/quotas/account-groups/assign | Create or update accout group quotas +[**assign_organizations_quotas**](QuotasApi.md#assign_organizations_quotas) | **POST** /v7/quotas/assign | Create or update organizations quotas +[**get_quotas**](QuotasApi.md#get_quotas) | **GET** /v7/quotas | Get organization and account group usage quota +[**unassign_organizations_account_groups_quotas**](QuotasApi.md#unassign_organizations_account_groups_quotas) | **POST** /v7/quotas/account-groups/unassign | Remove account group quotas from organizations +[**unassign_organizations_quotas**](QuotasApi.md#unassign_organizations_quotas) | **POST** /v7/quotas/unassign | Remove organization quotas + + +# **assign_organizations_account_groups_quotas** +> OrganizationsQuotasAssign assign_organizations_account_groups_quotas(aid=aid, organizations_quotas_assign=organizations_quotas_assign) + +Create or update accout group quotas + +Assigns quota values to multiple account groups from multiple organizations. `Edit organization and account group quotas` permission (a management permission) is required. This endpoint has cumulative behavior: The quotas are assigned to the specified account groups, and the previous assignments persist. No unassignment takes place. This endpoint assigns quota values to multiple account groups across multiple organizations. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. This endpoint follows a cumulative behavior––This means that the quotas are assigned to the designated account groups, and any previous assignments remain in place without any unassignment occurring. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import usage_api +from usage_api.models.organizations_quotas_assign import OrganizationsQuotasAssign +from usage_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 = usage_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 = usage_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with usage_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = usage_api.QuotasApi(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) + organizations_quotas_assign = usage_api.OrganizationsQuotasAssign() # OrganizationsQuotasAssign | (optional) + + try: + # Create or update accout group quotas + api_response = api_instance.assign_organizations_account_groups_quotas(aid=aid, organizations_quotas_assign=organizations_quotas_assign) + print("The response of QuotasApi->assign_organizations_account_groups_quotas:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling QuotasApi->assign_organizations_account_groups_quotas: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **organizations_quotas_assign** | [**OrganizationsQuotasAssign**](OrganizationsQuotasAssign.md)| | [optional] + +### Return type + +[**OrganizationsQuotasAssign**](OrganizationsQuotasAssign.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**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 | - | + +[[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) + +# **assign_organizations_quotas** +> QuotasAssignResponse assign_organizations_quotas(aid=aid, quotas_assign_request=quotas_assign_request) + +Create or update organizations quotas + +This endpoint recieves a list of organization quotas to create or update. If there's no specific `orgId` defined for a quota, it defaults to using the authenticated organization. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. This endpoint follows cumulative behavior––This means that the quotas are assigned to the specified organizations, and any previous assignments remain unchanged; no unassignments occur. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import usage_api +from usage_api.models.quotas_assign_request import QuotasAssignRequest +from usage_api.models.quotas_assign_response import QuotasAssignResponse +from usage_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 = usage_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 = usage_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with usage_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = usage_api.QuotasApi(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) + quotas_assign_request = usage_api.QuotasAssignRequest() # QuotasAssignRequest | (optional) + + try: + # Create or update organizations quotas + api_response = api_instance.assign_organizations_quotas(aid=aid, quotas_assign_request=quotas_assign_request) + print("The response of QuotasApi->assign_organizations_quotas:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling QuotasApi->assign_organizations_quotas: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **quotas_assign_request** | [**QuotasAssignRequest**](QuotasAssignRequest.md)| | [optional] + +### Return type + +[**QuotasAssignResponse**](QuotasAssignResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**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 | - | + +[[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_quotas** +> GetQuotas200Response get_quotas() + +Get organization and account group usage quota + +This endpoint retrieves usage quotas for both organization and account groups. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. If a user has quota update permission in multiple organizations, the API returns data from all such organizations. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import usage_api +from usage_api.models.get_quotas200_response import GetQuotas200Response +from usage_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 = usage_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 = usage_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with usage_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = usage_api.QuotasApi(api_client) + + try: + # Get organization and account group usage quota + api_response = api_instance.get_quotas() + print("The response of QuotasApi->get_quotas:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling QuotasApi->get_quotas: %s\n" % e) +``` + + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**GetQuotas200Response**](GetQuotas200Response.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 | - | +**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 | - | + +[[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) + +# **unassign_organizations_account_groups_quotas** +> unassign_organizations_account_groups_quotas(aid=aid, organizations_quotas_unassign=organizations_quotas_unassign) + +Remove account group quotas from organizations + +Removes the quotas from multiple account groups from multiple organizations. `Edit organization and account group quotas` permission (a management permission) is required. Removes quotas from multiple account groups across multiple organizations. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import usage_api +from usage_api.models.organizations_quotas_unassign import OrganizationsQuotasUnassign +from usage_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 = usage_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 = usage_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with usage_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = usage_api.QuotasApi(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) + organizations_quotas_unassign = usage_api.OrganizationsQuotasUnassign() # OrganizationsQuotasUnassign | (optional) + + try: + # Remove account group quotas from organizations + api_instance.unassign_organizations_account_groups_quotas(aid=aid, organizations_quotas_unassign=organizations_quotas_unassign) + except Exception as e: + print("Exception when calling QuotasApi->unassign_organizations_account_groups_quotas: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **organizations_quotas_unassign** | [**OrganizationsQuotasUnassign**](OrganizationsQuotasUnassign.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**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 | - | + +[[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) + +# **unassign_organizations_quotas** +> unassign_organizations_quotas(aid=aid, quotas_unassign=quotas_unassign) + +Remove organization quotas + +This endpoint recieves a list of organization IDs to remove their current quota. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import usage_api +from usage_api.models.quotas_unassign import QuotasUnassign +from usage_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 = usage_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 = usage_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with usage_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = usage_api.QuotasApi(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) + quotas_unassign = usage_api.QuotasUnassign() # QuotasUnassign | (optional) + + try: + # Remove organization quotas + api_instance.unassign_organizations_quotas(aid=aid, quotas_unassign=quotas_unassign) + except Exception as e: + print("Exception when calling QuotasApi->unassign_organizations_quotas: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **quotas_unassign** | [**QuotasUnassign**](QuotasUnassign.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/usage_api/docs/QuotasAssignRequest.md b/usage_api/docs/QuotasAssignRequest.md new file mode 100644 index 00000000..e0d68cd9 --- /dev/null +++ b/usage_api/docs/QuotasAssignRequest.md @@ -0,0 +1,28 @@ +# QuotasAssignRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organizations** | [**List[OrganizationQuota]**](OrganizationQuota.md) | | [optional] + +## Example + +```python +from usage_api.models.quotas_assign_request import QuotasAssignRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of QuotasAssignRequest from a JSON string +quotas_assign_request_instance = QuotasAssignRequest.from_json(json) +# print the JSON string representation of the object +print QuotasAssignRequest.to_json() + +# convert the object into a dict +quotas_assign_request_dict = quotas_assign_request_instance.to_dict() +# create an instance of QuotasAssignRequest from a dict +quotas_assign_request_form_dict = quotas_assign_request.from_dict(quotas_assign_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) + + diff --git a/usage_api/docs/QuotasAssignResponse.md b/usage_api/docs/QuotasAssignResponse.md new file mode 100644 index 00000000..fcc7c158 --- /dev/null +++ b/usage_api/docs/QuotasAssignResponse.md @@ -0,0 +1,28 @@ +# QuotasAssignResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organizations** | [**List[OrganizationQuota]**](OrganizationQuota.md) | | [optional] + +## Example + +```python +from usage_api.models.quotas_assign_response import QuotasAssignResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of QuotasAssignResponse from a JSON string +quotas_assign_response_instance = QuotasAssignResponse.from_json(json) +# print the JSON string representation of the object +print QuotasAssignResponse.to_json() + +# convert the object into a dict +quotas_assign_response_dict = quotas_assign_response_instance.to_dict() +# create an instance of QuotasAssignResponse from a dict +quotas_assign_response_form_dict = quotas_assign_response.from_dict(quotas_assign_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/QuotasQuotasInner.md b/usage_api/docs/QuotasQuotasInner.md new file mode 100644 index 00000000..5166002c --- /dev/null +++ b/usage_api/docs/QuotasQuotasInner.md @@ -0,0 +1,29 @@ +# QuotasQuotasInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organization_quota** | [**OrganizationQuota**](OrganizationQuota.md) | | [optional] +**account_group_quotas** | [**List[AccountGroupQuota]**](AccountGroupQuota.md) | | [optional] + +## Example + +```python +from usage_api.models.quotas_quotas_inner import QuotasQuotasInner + +# TODO update the JSON string below +json = "{}" +# create an instance of QuotasQuotasInner from a JSON string +quotas_quotas_inner_instance = QuotasQuotasInner.from_json(json) +# print the JSON string representation of the object +print QuotasQuotasInner.to_json() + +# convert the object into a dict +quotas_quotas_inner_dict = quotas_quotas_inner_instance.to_dict() +# create an instance of QuotasQuotasInner from a dict +quotas_quotas_inner_form_dict = quotas_quotas_inner.from_dict(quotas_quotas_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/QuotasUnassign.md b/usage_api/docs/QuotasUnassign.md new file mode 100644 index 00000000..bb5168a2 --- /dev/null +++ b/usage_api/docs/QuotasUnassign.md @@ -0,0 +1,28 @@ +# QuotasUnassign + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organizations** | **List[str]** | | [optional] + +## Example + +```python +from usage_api.models.quotas_unassign import QuotasUnassign + +# TODO update the JSON string below +json = "{}" +# create an instance of QuotasUnassign from a JSON string +quotas_unassign_instance = QuotasUnassign.from_json(json) +# print the JSON string representation of the object +print QuotasUnassign.to_json() + +# convert the object into a dict +quotas_unassign_dict = quotas_unassign_instance.to_dict() +# create an instance of QuotasUnassign from a dict +quotas_unassign_form_dict = quotas_unassign.from_dict(quotas_unassign_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/SelfLinks.md b/usage_api/docs/SelfLinks.md new file mode 100644 index 00000000..ee780ff4 --- /dev/null +++ b/usage_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from usage_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/SelfLinksLinks.md b/usage_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..9539d2c9 --- /dev/null +++ b/usage_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from usage_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/TestsInner.md b/usage_api/docs/TestsInner.md new file mode 100644 index 00000000..2135390e --- /dev/null +++ b/usage_api/docs/TestsInner.md @@ -0,0 +1,34 @@ +# TestsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **object** | Unique identifier of the account group which owns the test. | [optional] +**account_group_name** | **object** | Name of the account group which owns the test. | [optional] +**test_id** | **str** | Unique identifier of the test generating usage. | [optional] +**test_name** | **str** | Name of the test generating usage. | [optional] +**test_type** | **str** | The type of test that generated the usage data. Note that this parameter provides a user-friendly description of the test type and should not be parsed to determine the endpoint for querying configuration details. | [optional] +**cloud_units_used** | **int** | Number of cloud units that the test has consumed in the usage period. | [optional] +**cloud_units_projected** | **int** | The estimated number of cloud units that the test is expected to consume during the usage period. This estimate is determined by considering the units consumed up to the current time and the test's configuration. It's important to note that this value is updated every hour. For new tests, the `cloudUnitsProjected` parameter is absent until the projection is calculated. | [optional] + +## Example + +```python +from usage_api.models.tests_inner import TestsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of TestsInner from a JSON string +tests_inner_instance = TestsInner.from_json(json) +# print the JSON string representation of the object +print TestsInner.to_json() + +# convert the object into a dict +tests_inner_dict = tests_inner_instance.to_dict() +# create an instance of TestsInner from a dict +tests_inner_form_dict = tests_inner.from_dict(tests_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/UnauthorizedError.md b/usage_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..06fe8f52 --- /dev/null +++ b/usage_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from usage_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/Usage.md b/usage_api/docs/Usage.md new file mode 100644 index 00000000..160a698c --- /dev/null +++ b/usage_api/docs/Usage.md @@ -0,0 +1,28 @@ +# Usage + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**usage** | [**UsageUsage**](UsageUsage.md) | | [optional] + +## Example + +```python +from usage_api.models.usage import Usage + +# TODO update the JSON string below +json = "{}" +# create an instance of Usage from a JSON string +usage_instance = Usage.from_json(json) +# print the JSON string representation of the object +print Usage.to_json() + +# convert the object into a dict +usage_dict = usage_instance.to_dict() +# create an instance of Usage from a dict +usage_form_dict = usage.from_dict(usage_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/UsageApi.md b/usage_api/docs/UsageApi.md new file mode 100644 index 00000000..059195f7 --- /dev/null +++ b/usage_api/docs/UsageApi.md @@ -0,0 +1,95 @@ +# usage_api.UsageApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_usage**](UsageApi.md#get_usage) | **GET** /v7/usage | Get usage information for the last month + + +# **get_usage** +> GetUsage200Response get_usage(aid=aid, expand=expand) + +Get usage information for the last month + +This endpoint returns the organization's usage data for a specified time period. If no time period is specified, it defaults to the last month. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import usage_api +from usage_api.models.expand import Expand +from usage_api.models.get_usage200_response import GetUsage200Response +from usage_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 = usage_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 = usage_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with usage_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = usage_api.UsageApi(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 = [usage_api.Expand()] # List[Expand] | Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'. (optional) + + try: + # Get usage information for the last month + api_response = api_instance.get_usage(aid=aid, expand=expand) + print("The response of UsageApi->get_usage:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsageApi->get_usage: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[Expand]**](Expand.md)| Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'. | [optional] + +### Return type + +[**GetUsage200Response**](GetUsage200Response.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 | - | +**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 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/usage_api/docs/UsageUsage.md b/usage_api/docs/UsageUsage.md new file mode 100644 index 00000000..7f26404d --- /dev/null +++ b/usage_api/docs/UsageUsage.md @@ -0,0 +1,44 @@ +# UsageUsage + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quota** | [**UsageUsageQuota**](UsageUsageQuota.md) | | [optional] +**cloud_units_used** | **int** | Number of cloud units consumed thus far in the usage period. | [optional] +**cloud_units_projected** | **int** | Number of cloud units projected in the current usage period, based on units consumed to date and configuration of enabled tests. This value is updated hourly. | [optional] +**cloud_units_next_billing_period** | **int** | Number of cloud units projected in the upcoming usage period, based on configuration of enabled tests. This value is updated hourly. | [optional] +**enterprise_units_used** | **int** | Number of enterprise units consumed in the usage period. Returns non-zero value only for organizations with metered billing. | [optional] +**enterprise_units_projected** | **int** | Number of enterprise units projected in the current usage period, based on units consumed to date and configuration of enabled tests. This value is updated hourly. Returns non-zero value only for organizations with metered billing. | [optional] +**enterprise_units_next_billing_period** | **int** | Number of enterprise units projected in the upcoming usage period, based on configuration of enabled tests. This value is updated hourly. Returns non-zero value only for organizations with metered billing. | [optional] +**endpoint_agents_used** | **int** | Number of endpoint agents used in the current usage period. This number is calculated by taking the maximum number of agents enabled for any one-hour period in the usage period. Disabled agents are excluded from this calculation. | [optional] +**endpoint_agents_essentials_used** | **int** | Number of endpoint agents essentials used in the current usage period. This number is calculated by taking the maximum number of agents enabled for any one-hour period in the usage period. Disabled agents are excluded from this calculation. | [optional] +**endpoint_agents_embedded_used** | **int** | Number of embedded endpoint agents used in the current usage period. This number is calculated by taking the maximum number of agents enabled for any one-hour period in the usage period. Disabled agents are excluded from this calculation. | [optional] +**enterprise_agents_used** | **int** | Number of enterprise agents used in the current usage period. This number is calculated by taking the maximum number of agents enabled for any one-hour period in the usage period. Disabled agents are excluded from this calculation. | [optional] +**enterprise_agent_units** | [**List[EnterpriseAgentUnitsInner]**](EnterpriseAgentUnitsInner.md) | A breakdown of enterprise unit consumption for each agent during the current monthly period. Each entry provides data for both the current actual usage and the projected usage. Returns non-zero values for organizations with metered billing. | [optional] +**tests** | [**List[TestsInner]**](TestsInner.md) | A breakdown of unit consumption for each test during the current monthly period. Each entry provides information about both the current actual usage and the projected usage. | [optional] +**endpoint_agents** | [**List[EndpointAgentsInner]**](EndpointAgentsInner.md) | Endpoint agents used by account group. | [optional] +**endpoint_agents_essentials** | [**List[EndpointAgentsEssentialsInner]**](EndpointAgentsEssentialsInner.md) | Endpoint agents essentials used by account group. | [optional] +**endpoint_agents_embedded** | [**List[EndpointAgentsEmbeddedInner]**](EndpointAgentsEmbeddedInner.md) | Endpoint agents embedded used by account group. | [optional] +**enterprise_agents** | [**List[EnterpriseAgentsInner]**](EnterpriseAgentsInner.md) | Enterprise agents used by account group. | [optional] + +## Example + +```python +from usage_api.models.usage_usage import UsageUsage + +# TODO update the JSON string below +json = "{}" +# create an instance of UsageUsage from a JSON string +usage_usage_instance = UsageUsage.from_json(json) +# print the JSON string representation of the object +print UsageUsage.to_json() + +# convert the object into a dict +usage_usage_dict = usage_usage_instance.to_dict() +# create an instance of UsageUsage from a dict +usage_usage_form_dict = usage_usage.from_dict(usage_usage_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/docs/UsageUsageQuota.md b/usage_api/docs/UsageUsageQuota.md new file mode 100644 index 00000000..f4af33fa --- /dev/null +++ b/usage_api/docs/UsageUsageQuota.md @@ -0,0 +1,34 @@ +# UsageUsageQuota + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**month_start** | **datetime** | Beginning of usage period in UTC (ISO date-time format). | [optional] +**month_end** | **datetime** | End of usage period in UTC (ISO date-time format).. | [optional] +**cloud_units_included** | **int** | Monthly number of cloud units allocated, as part of the contract. | [optional] +**endpoint_agents_included** | **int** | Monthly number of endpoint agents allocated, as part of the contract. | [optional] +**endpoint_agents_essentials_included** | **int** | Monthly number of endpoint agents essentials allocated, as part of the contract. | [optional] +**endpoint_agents_embedded_included** | **int** | Number of embedded endpoint agents allocated monthly, as specified in the contract. | [optional] +**enterprise_agents_included** | **int** | Monthly number of enterprise agents allocated, as part of the contract. Returns non-zero value only for organizations with legacy billing. | [optional] + +## Example + +```python +from usage_api.models.usage_usage_quota import UsageUsageQuota + +# TODO update the JSON string below +json = "{}" +# create an instance of UsageUsageQuota from a JSON string +usage_usage_quota_instance = UsageUsageQuota.from_json(json) +# print the JSON string representation of the object +print UsageUsageQuota.to_json() + +# convert the object into a dict +usage_usage_quota_dict = usage_usage_quota_instance.to_dict() +# create an instance of UsageUsageQuota from a dict +usage_usage_quota_form_dict = usage_usage_quota.from_dict(usage_usage_quota_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/usage_api/git_push.sh b/usage_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/usage_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/usage_api/pyproject.toml b/usage_api/pyproject.toml new file mode 100644 index 00000000..f65d270b --- /dev/null +++ b/usage_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "usage_api" +version = "1.0.0" +description = "Usage API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Usage API"] +include = ["usage_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/usage_api/requirements.txt b/usage_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/usage_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/usage_api/setup.cfg b/usage_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/usage_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/usage_api/setup.py b/usage_api/setup.py new file mode 100644 index 00000000..96c745ac --- /dev/null +++ b/usage_api/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "usage-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Usage API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Usage API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + """, # noqa: E501 + package_data={"usage_api": ["py.typed"]}, +) diff --git a/usage_api/test-requirements.txt b/usage_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/usage_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/usage_api/test/__init__.py b/usage_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/usage_api/test/test_account_group.py b/usage_api/test/test_account_group.py new file mode 100644 index 00000000..9bc18746 --- /dev/null +++ b/usage_api/test/test_account_group.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.account_group import AccountGroup + +class TestAccountGroup(unittest.TestCase): + """AccountGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroup: + """Test AccountGroup + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroup` + """ + model = AccountGroup() + if include_optional: + return AccountGroup( + aid = '11', + account_group_name = 'Account A' + ) + else: + return AccountGroup( + ) + """ + + def testAccountGroup(self): + """Test AccountGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_account_group_id.py b/usage_api/test/test_account_group_id.py new file mode 100644 index 00000000..d8b0ea41 --- /dev/null +++ b/usage_api/test/test_account_group_id.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.account_group_id import AccountGroupId + +class TestAccountGroupId(unittest.TestCase): + """AccountGroupId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroupId: + """Test AccountGroupId + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroupId` + """ + model = AccountGroupId() + if include_optional: + return AccountGroupId( + aid = '11' + ) + else: + return AccountGroupId( + ) + """ + + def testAccountGroupId(self): + """Test AccountGroupId""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_account_group_quota.py b/usage_api/test/test_account_group_quota.py new file mode 100644 index 00000000..33ff6f81 --- /dev/null +++ b/usage_api/test/test_account_group_quota.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.account_group_quota import AccountGroupQuota + +class TestAccountGroupQuota(unittest.TestCase): + """AccountGroupQuota unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroupQuota: + """Test AccountGroupQuota + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroupQuota` + """ + model = AccountGroupQuota() + if include_optional: + return AccountGroupQuota( + value = 12000, + aid = '35' + ) + else: + return AccountGroupQuota( + ) + """ + + def testAccountGroupQuota(self): + """Test AccountGroupQuota""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_endpoint_agents_embedded_inner.py b/usage_api/test/test_endpoint_agents_embedded_inner.py new file mode 100644 index 00000000..4ffb84e2 --- /dev/null +++ b/usage_api/test/test_endpoint_agents_embedded_inner.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.endpoint_agents_embedded_inner import EndpointAgentsEmbeddedInner + +class TestEndpointAgentsEmbeddedInner(unittest.TestCase): + """EndpointAgentsEmbeddedInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentsEmbeddedInner: + """Test EndpointAgentsEmbeddedInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentsEmbeddedInner` + """ + model = EndpointAgentsEmbeddedInner() + if include_optional: + return EndpointAgentsEmbeddedInner( + aid = None, + account_group_name = None, + endpoint_agents_embedded_used = 56 + ) + else: + return EndpointAgentsEmbeddedInner( + ) + """ + + def testEndpointAgentsEmbeddedInner(self): + """Test EndpointAgentsEmbeddedInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_endpoint_agents_essentials_inner.py b/usage_api/test/test_endpoint_agents_essentials_inner.py new file mode 100644 index 00000000..9013d5fa --- /dev/null +++ b/usage_api/test/test_endpoint_agents_essentials_inner.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.endpoint_agents_essentials_inner import EndpointAgentsEssentialsInner + +class TestEndpointAgentsEssentialsInner(unittest.TestCase): + """EndpointAgentsEssentialsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentsEssentialsInner: + """Test EndpointAgentsEssentialsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentsEssentialsInner` + """ + model = EndpointAgentsEssentialsInner() + if include_optional: + return EndpointAgentsEssentialsInner( + aid = None, + account_group_name = None, + endpoint_agents_essentials_used = 56 + ) + else: + return EndpointAgentsEssentialsInner( + ) + """ + + def testEndpointAgentsEssentialsInner(self): + """Test EndpointAgentsEssentialsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_endpoint_agents_inner.py b/usage_api/test/test_endpoint_agents_inner.py new file mode 100644 index 00000000..e77befb3 --- /dev/null +++ b/usage_api/test/test_endpoint_agents_inner.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.endpoint_agents_inner import EndpointAgentsInner + +class TestEndpointAgentsInner(unittest.TestCase): + """EndpointAgentsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointAgentsInner: + """Test EndpointAgentsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EndpointAgentsInner` + """ + model = EndpointAgentsInner() + if include_optional: + return EndpointAgentsInner( + aid = None, + account_group_name = None, + endpoint_agents_used = 56 + ) + else: + return EndpointAgentsInner( + ) + """ + + def testEndpointAgentsInner(self): + """Test EndpointAgentsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_enterprise_agent_units_inner.py b/usage_api/test/test_enterprise_agent_units_inner.py new file mode 100644 index 00000000..06a4d5fd --- /dev/null +++ b/usage_api/test/test_enterprise_agent_units_inner.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.enterprise_agent_units_inner import EnterpriseAgentUnitsInner + +class TestEnterpriseAgentUnitsInner(unittest.TestCase): + """EnterpriseAgentUnitsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EnterpriseAgentUnitsInner: + """Test EnterpriseAgentUnitsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EnterpriseAgentUnitsInner` + """ + model = EnterpriseAgentUnitsInner() + if include_optional: + return EnterpriseAgentUnitsInner( + aid = None, + account_group_name = None, + agent_id = '', + agent_name = '', + enterprise_units_used = 56, + enterprise_units_projected = 56, + vagent_id = '' + ) + else: + return EnterpriseAgentUnitsInner( + ) + """ + + def testEnterpriseAgentUnitsInner(self): + """Test EnterpriseAgentUnitsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_enterprise_agents_inner.py b/usage_api/test/test_enterprise_agents_inner.py new file mode 100644 index 00000000..0ad80e78 --- /dev/null +++ b/usage_api/test/test_enterprise_agents_inner.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.enterprise_agents_inner import EnterpriseAgentsInner + +class TestEnterpriseAgentsInner(unittest.TestCase): + """EnterpriseAgentsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EnterpriseAgentsInner: + """Test EnterpriseAgentsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EnterpriseAgentsInner` + """ + model = EnterpriseAgentsInner() + if include_optional: + return EnterpriseAgentsInner( + aid = None, + account_group_name = None, + enterprise_agents_used = 56 + ) + else: + return EnterpriseAgentsInner( + ) + """ + + def testEnterpriseAgentsInner(self): + """Test EnterpriseAgentsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_error.py b/usage_api/test/test_error.py new file mode 100644 index 00000000..bd7fda74 --- /dev/null +++ b/usage_api/test/test_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_expand.py b/usage_api/test/test_expand.py new file mode 100644 index 00000000..9a2611a4 --- /dev/null +++ b/usage_api/test/test_expand.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.expand import Expand + +class TestExpand(unittest.TestCase): + """Expand unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testExpand(self): + """Test Expand""" + # inst = Expand() + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_get_quotas200_response.py b/usage_api/test/test_get_quotas200_response.py new file mode 100644 index 00000000..7c1c1e40 --- /dev/null +++ b/usage_api/test/test_get_quotas200_response.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.get_quotas200_response import GetQuotas200Response + +class TestGetQuotas200Response(unittest.TestCase): + """GetQuotas200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetQuotas200Response: + """Test GetQuotas200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetQuotas200Response` + """ + model = GetQuotas200Response() + if include_optional: + return GetQuotas200Response( + quotas = [ + usage_api.models.quotas_quotas_inner.Quotas_quotas_inner( + organization_quota = usage_api.models.organization_quota.OrganizationQuota( + value = 22500, + org_id = '10', ), + account_group_quotas = [{"value":12000,"aid":"315"},{"value":10000,"aid":"1200"}], ) + ], + links = usage_api.models.self_links__links.SelfLinks__links( + self = usage_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetQuotas200Response( + ) + """ + + def testGetQuotas200Response(self): + """Test GetQuotas200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_get_usage200_response.py b/usage_api/test/test_get_usage200_response.py new file mode 100644 index 00000000..c3612241 --- /dev/null +++ b/usage_api/test/test_get_usage200_response.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.get_usage200_response import GetUsage200Response + +class TestGetUsage200Response(unittest.TestCase): + """GetUsage200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetUsage200Response: + """Test GetUsage200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetUsage200Response` + """ + model = GetUsage200Response() + if include_optional: + return GetUsage200Response( + usage = usage_api.models.usage_usage.Usage_usage( + quota = usage_api.models.usage_usage_quota.Usage_usage_quota( + month_start = '2020-01-05T08:00Z', + month_end = '2020-02-05T08:00Z', + cloud_units_included = 4320000000, + endpoint_agents_included = 200, + endpoint_agents_essentials_included = 10, + endpoint_agents_embedded_included = 10, + enterprise_agents_included = 25, ), + cloud_units_used = 8500489, + cloud_units_projected = 20993812, + cloud_units_next_billing_period = 25123456, + enterprise_units_used = 79640902, + enterprise_units_projected = 108016317, + enterprise_units_next_billing_period = 0, + endpoint_agents_used = 42, + endpoint_agents_essentials_used = 5, + endpoint_agents_embedded_used = 5, + enterprise_agents_used = 58, + enterprise_agent_units = [ + [{"aid":"7625","agentId":"121404","accountGroupName":"Support","agentName":"TEVA-test-agent","enterpriseUnitsUsed":599878,"enterpriseUnitsProjected":597808,"vagentId":"123456"},{"aid":"315","agentId":"121404","accountGroupName":"Documentation","agentName":"lab-physical-appliance-1","enterpriseUnitsUsed":597123,"enterpriseUnitsProjected":597808,"vagentId":"789"}] + ], + tests = [{"aid":"315","testId":"1158","accountGroupName":"Documentation","testName":"https://app.thousandeyes.com","testType":"Web-Page Load","cloudUnitsUsed":14050,"cloudUnitsProjected":340674},{"aid":"315","testId":"1159","accountGroupName":"Documentation","testName":"https://support.thousandeyes.com","testType":"Web - HTTP Server","cloudUnitsUsed":64390,"cloudUnitsProjected":164457}], + endpoint_agents = [{"aid":"7625","accountGroupName":"Support","endpointAgentsUsed":22},{"aid":"315","accountGroupName":"Documentation","endpointAgentsUsed":14}], + endpoint_agents_essentials = [{"aid":"10","accountGroupName":"Support","endpointAgentsEssentialsUsed":2},{"aid":"100","accountGroupName":"Documentation","endpointAgentsEssentialsUsed":3}], + endpoint_agents_embedded = [{"aid":"10","accountGroupName":"Support","endpointAgentsEmbeddedUsed":2},{"aid":"100","accountGroupName":"Documentation","endpointAgentsEmbeddedUsed":3}], + enterprise_agents = [{"aid":"7625","accountGroupName":"Support","enterpriseAgentsUsed":7},{"aid":"315","accountGroupName":"Documentation","enterpriseAgentsUsed":1}], ), + links = usage_api.models.self_links__links.SelfLinks__links( + self = usage_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetUsage200Response( + ) + """ + + def testGetUsage200Response(self): + """Test GetUsage200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_link.py b/usage_api/test/test_link.py new file mode 100644 index 00000000..5da306bf --- /dev/null +++ b/usage_api/test/test_link.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_organization_quota.py b/usage_api/test/test_organization_quota.py new file mode 100644 index 00000000..e6bf5f88 --- /dev/null +++ b/usage_api/test/test_organization_quota.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.organization_quota import OrganizationQuota + +class TestOrganizationQuota(unittest.TestCase): + """OrganizationQuota unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OrganizationQuota: + """Test OrganizationQuota + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `OrganizationQuota` + """ + model = OrganizationQuota() + if include_optional: + return OrganizationQuota( + value = 22500, + org_id = '10' + ) + else: + return OrganizationQuota( + value = 22500, + ) + """ + + def testOrganizationQuota(self): + """Test OrganizationQuota""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_organizations_quotas_assign.py b/usage_api/test/test_organizations_quotas_assign.py new file mode 100644 index 00000000..a3cdcee5 --- /dev/null +++ b/usage_api/test/test_organizations_quotas_assign.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.organizations_quotas_assign import OrganizationsQuotasAssign + +class TestOrganizationsQuotasAssign(unittest.TestCase): + """OrganizationsQuotasAssign unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OrganizationsQuotasAssign: + """Test OrganizationsQuotasAssign + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `OrganizationsQuotasAssign` + """ + model = OrganizationsQuotasAssign() + if include_optional: + return OrganizationsQuotasAssign( + organizations = [ + usage_api.models.organizations_quotas_assign_organizations_inner.OrganizationsQuotasAssign_organizations_inner( + org_id = '315', + account_groups = [ + usage_api.models.account_group_quota.AccountGroupQuota( + value = 12000, + aid = '35', ) + ], ) + ] + ) + else: + return OrganizationsQuotasAssign( + ) + """ + + def testOrganizationsQuotasAssign(self): + """Test OrganizationsQuotasAssign""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_organizations_quotas_assign_organizations_inner.py b/usage_api/test/test_organizations_quotas_assign_organizations_inner.py new file mode 100644 index 00000000..8b09c547 --- /dev/null +++ b/usage_api/test/test_organizations_quotas_assign_organizations_inner.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.organizations_quotas_assign_organizations_inner import OrganizationsQuotasAssignOrganizationsInner + +class TestOrganizationsQuotasAssignOrganizationsInner(unittest.TestCase): + """OrganizationsQuotasAssignOrganizationsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OrganizationsQuotasAssignOrganizationsInner: + """Test OrganizationsQuotasAssignOrganizationsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `OrganizationsQuotasAssignOrganizationsInner` + """ + model = OrganizationsQuotasAssignOrganizationsInner() + if include_optional: + return OrganizationsQuotasAssignOrganizationsInner( + org_id = '315', + account_groups = [ + usage_api.models.account_group_quota.AccountGroupQuota( + value = 12000, + aid = '35', ) + ] + ) + else: + return OrganizationsQuotasAssignOrganizationsInner( + ) + """ + + def testOrganizationsQuotasAssignOrganizationsInner(self): + """Test OrganizationsQuotasAssignOrganizationsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_organizations_quotas_unassign.py b/usage_api/test/test_organizations_quotas_unassign.py new file mode 100644 index 00000000..17cd6ffa --- /dev/null +++ b/usage_api/test/test_organizations_quotas_unassign.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.organizations_quotas_unassign import OrganizationsQuotasUnassign + +class TestOrganizationsQuotasUnassign(unittest.TestCase): + """OrganizationsQuotasUnassign unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OrganizationsQuotasUnassign: + """Test OrganizationsQuotasUnassign + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `OrganizationsQuotasUnassign` + """ + model = OrganizationsQuotasUnassign() + if include_optional: + return OrganizationsQuotasUnassign( + organizations = [ + usage_api.models.organizations_quotas_unassign_organizations_inner.OrganizationsQuotasUnassign_organizations_inner( + org_id = '315', + account_groups = ["35","720"], ) + ] + ) + else: + return OrganizationsQuotasUnassign( + ) + """ + + def testOrganizationsQuotasUnassign(self): + """Test OrganizationsQuotasUnassign""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_organizations_quotas_unassign_organizations_inner.py b/usage_api/test/test_organizations_quotas_unassign_organizations_inner.py new file mode 100644 index 00000000..9178ff2f --- /dev/null +++ b/usage_api/test/test_organizations_quotas_unassign_organizations_inner.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.organizations_quotas_unassign_organizations_inner import OrganizationsQuotasUnassignOrganizationsInner + +class TestOrganizationsQuotasUnassignOrganizationsInner(unittest.TestCase): + """OrganizationsQuotasUnassignOrganizationsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OrganizationsQuotasUnassignOrganizationsInner: + """Test OrganizationsQuotasUnassignOrganizationsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `OrganizationsQuotasUnassignOrganizationsInner` + """ + model = OrganizationsQuotasUnassignOrganizationsInner() + if include_optional: + return OrganizationsQuotasUnassignOrganizationsInner( + org_id = '315', + account_groups = ["35","720"] + ) + else: + return OrganizationsQuotasUnassignOrganizationsInner( + ) + """ + + def testOrganizationsQuotasUnassignOrganizationsInner(self): + """Test OrganizationsQuotasUnassignOrganizationsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_quotas.py b/usage_api/test/test_quotas.py new file mode 100644 index 00000000..6ead5f9e --- /dev/null +++ b/usage_api/test/test_quotas.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.quotas import Quotas + +class TestQuotas(unittest.TestCase): + """Quotas unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Quotas: + """Test Quotas + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Quotas` + """ + model = Quotas() + if include_optional: + return Quotas( + quotas = [ + usage_api.models.quotas_quotas_inner.Quotas_quotas_inner( + organization_quota = usage_api.models.organization_quota.OrganizationQuota( + value = 22500, + org_id = '10', ), + account_group_quotas = [{"value":12000,"aid":"315"},{"value":10000,"aid":"1200"}], ) + ] + ) + else: + return Quotas( + ) + """ + + def testQuotas(self): + """Test Quotas""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_quotas_api.py b/usage_api/test/test_quotas_api.py new file mode 100644 index 00000000..921e22a8 --- /dev/null +++ b/usage_api/test/test_quotas_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest + +from usage_api.api.quotas_api import QuotasApi + + +class TestQuotasApi(unittest.TestCase): + """QuotasApi unit test stubs""" + + def setUp(self) -> None: + self.api = QuotasApi() + + def tearDown(self) -> None: + pass + + def test_assign_organizations_account_groups_quotas(self) -> None: + """Test case for assign_organizations_account_groups_quotas + + Create or update accout group quotas + """ + pass + + def test_assign_organizations_quotas(self) -> None: + """Test case for assign_organizations_quotas + + Create or update organizations quotas + """ + pass + + def test_get_quotas(self) -> None: + """Test case for get_quotas + + Get organization and account group usage quota + """ + pass + + def test_unassign_organizations_account_groups_quotas(self) -> None: + """Test case for unassign_organizations_account_groups_quotas + + Remove account group quotas from organizations + """ + pass + + def test_unassign_organizations_quotas(self) -> None: + """Test case for unassign_organizations_quotas + + Remove organization quotas + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_quotas_assign_request.py b/usage_api/test/test_quotas_assign_request.py new file mode 100644 index 00000000..92065a7a --- /dev/null +++ b/usage_api/test/test_quotas_assign_request.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.quotas_assign_request import QuotasAssignRequest + +class TestQuotasAssignRequest(unittest.TestCase): + """QuotasAssignRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> QuotasAssignRequest: + """Test QuotasAssignRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `QuotasAssignRequest` + """ + model = QuotasAssignRequest() + if include_optional: + return QuotasAssignRequest( + organizations = [{"value":12000},{"orgId":"315","value":10000}] + ) + else: + return QuotasAssignRequest( + ) + """ + + def testQuotasAssignRequest(self): + """Test QuotasAssignRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_quotas_assign_response.py b/usage_api/test/test_quotas_assign_response.py new file mode 100644 index 00000000..515587f7 --- /dev/null +++ b/usage_api/test/test_quotas_assign_response.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.quotas_assign_response import QuotasAssignResponse + +class TestQuotasAssignResponse(unittest.TestCase): + """QuotasAssignResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> QuotasAssignResponse: + """Test QuotasAssignResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `QuotasAssignResponse` + """ + model = QuotasAssignResponse() + if include_optional: + return QuotasAssignResponse( + organizations = [{"orgId":"100","value":12000},{"orgId":"315","value":10000}] + ) + else: + return QuotasAssignResponse( + ) + """ + + def testQuotasAssignResponse(self): + """Test QuotasAssignResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_quotas_quotas_inner.py b/usage_api/test/test_quotas_quotas_inner.py new file mode 100644 index 00000000..087d9eb2 --- /dev/null +++ b/usage_api/test/test_quotas_quotas_inner.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.quotas_quotas_inner import QuotasQuotasInner + +class TestQuotasQuotasInner(unittest.TestCase): + """QuotasQuotasInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> QuotasQuotasInner: + """Test QuotasQuotasInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `QuotasQuotasInner` + """ + model = QuotasQuotasInner() + if include_optional: + return QuotasQuotasInner( + organization_quota = usage_api.models.organization_quota.OrganizationQuota( + value = 22500, + org_id = '10', ), + account_group_quotas = [{"value":12000,"aid":"315"},{"value":10000,"aid":"1200"}] + ) + else: + return QuotasQuotasInner( + ) + """ + + def testQuotasQuotasInner(self): + """Test QuotasQuotasInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_quotas_unassign.py b/usage_api/test/test_quotas_unassign.py new file mode 100644 index 00000000..739a0717 --- /dev/null +++ b/usage_api/test/test_quotas_unassign.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.quotas_unassign import QuotasUnassign + +class TestQuotasUnassign(unittest.TestCase): + """QuotasUnassign unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> QuotasUnassign: + """Test QuotasUnassign + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `QuotasUnassign` + """ + model = QuotasUnassign() + if include_optional: + return QuotasUnassign( + organizations = ["100","315"] + ) + else: + return QuotasUnassign( + ) + """ + + def testQuotasUnassign(self): + """Test QuotasUnassign""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_self_links.py b/usage_api/test/test_self_links.py new file mode 100644 index 00000000..3093d651 --- /dev/null +++ b/usage_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = usage_api.models.self_links__links.SelfLinks__links( + self = usage_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_self_links_links.py b/usage_api/test/test_self_links_links.py new file mode 100644 index 00000000..cf9ed3b4 --- /dev/null +++ b/usage_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = usage_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_tests_inner.py b/usage_api/test/test_tests_inner.py new file mode 100644 index 00000000..7574e19e --- /dev/null +++ b/usage_api/test/test_tests_inner.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.tests_inner import TestsInner + +class TestTestsInner(unittest.TestCase): + """TestsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestsInner: + """Test TestsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestsInner` + """ + model = TestsInner() + if include_optional: + return TestsInner( + aid = None, + account_group_name = None, + test_id = '', + test_name = '', + test_type = '', + cloud_units_used = 56, + cloud_units_projected = 56 + ) + else: + return TestsInner( + ) + """ + + def testTestsInner(self): + """Test TestsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_unauthorized_error.py b/usage_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..713ba0bb --- /dev/null +++ b/usage_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_usage.py b/usage_api/test/test_usage.py new file mode 100644 index 00000000..02fc03d3 --- /dev/null +++ b/usage_api/test/test_usage.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.usage import Usage + +class TestUsage(unittest.TestCase): + """Usage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Usage: + """Test Usage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Usage` + """ + model = Usage() + if include_optional: + return Usage( + usage = usage_api.models.usage_usage.Usage_usage( + quota = usage_api.models.usage_usage_quota.Usage_usage_quota( + month_start = '2020-01-05T08:00Z', + month_end = '2020-02-05T08:00Z', + cloud_units_included = 4320000000, + endpoint_agents_included = 200, + endpoint_agents_essentials_included = 10, + endpoint_agents_embedded_included = 10, + enterprise_agents_included = 25, ), + cloud_units_used = 8500489, + cloud_units_projected = 20993812, + cloud_units_next_billing_period = 25123456, + enterprise_units_used = 79640902, + enterprise_units_projected = 108016317, + enterprise_units_next_billing_period = 0, + endpoint_agents_used = 42, + endpoint_agents_essentials_used = 5, + endpoint_agents_embedded_used = 5, + enterprise_agents_used = 58, + enterprise_agent_units = [ + [{"aid":"7625","agentId":"121404","accountGroupName":"Support","agentName":"TEVA-test-agent","enterpriseUnitsUsed":599878,"enterpriseUnitsProjected":597808,"vagentId":"123456"},{"aid":"315","agentId":"121404","accountGroupName":"Documentation","agentName":"lab-physical-appliance-1","enterpriseUnitsUsed":597123,"enterpriseUnitsProjected":597808,"vagentId":"789"}] + ], + tests = [{"aid":"315","testId":"1158","accountGroupName":"Documentation","testName":"https://app.thousandeyes.com","testType":"Web-Page Load","cloudUnitsUsed":14050,"cloudUnitsProjected":340674},{"aid":"315","testId":"1159","accountGroupName":"Documentation","testName":"https://support.thousandeyes.com","testType":"Web - HTTP Server","cloudUnitsUsed":64390,"cloudUnitsProjected":164457}], + endpoint_agents = [{"aid":"7625","accountGroupName":"Support","endpointAgentsUsed":22},{"aid":"315","accountGroupName":"Documentation","endpointAgentsUsed":14}], + endpoint_agents_essentials = [{"aid":"10","accountGroupName":"Support","endpointAgentsEssentialsUsed":2},{"aid":"100","accountGroupName":"Documentation","endpointAgentsEssentialsUsed":3}], + endpoint_agents_embedded = [{"aid":"10","accountGroupName":"Support","endpointAgentsEmbeddedUsed":2},{"aid":"100","accountGroupName":"Documentation","endpointAgentsEmbeddedUsed":3}], + enterprise_agents = [{"aid":"7625","accountGroupName":"Support","enterpriseAgentsUsed":7},{"aid":"315","accountGroupName":"Documentation","enterpriseAgentsUsed":1}], ) + ) + else: + return Usage( + ) + """ + + def testUsage(self): + """Test Usage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_usage_api.py b/usage_api/test/test_usage_api.py new file mode 100644 index 00000000..3a56a4b2 --- /dev/null +++ b/usage_api/test/test_usage_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest + +from usage_api.api.usage_api import UsageApi + + +class TestUsageApi(unittest.TestCase): + """UsageApi unit test stubs""" + + def setUp(self) -> None: + self.api = UsageApi() + + def tearDown(self) -> None: + pass + + def test_get_usage(self) -> None: + """Test case for get_usage + + Get usage information for the last month + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_usage_usage.py b/usage_api/test/test_usage_usage.py new file mode 100644 index 00000000..53945fb4 --- /dev/null +++ b/usage_api/test/test_usage_usage.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.usage_usage import UsageUsage + +class TestUsageUsage(unittest.TestCase): + """UsageUsage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UsageUsage: + """Test UsageUsage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UsageUsage` + """ + model = UsageUsage() + if include_optional: + return UsageUsage( + quota = usage_api.models.usage_usage_quota.Usage_usage_quota( + month_start = '2020-01-05T08:00Z', + month_end = '2020-02-05T08:00Z', + cloud_units_included = 4320000000, + endpoint_agents_included = 200, + endpoint_agents_essentials_included = 10, + endpoint_agents_embedded_included = 10, + enterprise_agents_included = 25, ), + cloud_units_used = 8500489, + cloud_units_projected = 20993812, + cloud_units_next_billing_period = 25123456, + enterprise_units_used = 79640902, + enterprise_units_projected = 108016317, + enterprise_units_next_billing_period = 0, + endpoint_agents_used = 42, + endpoint_agents_essentials_used = 5, + endpoint_agents_embedded_used = 5, + enterprise_agents_used = 58, + enterprise_agent_units = [ + [{"aid":"7625","agentId":"121404","accountGroupName":"Support","agentName":"TEVA-test-agent","enterpriseUnitsUsed":599878,"enterpriseUnitsProjected":597808,"vagentId":"123456"},{"aid":"315","agentId":"121404","accountGroupName":"Documentation","agentName":"lab-physical-appliance-1","enterpriseUnitsUsed":597123,"enterpriseUnitsProjected":597808,"vagentId":"789"}] + ], + tests = [{"aid":"315","testId":"1158","accountGroupName":"Documentation","testName":"https://app.thousandeyes.com","testType":"Web-Page Load","cloudUnitsUsed":14050,"cloudUnitsProjected":340674},{"aid":"315","testId":"1159","accountGroupName":"Documentation","testName":"https://support.thousandeyes.com","testType":"Web - HTTP Server","cloudUnitsUsed":64390,"cloudUnitsProjected":164457}], + endpoint_agents = [{"aid":"7625","accountGroupName":"Support","endpointAgentsUsed":22},{"aid":"315","accountGroupName":"Documentation","endpointAgentsUsed":14}], + endpoint_agents_essentials = [{"aid":"10","accountGroupName":"Support","endpointAgentsEssentialsUsed":2},{"aid":"100","accountGroupName":"Documentation","endpointAgentsEssentialsUsed":3}], + endpoint_agents_embedded = [{"aid":"10","accountGroupName":"Support","endpointAgentsEmbeddedUsed":2},{"aid":"100","accountGroupName":"Documentation","endpointAgentsEmbeddedUsed":3}], + enterprise_agents = [{"aid":"7625","accountGroupName":"Support","enterpriseAgentsUsed":7},{"aid":"315","accountGroupName":"Documentation","enterpriseAgentsUsed":1}] + ) + else: + return UsageUsage( + ) + """ + + def testUsageUsage(self): + """Test UsageUsage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/test/test_usage_usage_quota.py b/usage_api/test/test_usage_usage_quota.py new file mode 100644 index 00000000..1825e2c7 --- /dev/null +++ b/usage_api/test/test_usage_usage_quota.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 unittest +import datetime + +from usage_api.models.usage_usage_quota import UsageUsageQuota + +class TestUsageUsageQuota(unittest.TestCase): + """UsageUsageQuota unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UsageUsageQuota: + """Test UsageUsageQuota + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UsageUsageQuota` + """ + model = UsageUsageQuota() + if include_optional: + return UsageUsageQuota( + month_start = '2020-01-05T08:00Z', + month_end = '2020-02-05T08:00Z', + cloud_units_included = 4320000000, + endpoint_agents_included = 200, + endpoint_agents_essentials_included = 10, + endpoint_agents_embedded_included = 10, + enterprise_agents_included = 25 + ) + else: + return UsageUsageQuota( + ) + """ + + def testUsageUsageQuota(self): + """Test UsageUsageQuota""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/usage_api/tox.ini b/usage_api/tox.ini new file mode 100644 index 00000000..40abcf3d --- /dev/null +++ b/usage_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=usage_api diff --git a/usage_api/usage_api/__init__.py b/usage_api/usage_api/__init__.py new file mode 100644 index 00000000..b5392efa --- /dev/null +++ b/usage_api/usage_api/__init__.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.api.quotas_api import QuotasApi +from usage_api.api.usage_api import UsageApi + +# import ApiClient +from usage_api.api_response import ApiResponse +from usage_api.api_client import ApiClient +from usage_api.configuration import Configuration +from usage_api.exceptions import OpenApiException +from usage_api.exceptions import ApiTypeError +from usage_api.exceptions import ApiValueError +from usage_api.exceptions import ApiKeyError +from usage_api.exceptions import ApiAttributeError +from usage_api.exceptions import ApiException + +# import models into sdk package +from usage_api.models.account_group import AccountGroup +from usage_api.models.account_group_id import AccountGroupId +from usage_api.models.account_group_quota import AccountGroupQuota +from usage_api.models.endpoint_agents_embedded_inner import EndpointAgentsEmbeddedInner +from usage_api.models.endpoint_agents_essentials_inner import EndpointAgentsEssentialsInner +from usage_api.models.endpoint_agents_inner import EndpointAgentsInner +from usage_api.models.enterprise_agent_units_inner import EnterpriseAgentUnitsInner +from usage_api.models.enterprise_agents_inner import EnterpriseAgentsInner +from usage_api.models.error import Error +from usage_api.models.expand import Expand +from usage_api.models.get_quotas200_response import GetQuotas200Response +from usage_api.models.get_usage200_response import GetUsage200Response +from usage_api.models.link import Link +from usage_api.models.organization_quota import OrganizationQuota +from usage_api.models.organizations_quotas_assign import OrganizationsQuotasAssign +from usage_api.models.organizations_quotas_assign_organizations_inner import OrganizationsQuotasAssignOrganizationsInner +from usage_api.models.organizations_quotas_unassign import OrganizationsQuotasUnassign +from usage_api.models.organizations_quotas_unassign_organizations_inner import OrganizationsQuotasUnassignOrganizationsInner +from usage_api.models.quotas import Quotas +from usage_api.models.quotas_assign_request import QuotasAssignRequest +from usage_api.models.quotas_assign_response import QuotasAssignResponse +from usage_api.models.quotas_quotas_inner import QuotasQuotasInner +from usage_api.models.quotas_unassign import QuotasUnassign +from usage_api.models.self_links import SelfLinks +from usage_api.models.self_links_links import SelfLinksLinks +from usage_api.models.tests_inner import TestsInner +from usage_api.models.unauthorized_error import UnauthorizedError +from usage_api.models.usage import Usage +from usage_api.models.usage_usage import UsageUsage +from usage_api.models.usage_usage_quota import UsageUsageQuota diff --git a/usage_api/usage_api/api/__init__.py b/usage_api/usage_api/api/__init__.py new file mode 100644 index 00000000..523c0d03 --- /dev/null +++ b/usage_api/usage_api/api/__init__.py @@ -0,0 +1,6 @@ +# flake8: noqa + +# import apis into api package +from usage_api.api.quotas_api import QuotasApi +from usage_api.api.usage_api import UsageApi + diff --git a/usage_api/usage_api/api/quotas_api.py b/usage_api/usage_api/api/quotas_api.py new file mode 100644 index 00000000..0dddf264 --- /dev/null +++ b/usage_api/usage_api/api/quotas_api.py @@ -0,0 +1,1522 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.models.get_quotas200_response import GetQuotas200Response +from usage_api.models.organizations_quotas_assign import OrganizationsQuotasAssign +from usage_api.models.organizations_quotas_unassign import OrganizationsQuotasUnassign +from usage_api.models.quotas_assign_request import QuotasAssignRequest +from usage_api.models.quotas_assign_response import QuotasAssignResponse +from usage_api.models.quotas_unassign import QuotasUnassign + +from usage_api.api_client import ApiClient +from usage_api.api_response import ApiResponse +from usage_api.rest import RESTResponseType + + +class QuotasApi: + """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_organizations_account_groups_quotas( + 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, + organizations_quotas_assign: Optional[OrganizationsQuotasAssign] = 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, + ) -> OrganizationsQuotasAssign: + """Create or update accout group quotas + + Assigns quota values to multiple account groups from multiple organizations. `Edit organization and account group quotas` permission (a management permission) is required. This endpoint has cumulative behavior: The quotas are assigned to the specified account groups, and the previous assignments persist. No unassignment takes place. This endpoint assigns quota values to multiple account groups across multiple organizations. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. This endpoint follows a cumulative behavior––This means that the quotas are assigned to the designated account groups, and any previous assignments remain in place without any unassignment occurring. + + :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 organizations_quotas_assign: + :type organizations_quotas_assign: OrganizationsQuotasAssign + :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_organizations_account_groups_quotas_serialize( + aid=aid, + organizations_quotas_assign=organizations_quotas_assign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "OrganizationsQuotasAssign", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_organizations_account_groups_quotas_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, + organizations_quotas_assign: Optional[OrganizationsQuotasAssign] = 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[OrganizationsQuotasAssign]: + """Create or update accout group quotas + + Assigns quota values to multiple account groups from multiple organizations. `Edit organization and account group quotas` permission (a management permission) is required. This endpoint has cumulative behavior: The quotas are assigned to the specified account groups, and the previous assignments persist. No unassignment takes place. This endpoint assigns quota values to multiple account groups across multiple organizations. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. This endpoint follows a cumulative behavior––This means that the quotas are assigned to the designated account groups, and any previous assignments remain in place without any unassignment occurring. + + :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 organizations_quotas_assign: + :type organizations_quotas_assign: OrganizationsQuotasAssign + :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_organizations_account_groups_quotas_serialize( + aid=aid, + organizations_quotas_assign=organizations_quotas_assign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "OrganizationsQuotasAssign", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_organizations_account_groups_quotas_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, + organizations_quotas_assign: Optional[OrganizationsQuotasAssign] = 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: + """Create or update accout group quotas + + Assigns quota values to multiple account groups from multiple organizations. `Edit organization and account group quotas` permission (a management permission) is required. This endpoint has cumulative behavior: The quotas are assigned to the specified account groups, and the previous assignments persist. No unassignment takes place. This endpoint assigns quota values to multiple account groups across multiple organizations. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. This endpoint follows a cumulative behavior––This means that the quotas are assigned to the designated account groups, and any previous assignments remain in place without any unassignment occurring. + + :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 organizations_quotas_assign: + :type organizations_quotas_assign: OrganizationsQuotasAssign + :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_organizations_account_groups_quotas_serialize( + aid=aid, + organizations_quotas_assign=organizations_quotas_assign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "OrganizationsQuotasAssign", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _assign_organizations_account_groups_quotas_serialize( + self, + aid, + organizations_quotas_assign, + _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 + if organizations_quotas_assign is not None: + _body_params = organizations_quotas_assign + + + # 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/quotas/account-groups/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 assign_organizations_quotas( + 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, + quotas_assign_request: Optional[QuotasAssignRequest] = 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, + ) -> QuotasAssignResponse: + """Create or update organizations quotas + + This endpoint recieves a list of organization quotas to create or update. If there's no specific `orgId` defined for a quota, it defaults to using the authenticated organization. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. This endpoint follows cumulative behavior––This means that the quotas are assigned to the specified organizations, and any previous assignments remain unchanged; no unassignments occur. + + :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 quotas_assign_request: + :type quotas_assign_request: QuotasAssignRequest + :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_organizations_quotas_serialize( + aid=aid, + quotas_assign_request=quotas_assign_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "QuotasAssignResponse", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_organizations_quotas_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, + quotas_assign_request: Optional[QuotasAssignRequest] = 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[QuotasAssignResponse]: + """Create or update organizations quotas + + This endpoint recieves a list of organization quotas to create or update. If there's no specific `orgId` defined for a quota, it defaults to using the authenticated organization. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. This endpoint follows cumulative behavior––This means that the quotas are assigned to the specified organizations, and any previous assignments remain unchanged; no unassignments occur. + + :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 quotas_assign_request: + :type quotas_assign_request: QuotasAssignRequest + :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_organizations_quotas_serialize( + aid=aid, + quotas_assign_request=quotas_assign_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "QuotasAssignResponse", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_organizations_quotas_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, + quotas_assign_request: Optional[QuotasAssignRequest] = 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: + """Create or update organizations quotas + + This endpoint recieves a list of organization quotas to create or update. If there's no specific `orgId` defined for a quota, it defaults to using the authenticated organization. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. This endpoint follows cumulative behavior––This means that the quotas are assigned to the specified organizations, and any previous assignments remain unchanged; no unassignments occur. + + :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 quotas_assign_request: + :type quotas_assign_request: QuotasAssignRequest + :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_organizations_quotas_serialize( + aid=aid, + quotas_assign_request=quotas_assign_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "QuotasAssignResponse", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _assign_organizations_quotas_serialize( + self, + aid, + quotas_assign_request, + _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 + if quotas_assign_request is not None: + _body_params = quotas_assign_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/quotas/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 get_quotas( + self, + _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, + ) -> GetQuotas200Response: + """Get organization and account group usage quota + + This endpoint retrieves usage quotas for both organization and account groups. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. If a user has quota update permission in multiple organizations, the API returns data from all such organizations. + + :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_quotas_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetQuotas200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_quotas_with_http_info( + self, + _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[GetQuotas200Response]: + """Get organization and account group usage quota + + This endpoint retrieves usage quotas for both organization and account groups. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. If a user has quota update permission in multiple organizations, the API returns data from all such organizations. + + :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_quotas_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetQuotas200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_quotas_without_preload_content( + self, + _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: + """Get organization and account group usage quota + + This endpoint retrieves usage quotas for both organization and account groups. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. If a user has quota update permission in multiple organizations, the API returns data from all such organizations. + + :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_quotas_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetQuotas200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_quotas_serialize( + self, + _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 + # 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/quotas', + 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_organizations_account_groups_quotas( + 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, + organizations_quotas_unassign: Optional[OrganizationsQuotasUnassign] = 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, + ) -> None: + """Remove account group quotas from organizations + + Removes the quotas from multiple account groups from multiple organizations. `Edit organization and account group quotas` permission (a management permission) is required. Removes quotas from multiple account groups across multiple organizations. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. + + :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 organizations_quotas_unassign: + :type organizations_quotas_unassign: OrganizationsQuotasUnassign + :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_organizations_account_groups_quotas_serialize( + aid=aid, + organizations_quotas_unassign=organizations_quotas_unassign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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_organizations_account_groups_quotas_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, + organizations_quotas_unassign: Optional[OrganizationsQuotasUnassign] = 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[None]: + """Remove account group quotas from organizations + + Removes the quotas from multiple account groups from multiple organizations. `Edit organization and account group quotas` permission (a management permission) is required. Removes quotas from multiple account groups across multiple organizations. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. + + :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 organizations_quotas_unassign: + :type organizations_quotas_unassign: OrganizationsQuotasUnassign + :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_organizations_account_groups_quotas_serialize( + aid=aid, + organizations_quotas_unassign=organizations_quotas_unassign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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_organizations_account_groups_quotas_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, + organizations_quotas_unassign: Optional[OrganizationsQuotasUnassign] = 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 account group quotas from organizations + + Removes the quotas from multiple account groups from multiple organizations. `Edit organization and account group quotas` permission (a management permission) is required. Removes quotas from multiple account groups across multiple organizations. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. + + :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 organizations_quotas_unassign: + :type organizations_quotas_unassign: OrganizationsQuotasUnassign + :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_organizations_account_groups_quotas_serialize( + aid=aid, + organizations_quotas_unassign=organizations_quotas_unassign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unassign_organizations_account_groups_quotas_serialize( + self, + aid, + organizations_quotas_unassign, + _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 + if organizations_quotas_unassign is not None: + _body_params = organizations_quotas_unassign + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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/quotas/account-groups/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 + ) + + + + + @validate_call + def unassign_organizations_quotas( + 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, + quotas_unassign: Optional[QuotasUnassign] = 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, + ) -> None: + """Remove organization quotas + + This endpoint recieves a list of organization IDs to remove their current quota. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. + + :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 quotas_unassign: + :type quotas_unassign: QuotasUnassign + :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_organizations_quotas_serialize( + aid=aid, + quotas_unassign=quotas_unassign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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_organizations_quotas_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, + quotas_unassign: Optional[QuotasUnassign] = 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[None]: + """Remove organization quotas + + This endpoint recieves a list of organization IDs to remove their current quota. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. + + :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 quotas_unassign: + :type quotas_unassign: QuotasUnassign + :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_organizations_quotas_serialize( + aid=aid, + quotas_unassign=quotas_unassign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + 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_organizations_quotas_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, + quotas_unassign: Optional[QuotasUnassign] = 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 organization quotas + + This endpoint recieves a list of organization IDs to remove their current quota. To use this endpoint, you need the `Edit organization and account group quotas` permission, which is a management-level permission. + + :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 quotas_unassign: + :type quotas_unassign: QuotasUnassign + :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_organizations_quotas_serialize( + aid=aid, + quotas_unassign=quotas_unassign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unassign_organizations_quotas_serialize( + self, + aid, + quotas_unassign, + _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 + if quotas_unassign is not None: + _body_params = quotas_unassign + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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/quotas/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 + ) + + diff --git a/usage_api/usage_api/api/usage_api.py b/usage_api/usage_api/api/usage_api.py new file mode 100644 index 00000000..6a484f0a --- /dev/null +++ b/usage_api/usage_api/api/usage_api.py @@ -0,0 +1,351 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.models.expand import Expand +from usage_api.models.get_usage200_response import GetUsage200Response + +from usage_api.api_client import ApiClient +from usage_api.api_response import ApiResponse +from usage_api.rest import RESTResponseType + + +class UsageApi: + """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_usage( + 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, + expand: Annotated[Optional[List[Expand]], Field(description="Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'.")] = 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, + ) -> GetUsage200Response: + """Get usage information for the last month + + This endpoint returns the organization's usage data for a specified time period. If no time period is specified, it defaults to the last month. + + :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: Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'. + :type expand: List[Expand] + :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_usage_serialize( + 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': "GetUsage200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_usage_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, + expand: Annotated[Optional[List[Expand]], Field(description="Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'.")] = 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[GetUsage200Response]: + """Get usage information for the last month + + This endpoint returns the organization's usage data for a specified time period. If no time period is specified, it defaults to the last month. + + :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: Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'. + :type expand: List[Expand] + :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_usage_serialize( + 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': "GetUsage200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "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_usage_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, + expand: Annotated[Optional[List[Expand]], Field(description="Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'.")] = 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: + """Get usage information for the last month + + This endpoint returns the organization's usage data for a specified time period. If no time period is specified, it defaults to the last month. + + :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: Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'. + :type expand: List[Expand] + :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_usage_serialize( + 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': "GetUsage200Response", + '400': "Error", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_usage_serialize( + self, + 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 + # 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 + + + # 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/usage', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/usage_api/usage_api/api_client.py b/usage_api/usage_api/api_client.py new file mode 100644 index 00000000..b74be28c --- /dev/null +++ b/usage_api/usage_api/api_client.py @@ -0,0 +1,741 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.configuration import Configuration +from usage_api.api_response import ApiResponse +import usage_api.models +from usage_api import rest +from usage_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(usage_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) diff --git a/usage_api/usage_api/api_response.py b/usage_api/usage_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/usage_api/usage_api/api_response.py @@ -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 + } diff --git a/usage_api/usage_api/configuration.py b/usage_api/usage_api/configuration.py new file mode 100644 index 00000000..b7c7d495 --- /dev/null +++ b/usage_api/usage_api/configuration.py @@ -0,0 +1,434 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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("usage_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 diff --git a/usage_api/usage_api/exceptions.py b/usage_api/usage_api/exceptions.py new file mode 100644 index 00000000..17b26bf6 --- /dev/null +++ b/usage_api/usage_api/exceptions.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 diff --git a/usage_api/usage_api/models/__init__.py b/usage_api/usage_api/models/__init__.py new file mode 100644 index 00000000..87ccb3aa --- /dev/null +++ b/usage_api/usage_api/models/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +# flake8: noqa +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.models.account_group import AccountGroup +from usage_api.models.account_group_id import AccountGroupId +from usage_api.models.account_group_quota import AccountGroupQuota +from usage_api.models.endpoint_agents_embedded_inner import EndpointAgentsEmbeddedInner +from usage_api.models.endpoint_agents_essentials_inner import EndpointAgentsEssentialsInner +from usage_api.models.endpoint_agents_inner import EndpointAgentsInner +from usage_api.models.enterprise_agent_units_inner import EnterpriseAgentUnitsInner +from usage_api.models.enterprise_agents_inner import EnterpriseAgentsInner +from usage_api.models.error import Error +from usage_api.models.expand import Expand +from usage_api.models.get_quotas200_response import GetQuotas200Response +from usage_api.models.get_usage200_response import GetUsage200Response +from usage_api.models.link import Link +from usage_api.models.organization_quota import OrganizationQuota +from usage_api.models.organizations_quotas_assign import OrganizationsQuotasAssign +from usage_api.models.organizations_quotas_assign_organizations_inner import OrganizationsQuotasAssignOrganizationsInner +from usage_api.models.organizations_quotas_unassign import OrganizationsQuotasUnassign +from usage_api.models.organizations_quotas_unassign_organizations_inner import OrganizationsQuotasUnassignOrganizationsInner +from usage_api.models.quotas import Quotas +from usage_api.models.quotas_assign_request import QuotasAssignRequest +from usage_api.models.quotas_assign_response import QuotasAssignResponse +from usage_api.models.quotas_quotas_inner import QuotasQuotasInner +from usage_api.models.quotas_unassign import QuotasUnassign +from usage_api.models.self_links import SelfLinks +from usage_api.models.self_links_links import SelfLinksLinks +from usage_api.models.tests_inner import TestsInner +from usage_api.models.unauthorized_error import UnauthorizedError +from usage_api.models.usage import Usage +from usage_api.models.usage_usage import UsageUsage +from usage_api.models.usage_usage_quota import UsageUsageQuota diff --git a/usage_api/usage_api/models/account_group.py b/usage_api/usage_api/models/account_group.py new file mode 100644 index 00000000..14f5e85f --- /dev/null +++ b/usage_api/usage_api/models/account_group.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 + + diff --git a/usage_api/usage_api/models/account_group_id.py b/usage_api/usage_api/models/account_group_id.py new file mode 100644 index 00000000..5e8a02bb --- /dev/null +++ b/usage_api/usage_api/models/account_group_id.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 + + diff --git a/usage_api/usage_api/models/account_group_quota.py b/usage_api/usage_api/models/account_group_quota.py new file mode 100644 index 00000000..b01431e1 --- /dev/null +++ b/usage_api/usage_api/models/account_group_quota.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 AccountGroupQuota(BaseModel): + """ + AccountGroupQuota + """ # noqa: E501 + value: Optional[StrictInt] = Field(default=None, description="Value of the quota for the given Account Group.") + aid: Optional[StrictStr] = Field(default=None, description="Unique ID of the account group.") + __properties: ClassVar[List[str]] = ["value", "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 AccountGroupQuota 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 AccountGroupQuota from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value"), + "aid": obj.get("aid") + }) + return _obj + + diff --git a/usage_api/usage_api/models/endpoint_agents_embedded_inner.py b/usage_api/usage_api/models/endpoint_agents_embedded_inner.py new file mode 100644 index 00000000..f706c859 --- /dev/null +++ b/usage_api/usage_api/models/endpoint_agents_embedded_inner.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentsEmbeddedInner(BaseModel): + """ + EndpointAgentsEmbeddedInner + """ # noqa: E501 + aid: Optional[Any] = Field(default=None, description="Unique identifier of the account group that owns the embedded endpoint agents.") + account_group_name: Optional[Any] = Field(default=None, description="Name of the account group that owns the embedded endpoint agents.", alias="accountGroupName") + endpoint_agents_embedded_used: Optional[StrictInt] = Field(default=None, description="Number of endpoint agents embedded owned by the specific account group in the usage period.", alias="endpointAgentsEmbeddedUsed") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "endpointAgentsEmbeddedUsed"] + + 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 EndpointAgentsEmbeddedInner 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, + ) + # set to None if aid (nullable) is None + # and model_fields_set contains the field + if self.aid is None and "aid" in self.model_fields_set: + _dict['aid'] = None + + # set to None if account_group_name (nullable) is None + # and model_fields_set contains the field + if self.account_group_name is None and "account_group_name" in self.model_fields_set: + _dict['accountGroupName'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgentsEmbeddedInner 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"), + "endpointAgentsEmbeddedUsed": obj.get("endpointAgentsEmbeddedUsed") + }) + return _obj + + diff --git a/usage_api/usage_api/models/endpoint_agents_essentials_inner.py b/usage_api/usage_api/models/endpoint_agents_essentials_inner.py new file mode 100644 index 00000000..dec89db9 --- /dev/null +++ b/usage_api/usage_api/models/endpoint_agents_essentials_inner.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentsEssentialsInner(BaseModel): + """ + EndpointAgentsEssentialsInner + """ # noqa: E501 + aid: Optional[Any] = Field(default=None, description="Unique identifier of the account group owning the endpoint agents essentials.") + account_group_name: Optional[Any] = Field(default=None, description="Name of the account group which owns the endpoint agents essentials.", alias="accountGroupName") + endpoint_agents_essentials_used: Optional[StrictInt] = Field(default=None, description="Number of endpoint agents essentials owned by the specific account group in the usage period.", alias="endpointAgentsEssentialsUsed") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "endpointAgentsEssentialsUsed"] + + 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 EndpointAgentsEssentialsInner 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, + ) + # set to None if aid (nullable) is None + # and model_fields_set contains the field + if self.aid is None and "aid" in self.model_fields_set: + _dict['aid'] = None + + # set to None if account_group_name (nullable) is None + # and model_fields_set contains the field + if self.account_group_name is None and "account_group_name" in self.model_fields_set: + _dict['accountGroupName'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgentsEssentialsInner 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"), + "endpointAgentsEssentialsUsed": obj.get("endpointAgentsEssentialsUsed") + }) + return _obj + + diff --git a/usage_api/usage_api/models/endpoint_agents_inner.py b/usage_api/usage_api/models/endpoint_agents_inner.py new file mode 100644 index 00000000..bca2f152 --- /dev/null +++ b/usage_api/usage_api/models/endpoint_agents_inner.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EndpointAgentsInner(BaseModel): + """ + EndpointAgentsInner + """ # noqa: E501 + aid: Optional[Any] = Field(default=None, description="Unique identifier of the account group owning the endpoint agents.") + account_group_name: Optional[Any] = Field(default=None, description="Name of the account group which owns the endpoint agents.", alias="accountGroupName") + endpoint_agents_used: Optional[StrictInt] = Field(default=None, description="Number of endpoint agents owned by the specific account group in the usage period.", alias="endpointAgentsUsed") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "endpointAgentsUsed"] + + 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 EndpointAgentsInner 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, + ) + # set to None if aid (nullable) is None + # and model_fields_set contains the field + if self.aid is None and "aid" in self.model_fields_set: + _dict['aid'] = None + + # set to None if account_group_name (nullable) is None + # and model_fields_set contains the field + if self.account_group_name is None and "account_group_name" in self.model_fields_set: + _dict['accountGroupName'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EndpointAgentsInner 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"), + "endpointAgentsUsed": obj.get("endpointAgentsUsed") + }) + return _obj + + diff --git a/usage_api/usage_api/models/enterprise_agent_units_inner.py b/usage_api/usage_api/models/enterprise_agent_units_inner.py new file mode 100644 index 00000000..743d8308 --- /dev/null +++ b/usage_api/usage_api/models/enterprise_agent_units_inner.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 EnterpriseAgentUnitsInner(BaseModel): + """ + EnterpriseAgentUnitsInner + """ # noqa: E501 + aid: Optional[Any] = Field(default=None, description="Unique identifier of the account group owning the enterprise agent units.") + account_group_name: Optional[Any] = Field(default=None, description="Name of the account group which owns the enterprise agent units.", alias="accountGroupName") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the enterprise agent generating usage.", alias="agentId") + agent_name: Optional[StrictStr] = Field(default=None, description="Name of the enterprise agent generating usage.", alias="agentName") + enterprise_units_used: Optional[StrictInt] = Field(default=None, description="Number of enterprise agent units owned by the specific account group in the usage period.", alias="enterpriseUnitsUsed") + enterprise_units_projected: Optional[StrictInt] = Field(default=None, description="Number of enterprise units projected in the current usage period, based on units consumed to date and configuration of enabled tests. This value is updated hourly. Returns non-zero value only for organizations with metered billing.", alias="enterpriseUnitsProjected") + vagent_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the virtual agent generating usage", alias="vagentId") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "agentId", "agentName", "enterpriseUnitsUsed", "enterpriseUnitsProjected", "vagentId"] + + 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 EnterpriseAgentUnitsInner 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, + ) + # set to None if aid (nullable) is None + # and model_fields_set contains the field + if self.aid is None and "aid" in self.model_fields_set: + _dict['aid'] = None + + # set to None if account_group_name (nullable) is None + # and model_fields_set contains the field + if self.account_group_name is None and "account_group_name" in self.model_fields_set: + _dict['accountGroupName'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EnterpriseAgentUnitsInner 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"), + "agentId": obj.get("agentId"), + "agentName": obj.get("agentName"), + "enterpriseUnitsUsed": obj.get("enterpriseUnitsUsed"), + "enterpriseUnitsProjected": obj.get("enterpriseUnitsProjected"), + "vagentId": obj.get("vagentId") + }) + return _obj + + diff --git a/usage_api/usage_api/models/enterprise_agents_inner.py b/usage_api/usage_api/models/enterprise_agents_inner.py new file mode 100644 index 00000000..9d1e0eb4 --- /dev/null +++ b/usage_api/usage_api/models/enterprise_agents_inner.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EnterpriseAgentsInner(BaseModel): + """ + EnterpriseAgentsInner + """ # noqa: E501 + aid: Optional[Any] = Field(default=None, description="A unique identifier that specifies the account group that owns the enterprise agents.") + account_group_name: Optional[Any] = Field(default=None, description="Name of the account group which owns the enterprise agents.", alias="accountGroupName") + enterprise_agents_used: Optional[StrictInt] = Field(default=None, description="Number of enterprise agents owned by the specific account group in the usage period.", alias="enterpriseAgentsUsed") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "enterpriseAgentsUsed"] + + 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 EnterpriseAgentsInner 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, + ) + # set to None if aid (nullable) is None + # and model_fields_set contains the field + if self.aid is None and "aid" in self.model_fields_set: + _dict['aid'] = None + + # set to None if account_group_name (nullable) is None + # and model_fields_set contains the field + if self.account_group_name is None and "account_group_name" in self.model_fields_set: + _dict['accountGroupName'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EnterpriseAgentsInner 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"), + "enterpriseAgentsUsed": obj.get("enterpriseAgentsUsed") + }) + return _obj + + diff --git a/usage_api/usage_api/models/error.py b/usage_api/usage_api/models/error.py new file mode 100644 index 00000000..1fec5c73 --- /dev/null +++ b/usage_api/usage_api/models/error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 + + diff --git a/usage_api/usage_api/models/expand.py b/usage_api/usage_api/models/expand.py new file mode 100644 index 00000000..17494331 --- /dev/null +++ b/usage_api/usage_api/models/expand.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 Expand(str, Enum): + """ + Expand + """ + + """ + allowed enum values + """ + TEST = 'test' + ENTERPRISE_MINUS_AGENT = 'enterprise-agent' + ENTERPRISE_MINUS_AGENT_MINUS_UNIT = 'enterprise-agent-unit' + ENDPOINT_MINUS_AGENT = 'endpoint-agent' + ENDPOINT_MINUS_AGENT_MINUS_ESSENTIAL = 'endpoint-agent-essential' + ENDPOINT_MINUS_AGENT_MINUS_EMBEDDED = 'endpoint-agent-embedded' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Expand from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/usage_api/usage_api/models/get_quotas200_response.py b/usage_api/usage_api/models/get_quotas200_response.py new file mode 100644 index 00000000..79fe0c3e --- /dev/null +++ b/usage_api/usage_api/models/get_quotas200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.models.quotas_quotas_inner import QuotasQuotasInner +from usage_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetQuotas200Response(BaseModel): + """ + GetQuotas200Response + """ # noqa: E501 + quotas: Optional[List[QuotasQuotasInner]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["quotas", "_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 GetQuotas200Response 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 quotas (list) + _items = [] + if self.quotas: + for _item in self.quotas: + if _item: + _items.append(_item.to_dict()) + _dict['quotas'] = _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 GetQuotas200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "quotas": [QuotasQuotasInner.from_dict(_item) for _item in obj.get("quotas")] if obj.get("quotas") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/usage_api/usage_api/models/get_usage200_response.py b/usage_api/usage_api/models/get_usage200_response.py new file mode 100644 index 00000000..d9eadaac --- /dev/null +++ b/usage_api/usage_api/models/get_usage200_response.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.models.self_links_links import SelfLinksLinks +from usage_api.models.usage_usage import UsageUsage +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetUsage200Response(BaseModel): + """ + GetUsage200Response + """ # noqa: E501 + usage: Optional[UsageUsage] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["usage", "_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 GetUsage200Response 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 usage + if self.usage: + _dict['usage'] = self.usage.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 GetUsage200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "usage": UsageUsage.from_dict(obj.get("usage")) if obj.get("usage") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/usage_api/usage_api/models/link.py b/usage_api/usage_api/models/link.py new file mode 100644 index 00000000..b85e2c17 --- /dev/null +++ b/usage_api/usage_api/models/link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 + + diff --git a/usage_api/usage_api/models/organization_quota.py b/usage_api/usage_api/models/organization_quota.py new file mode 100644 index 00000000..3027d146 --- /dev/null +++ b/usage_api/usage_api/models/organization_quota.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 OrganizationQuota(BaseModel): + """ + OrganizationQuota + """ # noqa: E501 + value: StrictInt = Field(description="Value of the quota for the given Organization.") + org_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the organization.", alias="orgId") + __properties: ClassVar[List[str]] = ["value", "orgId"] + + 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 OrganizationQuota 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 OrganizationQuota from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value"), + "orgId": obj.get("orgId") + }) + return _obj + + diff --git a/usage_api/usage_api/models/organizations_quotas_assign.py b/usage_api/usage_api/models/organizations_quotas_assign.py new file mode 100644 index 00000000..a251b7e3 --- /dev/null +++ b/usage_api/usage_api/models/organizations_quotas_assign.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.models.organizations_quotas_assign_organizations_inner import OrganizationsQuotasAssignOrganizationsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class OrganizationsQuotasAssign(BaseModel): + """ + OrganizationsQuotasAssign + """ # noqa: E501 + organizations: Optional[List[OrganizationsQuotasAssignOrganizationsInner]] = None + __properties: ClassVar[List[str]] = ["organizations"] + + 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 OrganizationsQuotasAssign 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 organizations (list) + _items = [] + if self.organizations: + for _item in self.organizations: + if _item: + _items.append(_item.to_dict()) + _dict['organizations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of OrganizationsQuotasAssign from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "organizations": [OrganizationsQuotasAssignOrganizationsInner.from_dict(_item) for _item in obj.get("organizations")] if obj.get("organizations") is not None else None + }) + return _obj + + diff --git a/usage_api/usage_api/models/organizations_quotas_assign_organizations_inner.py b/usage_api/usage_api/models/organizations_quotas_assign_organizations_inner.py new file mode 100644 index 00000000..d20ce46a --- /dev/null +++ b/usage_api/usage_api/models/organizations_quotas_assign_organizations_inner.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.models.account_group_quota import AccountGroupQuota +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class OrganizationsQuotasAssignOrganizationsInner(BaseModel): + """ + OrganizationsQuotasAssignOrganizationsInner + """ # noqa: E501 + org_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the organization.", alias="orgId") + account_groups: Optional[List[AccountGroupQuota]] = Field(default=None, description="List of account groups quotas.", alias="accountGroups") + __properties: ClassVar[List[str]] = ["orgId", "accountGroups"] + + 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 OrganizationsQuotasAssignOrganizationsInner 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 account_groups (list) + _items = [] + if self.account_groups: + for _item in self.account_groups: + if _item: + _items.append(_item.to_dict()) + _dict['accountGroups'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of OrganizationsQuotasAssignOrganizationsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "orgId": obj.get("orgId"), + "accountGroups": [AccountGroupQuota.from_dict(_item) for _item in obj.get("accountGroups")] if obj.get("accountGroups") is not None else None + }) + return _obj + + diff --git a/usage_api/usage_api/models/organizations_quotas_unassign.py b/usage_api/usage_api/models/organizations_quotas_unassign.py new file mode 100644 index 00000000..e217e151 --- /dev/null +++ b/usage_api/usage_api/models/organizations_quotas_unassign.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.models.organizations_quotas_unassign_organizations_inner import OrganizationsQuotasUnassignOrganizationsInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class OrganizationsQuotasUnassign(BaseModel): + """ + OrganizationsQuotasUnassign + """ # noqa: E501 + organizations: Optional[List[OrganizationsQuotasUnassignOrganizationsInner]] = None + __properties: ClassVar[List[str]] = ["organizations"] + + 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 OrganizationsQuotasUnassign 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 organizations (list) + _items = [] + if self.organizations: + for _item in self.organizations: + if _item: + _items.append(_item.to_dict()) + _dict['organizations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of OrganizationsQuotasUnassign from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "organizations": [OrganizationsQuotasUnassignOrganizationsInner.from_dict(_item) for _item in obj.get("organizations")] if obj.get("organizations") is not None else None + }) + return _obj + + diff --git a/usage_api/usage_api/models/organizations_quotas_unassign_organizations_inner.py b/usage_api/usage_api/models/organizations_quotas_unassign_organizations_inner.py new file mode 100644 index 00000000..d7c0606b --- /dev/null +++ b/usage_api/usage_api/models/organizations_quotas_unassign_organizations_inner.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 OrganizationsQuotasUnassignOrganizationsInner(BaseModel): + """ + OrganizationsQuotasUnassignOrganizationsInner + """ # noqa: E501 + org_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the organization.", alias="orgId") + account_groups: Optional[List[StrictStr]] = Field(default=None, description="List of account group IDs.", alias="accountGroups") + __properties: ClassVar[List[str]] = ["orgId", "accountGroups"] + + 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 OrganizationsQuotasUnassignOrganizationsInner 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 OrganizationsQuotasUnassignOrganizationsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "orgId": obj.get("orgId"), + "accountGroups": obj.get("accountGroups") + }) + return _obj + + diff --git a/usage_api/usage_api/models/quotas.py b/usage_api/usage_api/models/quotas.py new file mode 100644 index 00000000..d9d9a4d6 --- /dev/null +++ b/usage_api/usage_api/models/quotas.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.models.quotas_quotas_inner import QuotasQuotasInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Quotas(BaseModel): + """ + Quotas + """ # noqa: E501 + quotas: Optional[List[QuotasQuotasInner]] = None + __properties: ClassVar[List[str]] = ["quotas"] + + 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 Quotas 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 quotas (list) + _items = [] + if self.quotas: + for _item in self.quotas: + if _item: + _items.append(_item.to_dict()) + _dict['quotas'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Quotas from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "quotas": [QuotasQuotasInner.from_dict(_item) for _item in obj.get("quotas")] if obj.get("quotas") is not None else None + }) + return _obj + + diff --git a/usage_api/usage_api/models/quotas_assign_request.py b/usage_api/usage_api/models/quotas_assign_request.py new file mode 100644 index 00000000..bc012722 --- /dev/null +++ b/usage_api/usage_api/models/quotas_assign_request.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.models.organization_quota import OrganizationQuota +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class QuotasAssignRequest(BaseModel): + """ + QuotasAssignRequest + """ # noqa: E501 + organizations: Optional[List[OrganizationQuota]] = None + __properties: ClassVar[List[str]] = ["organizations"] + + 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 QuotasAssignRequest 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 organizations (list) + _items = [] + if self.organizations: + for _item in self.organizations: + if _item: + _items.append(_item.to_dict()) + _dict['organizations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of QuotasAssignRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "organizations": [OrganizationQuota.from_dict(_item) for _item in obj.get("organizations")] if obj.get("organizations") is not None else None + }) + return _obj + + diff --git a/usage_api/usage_api/models/quotas_assign_response.py b/usage_api/usage_api/models/quotas_assign_response.py new file mode 100644 index 00000000..111a9095 --- /dev/null +++ b/usage_api/usage_api/models/quotas_assign_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.models.organization_quota import OrganizationQuota +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class QuotasAssignResponse(BaseModel): + """ + QuotasAssignResponse + """ # noqa: E501 + organizations: Optional[List[OrganizationQuota]] = None + __properties: ClassVar[List[str]] = ["organizations"] + + 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 QuotasAssignResponse 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 organizations (list) + _items = [] + if self.organizations: + for _item in self.organizations: + if _item: + _items.append(_item.to_dict()) + _dict['organizations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of QuotasAssignResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "organizations": [OrganizationQuota.from_dict(_item) for _item in obj.get("organizations")] if obj.get("organizations") is not None else None + }) + return _obj + + diff --git a/usage_api/usage_api/models/quotas_quotas_inner.py b/usage_api/usage_api/models/quotas_quotas_inner.py new file mode 100644 index 00000000..81348854 --- /dev/null +++ b/usage_api/usage_api/models/quotas_quotas_inner.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.models.account_group_quota import AccountGroupQuota +from usage_api.models.organization_quota import OrganizationQuota +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class QuotasQuotasInner(BaseModel): + """ + QuotasQuotasInner + """ # noqa: E501 + organization_quota: Optional[OrganizationQuota] = Field(default=None, alias="organizationQuota") + account_group_quotas: Optional[List[AccountGroupQuota]] = Field(default=None, alias="accountGroupQuotas") + __properties: ClassVar[List[str]] = ["organizationQuota", "accountGroupQuotas"] + + 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 QuotasQuotasInner 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 organization_quota + if self.organization_quota: + _dict['organizationQuota'] = self.organization_quota.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in account_group_quotas (list) + _items = [] + if self.account_group_quotas: + for _item in self.account_group_quotas: + if _item: + _items.append(_item.to_dict()) + _dict['accountGroupQuotas'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of QuotasQuotasInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "organizationQuota": OrganizationQuota.from_dict(obj.get("organizationQuota")) if obj.get("organizationQuota") is not None else None, + "accountGroupQuotas": [AccountGroupQuota.from_dict(_item) for _item in obj.get("accountGroupQuotas")] if obj.get("accountGroupQuotas") is not None else None + }) + return _obj + + diff --git a/usage_api/usage_api/models/quotas_unassign.py b/usage_api/usage_api/models/quotas_unassign.py new file mode 100644 index 00000000..5ef37ea4 --- /dev/null +++ b/usage_api/usage_api/models/quotas_unassign.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 QuotasUnassign(BaseModel): + """ + QuotasUnassign + """ # noqa: E501 + organizations: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["organizations"] + + 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 QuotasUnassign 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 QuotasUnassign from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "organizations": obj.get("organizations") + }) + return _obj + + diff --git a/usage_api/usage_api/models/self_links.py b/usage_api/usage_api/models/self_links.py new file mode 100644 index 00000000..1cf60f8f --- /dev/null +++ b/usage_api/usage_api/models/self_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_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 + + diff --git a/usage_api/usage_api/models/self_links_links.py b/usage_api/usage_api/models/self_links_links.py new file mode 100644 index 00000000..af7798a1 --- /dev/null +++ b/usage_api/usage_api/models/self_links_links.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_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 + + diff --git a/usage_api/usage_api/models/tests_inner.py b/usage_api/usage_api/models/tests_inner.py new file mode 100644 index 00000000..460876ab --- /dev/null +++ b/usage_api/usage_api/models/tests_inner.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 TestsInner(BaseModel): + """ + TestsInner + """ # noqa: E501 + aid: Optional[Any] = Field(default=None, description="Unique identifier of the account group which owns the test.") + account_group_name: Optional[Any] = Field(default=None, description="Name of the account group which owns the test.", alias="accountGroupName") + test_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the test generating usage.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test generating usage.", alias="testName") + test_type: Optional[StrictStr] = Field(default=None, description="The type of test that generated the usage data. Note that this parameter provides a user-friendly description of the test type and should not be parsed to determine the endpoint for querying configuration details.", alias="testType") + cloud_units_used: Optional[StrictInt] = Field(default=None, description="Number of cloud units that the test has consumed in the usage period.", alias="cloudUnitsUsed") + cloud_units_projected: Optional[StrictInt] = Field(default=None, description="The estimated number of cloud units that the test is expected to consume during the usage period. This estimate is determined by considering the units consumed up to the current time and the test's configuration. It's important to note that this value is updated every hour. For new tests, the `cloudUnitsProjected` parameter is absent until the projection is calculated.", alias="cloudUnitsProjected") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "testId", "testName", "testType", "cloudUnitsUsed", "cloudUnitsProjected"] + + 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 TestsInner 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, + ) + # set to None if aid (nullable) is None + # and model_fields_set contains the field + if self.aid is None and "aid" in self.model_fields_set: + _dict['aid'] = None + + # set to None if account_group_name (nullable) is None + # and model_fields_set contains the field + if self.account_group_name is None and "account_group_name" in self.model_fields_set: + _dict['accountGroupName'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of TestsInner 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"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "testType": obj.get("testType"), + "cloudUnitsUsed": obj.get("cloudUnitsUsed"), + "cloudUnitsProjected": obj.get("cloudUnitsProjected") + }) + return _obj + + diff --git a/usage_api/usage_api/models/unauthorized_error.py b/usage_api/usage_api/models/unauthorized_error.py new file mode 100644 index 00000000..91640452 --- /dev/null +++ b/usage_api/usage_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 + + diff --git a/usage_api/usage_api/models/usage.py b/usage_api/usage_api/models/usage.py new file mode 100644 index 00000000..a982ea21 --- /dev/null +++ b/usage_api/usage_api/models/usage.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_api.models.usage_usage import UsageUsage +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Usage(BaseModel): + """ + Usage + """ # noqa: E501 + usage: Optional[UsageUsage] = None + __properties: ClassVar[List[str]] = ["usage"] + + 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 Usage 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 usage + if self.usage: + _dict['usage'] = self.usage.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Usage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "usage": UsageUsage.from_dict(obj.get("usage")) if obj.get("usage") is not None else None + }) + return _obj + + diff --git a/usage_api/usage_api/models/usage_usage.py b/usage_api/usage_api/models/usage_usage.py new file mode 100644 index 00000000..d9456cb8 --- /dev/null +++ b/usage_api/usage_api/models/usage_usage.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 +from pydantic import Field +from usage_api.models.endpoint_agents_embedded_inner import EndpointAgentsEmbeddedInner +from usage_api.models.endpoint_agents_essentials_inner import EndpointAgentsEssentialsInner +from usage_api.models.endpoint_agents_inner import EndpointAgentsInner +from usage_api.models.enterprise_agent_units_inner import EnterpriseAgentUnitsInner +from usage_api.models.enterprise_agents_inner import EnterpriseAgentsInner +from usage_api.models.tests_inner import TestsInner +from usage_api.models.usage_usage_quota import UsageUsageQuota +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UsageUsage(BaseModel): + """ + UsageUsage + """ # noqa: E501 + quota: Optional[UsageUsageQuota] = None + cloud_units_used: Optional[StrictInt] = Field(default=None, description="Number of cloud units consumed thus far in the usage period.", alias="cloudUnitsUsed") + cloud_units_projected: Optional[StrictInt] = Field(default=None, description="Number of cloud units projected in the current usage period, based on units consumed to date and configuration of enabled tests. This value is updated hourly.", alias="cloudUnitsProjected") + cloud_units_next_billing_period: Optional[StrictInt] = Field(default=None, description="Number of cloud units projected in the upcoming usage period, based on configuration of enabled tests. This value is updated hourly.", alias="cloudUnitsNextBillingPeriod") + enterprise_units_used: Optional[StrictInt] = Field(default=None, description="Number of enterprise units consumed in the usage period. Returns non-zero value only for organizations with metered billing.", alias="enterpriseUnitsUsed") + enterprise_units_projected: Optional[StrictInt] = Field(default=None, description="Number of enterprise units projected in the current usage period, based on units consumed to date and configuration of enabled tests. This value is updated hourly. Returns non-zero value only for organizations with metered billing.", alias="enterpriseUnitsProjected") + enterprise_units_next_billing_period: Optional[StrictInt] = Field(default=None, description="Number of enterprise units projected in the upcoming usage period, based on configuration of enabled tests. This value is updated hourly. Returns non-zero value only for organizations with metered billing.", alias="enterpriseUnitsNextBillingPeriod") + endpoint_agents_used: Optional[StrictInt] = Field(default=None, description="Number of endpoint agents used in the current usage period. This number is calculated by taking the maximum number of agents enabled for any one-hour period in the usage period. Disabled agents are excluded from this calculation.", alias="endpointAgentsUsed") + endpoint_agents_essentials_used: Optional[StrictInt] = Field(default=None, description="Number of endpoint agents essentials used in the current usage period. This number is calculated by taking the maximum number of agents enabled for any one-hour period in the usage period. Disabled agents are excluded from this calculation.", alias="endpointAgentsEssentialsUsed") + endpoint_agents_embedded_used: Optional[StrictInt] = Field(default=None, description="Number of embedded endpoint agents used in the current usage period. This number is calculated by taking the maximum number of agents enabled for any one-hour period in the usage period. Disabled agents are excluded from this calculation.", alias="endpointAgentsEmbeddedUsed") + enterprise_agents_used: Optional[StrictInt] = Field(default=None, description="Number of enterprise agents used in the current usage period. This number is calculated by taking the maximum number of agents enabled for any one-hour period in the usage period. Disabled agents are excluded from this calculation.", alias="enterpriseAgentsUsed") + enterprise_agent_units: Optional[List[EnterpriseAgentUnitsInner]] = Field(default=None, description="A breakdown of enterprise unit consumption for each agent during the current monthly period. Each entry provides data for both the current actual usage and the projected usage. Returns non-zero values for organizations with metered billing.", alias="enterpriseAgentUnits") + tests: Optional[List[TestsInner]] = Field(default=None, description="A breakdown of unit consumption for each test during the current monthly period. Each entry provides information about both the current actual usage and the projected usage.") + endpoint_agents: Optional[List[EndpointAgentsInner]] = Field(default=None, description="Endpoint agents used by account group.", alias="endpointAgents") + endpoint_agents_essentials: Optional[List[EndpointAgentsEssentialsInner]] = Field(default=None, description="Endpoint agents essentials used by account group.", alias="endpointAgentsEssentials") + endpoint_agents_embedded: Optional[List[EndpointAgentsEmbeddedInner]] = Field(default=None, description="Endpoint agents embedded used by account group.", alias="endpointAgentsEmbedded") + enterprise_agents: Optional[List[EnterpriseAgentsInner]] = Field(default=None, description="Enterprise agents used by account group.", alias="enterpriseAgents") + __properties: ClassVar[List[str]] = ["quota", "cloudUnitsUsed", "cloudUnitsProjected", "cloudUnitsNextBillingPeriod", "enterpriseUnitsUsed", "enterpriseUnitsProjected", "enterpriseUnitsNextBillingPeriod", "endpointAgentsUsed", "endpointAgentsEssentialsUsed", "endpointAgentsEmbeddedUsed", "enterpriseAgentsUsed", "enterpriseAgentUnits", "tests", "endpointAgents", "endpointAgentsEssentials", "endpointAgentsEmbedded", "enterpriseAgents"] + + 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 UsageUsage 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 quota + if self.quota: + _dict['quota'] = self.quota.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in enterprise_agent_units (list) + _items = [] + if self.enterprise_agent_units: + for _item in self.enterprise_agent_units: + if _item: + _items.append(_item.to_dict()) + _dict['enterpriseAgentUnits'] = _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 endpoint_agents (list) + _items = [] + if self.endpoint_agents: + for _item in self.endpoint_agents: + if _item: + _items.append(_item.to_dict()) + _dict['endpointAgents'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in endpoint_agents_essentials (list) + _items = [] + if self.endpoint_agents_essentials: + for _item in self.endpoint_agents_essentials: + if _item: + _items.append(_item.to_dict()) + _dict['endpointAgentsEssentials'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in endpoint_agents_embedded (list) + _items = [] + if self.endpoint_agents_embedded: + for _item in self.endpoint_agents_embedded: + if _item: + _items.append(_item.to_dict()) + _dict['endpointAgentsEmbedded'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in enterprise_agents (list) + _items = [] + if self.enterprise_agents: + for _item in self.enterprise_agents: + if _item: + _items.append(_item.to_dict()) + _dict['enterpriseAgents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of UsageUsage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "quota": UsageUsageQuota.from_dict(obj.get("quota")) if obj.get("quota") is not None else None, + "cloudUnitsUsed": obj.get("cloudUnitsUsed"), + "cloudUnitsProjected": obj.get("cloudUnitsProjected"), + "cloudUnitsNextBillingPeriod": obj.get("cloudUnitsNextBillingPeriod"), + "enterpriseUnitsUsed": obj.get("enterpriseUnitsUsed"), + "enterpriseUnitsProjected": obj.get("enterpriseUnitsProjected"), + "enterpriseUnitsNextBillingPeriod": obj.get("enterpriseUnitsNextBillingPeriod"), + "endpointAgentsUsed": obj.get("endpointAgentsUsed"), + "endpointAgentsEssentialsUsed": obj.get("endpointAgentsEssentialsUsed"), + "endpointAgentsEmbeddedUsed": obj.get("endpointAgentsEmbeddedUsed"), + "enterpriseAgentsUsed": obj.get("enterpriseAgentsUsed"), + "enterpriseAgentUnits": [EnterpriseAgentUnitsInner.from_dict(_item) for _item in obj.get("enterpriseAgentUnits")] if obj.get("enterpriseAgentUnits") is not None else None, + "tests": [TestsInner.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None, + "endpointAgents": [EndpointAgentsInner.from_dict(_item) for _item in obj.get("endpointAgents")] if obj.get("endpointAgents") is not None else None, + "endpointAgentsEssentials": [EndpointAgentsEssentialsInner.from_dict(_item) for _item in obj.get("endpointAgentsEssentials")] if obj.get("endpointAgentsEssentials") is not None else None, + "endpointAgentsEmbedded": [EndpointAgentsEmbeddedInner.from_dict(_item) for _item in obj.get("endpointAgentsEmbedded")] if obj.get("endpointAgentsEmbedded") is not None else None, + "enterpriseAgents": [EnterpriseAgentsInner.from_dict(_item) for _item in obj.get("enterpriseAgents")] if obj.get("enterpriseAgents") is not None else None + }) + return _obj + + diff --git a/usage_api/usage_api/models/usage_usage_quota.py b/usage_api/usage_api/models/usage_usage_quota.py new file mode 100644 index 00000000..847310cd --- /dev/null +++ b/usage_api/usage_api/models/usage_usage_quota.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UsageUsageQuota(BaseModel): + """ + UsageUsageQuota + """ # noqa: E501 + month_start: Optional[datetime] = Field(default=None, description="Beginning of usage period in UTC (ISO date-time format).", alias="monthStart") + month_end: Optional[datetime] = Field(default=None, description="End of usage period in UTC (ISO date-time format)..", alias="monthEnd") + cloud_units_included: Optional[StrictInt] = Field(default=None, description="Monthly number of cloud units allocated, as part of the contract.", alias="cloudUnitsIncluded") + endpoint_agents_included: Optional[StrictInt] = Field(default=None, description="Monthly number of endpoint agents allocated, as part of the contract.", alias="endpointAgentsIncluded") + endpoint_agents_essentials_included: Optional[StrictInt] = Field(default=None, description="Monthly number of endpoint agents essentials allocated, as part of the contract.", alias="endpointAgentsEssentialsIncluded") + endpoint_agents_embedded_included: Optional[StrictInt] = Field(default=None, description="Number of embedded endpoint agents allocated monthly, as specified in the contract.", alias="endpointAgentsEmbeddedIncluded") + enterprise_agents_included: Optional[StrictInt] = Field(default=None, description="Monthly number of enterprise agents allocated, as part of the contract. Returns non-zero value only for organizations with legacy billing.", alias="enterpriseAgentsIncluded") + __properties: ClassVar[List[str]] = ["monthStart", "monthEnd", "cloudUnitsIncluded", "endpointAgentsIncluded", "endpointAgentsEssentialsIncluded", "endpointAgentsEmbeddedIncluded", "enterpriseAgentsIncluded"] + + 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 UsageUsageQuota 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 UsageUsageQuota from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "monthStart": obj.get("monthStart"), + "monthEnd": obj.get("monthEnd"), + "cloudUnitsIncluded": obj.get("cloudUnitsIncluded"), + "endpointAgentsIncluded": obj.get("endpointAgentsIncluded"), + "endpointAgentsEssentialsIncluded": obj.get("endpointAgentsEssentialsIncluded"), + "endpointAgentsEmbeddedIncluded": obj.get("endpointAgentsEmbeddedIncluded"), + "enterpriseAgentsIncluded": obj.get("enterpriseAgentsIncluded") + }) + return _obj + + diff --git a/usage_api/usage_api/py.typed b/usage_api/usage_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/usage_api/usage_api/rest.py b/usage_api/usage_api/rest.py new file mode 100644 index 00000000..61bc08d3 --- /dev/null +++ b/usage_api/usage_api/rest.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Usage API + + ## Overview These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View Billing` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View Billing` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the API definitions below for detailed usage instructions and optional parameters. + + 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 usage_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)